homebrew-core/Formula/fizz.rb

61 lines
2.3 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.02.15.00/fizz-v2021.02.15.00.tar.gz"
sha256 "7b02d3d469a78b548b9928b8c99cdd755bb4b6c14718394e2d7b4e3935e5c6bd"
license "BSD-2-Clause"
head "https://github.com/facebookincubator/fizz.git"
bottle do
sha256 cellar: :any, arm64_big_sur: "512a61171723090aa9ff15b19db8e405a045aed621b8427d6dc90d5a63530012"
sha256 cellar: :any, big_sur: "6a3eb135f44da8bdd26463a0f623683566a90d1368f1b9242aa5b63cac9d0e6e"
sha256 cellar: :any, catalina: "8435d82392965577b9271bbfd1f3622150d4f480ec894e779e215cca23571d3f"
sha256 cellar: :any, mojave: "737fb2eb24b4d8fa7b949a6d586aefcd2ad770ff9858a24a3c3860fc0074aed8"
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