about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/folly/default.nix
blob: b2774e41ce466c5372692945de4def995aa3f48d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{ lib, stdenv
, fetchFromGitHub
, cmake
, boost
, libevent
, double-conversion
, glog
, gflags
, libiberty
, lz4
, xz
, zlib
, jemalloc
, openssl
, pkg-config
, libunwind
, fmt
}:

stdenv.mkDerivation (rec {
  pname = "folly";
  version = "2021.08.30.00";

  src = fetchFromGitHub {
    owner = "facebook";
    repo = "folly";
    rev = "v${version}";
    sha256 = "sha256-LS1FD5NMLkv7dr4j1b75aEdTDJdbjrXymF7eDFPGRDI=";
  };

  nativeBuildInputs = [
    cmake
    pkg-config
  ];

  # See CMake/folly-deps.cmake in the Folly source tree.
  buildInputs = [
    boost
    double-conversion
    glog
    gflags
    libevent
    libiberty
    openssl
    lz4
    xz
    zlib
    jemalloc
    libunwind
    fmt
  ];

  cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];

  meta = with lib; {
    description = "An open-source C++ library developed and used at Facebook";
    homepage = "https://github.com/facebook/folly";
    license = licenses.asl20;
    # 32bit is not supported: https://github.com/facebook/folly/issues/103
    platforms = [ "x86_64-linux" "x86_64-darwin" ];
    maintainers = with maintainers; [ abbradar pierreis ];
  };
} // lib.optionalAttrs stdenv.isDarwin {
  LDFLAGS = "-ljemalloc";
})