1{ stdenv
2, fetchFromGitHub
3, cmake
4, boost
5, libevent
6, double-conversion
7, glog
8, lib
9, fmt_8
10, zstd
11, gflags
12, libiberty
13, openssl
14, folly
15, libsodium
16, gtest
17, zlib
18}:
19
20stdenv.mkDerivation (finalAttrs: {
21 pname = "fizz";
22 version = "2024.03.11.00";
23
24 src = fetchFromGitHub {
25 owner = "facebookincubator";
26 repo = "fizz";
27 rev = "refs/tags/v${finalAttrs.version}";
28 hash = "sha256-IHWotiVUjGOvebXy4rwsh8U8UMxTrF1VaqXzZMjojiM=";
29 };
30
31 nativeBuildInputs = [ cmake ];
32
33 cmakeDir = "../fizz";
34
35 cmakeFlags = [
36 "-Wno-dev"
37 (lib.cmakeBool "BUILD_TESTS" finalAttrs.finalPackage.doCheck)
38 ] ++ lib.optionals stdenv.isDarwin [
39 "-DCMAKE_OSX_DEPLOYMENT_TARGET=10.14" # For aligned allocation
40 ];
41
42 NIX_LDFLAGS = "-lz";
43
44 buildInputs = [
45 fmt_8
46 boost
47 double-conversion
48 folly
49 glog
50 gflags
51 libevent
52 libiberty
53 libsodium
54 openssl
55 zlib
56 zstd
57 ];
58
59 doCheck = true;
60 checkInputs = [
61 gtest
62 ];
63 preCheck = let
64 disabledTests = [
65 # these don't work with openssl 3.x probably due to
66 # https://github.com/openssl/openssl/issues/13283
67 "DefaultCertificateVerifierTest.TestVerifySuccess"
68 "DefaultCertificateVerifierTest.TestVerifyWithIntermediates"
69
70 # timing-related & flaky
71 "SlidingBloomReplayCacheTest.TestTimeBucketing"
72 ];
73 in ''
74 export GTEST_FILTER="-${lib.concatStringsSep ":" disabledTests}"
75 '';
76
77 meta = with lib; {
78 description = "C++14 implementation of the TLS-1.3 standard";
79 homepage = "https://github.com/facebookincubator/fizz";
80 changelog = "https://github.com/facebookincubator/fizz/releases/tag/v${finalAttrs.version}";
81 license = licenses.bsd3;
82 platforms = platforms.unix;
83 maintainers = with maintainers; [ pierreis kylesferrazza ];
84 };
85})