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.05.17.00/fizz-v2021.05.17.00.tar.gz"
sha256 "9a58f9387f6244d6839b6bd2004109c030715386368ac32e9137382dcb74f400"
license "BSD-2-Clause"
head "https://github.com/facebookincubator/fizz.git"
bottle do
sha256 cellar: :any, arm64_big_sur: "0d826bedb4df423ef6243178ba0369375d4f9ee2205838c065ac07969ff1b103"
sha256 cellar: :any, big_sur: "5d8410a945f9aa3cc51d229ea8bd4859e3d54ec05f9394bbc588ea3ec5098baf"
sha256 cellar: :any, catalina: "588d696867078844fca07eb0f705982e41d3e6f3ecee125bf8fb219cd4930636"
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