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/v2020.11.09.00/fizz-v2020.11.09.00.tar.gz"
sha256 "1ca0905483cdde22402340b8a7efcc3d99027c641eabe01ef16b3fd3e4e42fde"
license "BSD-2-Clause"
head "https://github.com/facebookincubator/fizz.git"
bottle do
cellar :any
sha256 "92283b7eda8acb4e93b3c57298b373fe29a4bfefeb49b4c6048e2ac96802db5c" => :big_sur
sha256 "f8d9f5ada2fc2a4fa5721792e1ba9a646972409493966a5758a7e048deabf543" => :catalina
sha256 "73b9492251604090341e307c35384a144c2577e7d1da65d024d25b303d9e79d5" => :mojave
sha256 "3e6ab422390157aee21dd56c031ea960132541c66724a323b904dc2abb67e184" => :high_sierra
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"
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