61 lines
2.1 KiB
Ruby
61 lines
2.1 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.10.26.00/fizz-v2020.10.26.00.tar.gz"
|
|
sha256 "e4803b5cedd1dc2b51963c5e75f4a17dfe872e96e67dcf62948297db90dc7d78"
|
|
license "BSD-2-Clause"
|
|
head "https://github.com/facebookincubator/fizz.git"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "f08634303bebfa2de1eb06164d067f7f304efd2ca5768a6f462b59ecff01d315" => :catalina
|
|
sha256 "dddf074503b463890d489e5ec054f1250b0ffcdc1d8b33facd918f5a967d5006" => :mojave
|
|
sha256 "64b036ca36821ae5f22184213cb2bb4e2f7e090d525740461b7d50053793c027" => :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
|