nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv
2, fetchFromGitHub
3, cmake
4, boost
5, libevent
6, double-conversion
7, glog
8, gflags
9, libiberty
10, lz4
11, xz
12, zlib
13, jemalloc
14, openssl
15, pkg-config
16, libunwind
17, fmt
18}:
19
20stdenv.mkDerivation (rec {
21 pname = "folly";
22 version = "2021.10.25.00";
23
24 src = fetchFromGitHub {
25 owner = "facebook";
26 repo = "folly";
27 rev = "v${version}";
28 sha256 = "sha256-+di8Dzt5NRbqIydBR4sB6bUbQrZZ8URUosdP2JGQMec=";
29 };
30
31 nativeBuildInputs = [
32 cmake
33 pkg-config
34 ];
35
36 # See CMake/folly-deps.cmake in the Folly source tree.
37 buildInputs = [
38 boost
39 double-conversion
40 glog
41 gflags
42 libevent
43 libiberty
44 openssl
45 lz4
46 xz
47 zlib
48 jemalloc
49 libunwind
50 fmt
51 ];
52
53 cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];
54
55 meta = with lib; {
56 description = "An open-source C++ library developed and used at Facebook";
57 homepage = "https://github.com/facebook/folly";
58 license = licenses.asl20;
59 # 32bit is not supported: https://github.com/facebook/folly/issues/103
60 platforms = [ "x86_64-linux" "x86_64-darwin" ];
61 maintainers = with maintainers; [ abbradar pierreis ];
62 };
63} // lib.optionalAttrs stdenv.isDarwin {
64 LDFLAGS = "-ljemalloc";
65})