homebrew-core/Formula/fizz.rb

62 lines
2.2 KiB
Ruby

class Fizz < Formula
desc "C++14 implementation of the TLS-1.3 standard"
homepage "https://github.com/facebookincubator/fizz"
url "https://github.com/facebookincubator/fizz/releases/download/v2021.04.19.00/fizz-v2021.04.19.00.tar.gz"
sha256 "d2f9c9f72bdfed623b9b8336faa78b37d217760e2ae38233ac61e0ff7155082e"
license "BSD-2-Clause"
head "https://github.com/facebookincubator/fizz.git"
bottle do
sha256 cellar: :any, arm64_big_sur: "136936e3921c2857f6eb25df1c19382c06ab8a0f878d95f9e6e56e3d946191bf"
sha256 cellar: :any, big_sur: "225e81264fbae5bb0ab650c2f02f93cd6a560bb30ad60bcd20113014a889f5c1"
sha256 cellar: :any, catalina: "c67567132363a5ae2ecd1257a1243e83d4b6537e1d42ac952773033f936fe63a"
end
depends_on "cmake" => :build
depends_on "boost"
depends_on "double-conversion"
depends_on "fmt"
depends_on "folly"
depends_on "gflags"
depends_on "glog"
depends_on "libevent"
depends_on "libsodium"
depends_on "lz4"
# https://github.com/facebook/folly/issues/1545
depends_on macos: :catalina
depends_on "openssl@1.1"
depends_on "snappy"
depends_on "zstd"
def install
mkdir "fizz/build" do
system "cmake", "..", "-DBUILD_TESTS=OFF", "-DBUILD_SHARED_LIBS=ON", *std_cmake_args
system "make"
system "make", "install"
end
end
test do
(testpath/"test.cpp").write <<~EOS
#include <fizz/client/AsyncFizzClient.h>
#include <iostream>
int main() {
auto context = fizz::client::FizzClientContext();
std::cout << toString(context.getSupportedVersions()[0]) << std::endl;
}
EOS
system ENV.cxx, "-std=c++14", "test.cpp", "-o", "test",
"-I#{include}",
"-I#{Formula["openssl@1.1"].opt_include}",
"-L#{lib}", "-lfizz",
"-L#{Formula["folly"].opt_lib}", "-lfolly",
"-L#{Formula["gflags"].opt_lib}", "-lgflags",
"-L#{Formula["glog"].opt_lib}", "-lglog",
"-L#{Formula["libevent"].opt_lib}", "-levent",
"-L#{Formula["libsodium"].opt_lib}", "-lsodium",
"-L#{Formula["openssl@1.1"].opt_lib}", "-lcrypto", "-lssl"
assert_match "TLS", shell_output("./test")
end
end