2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv
|
2020-12-25 13:55:36 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, boost
|
|
|
|
, libevent
|
|
|
|
, double-conversion
|
|
|
|
, glog
|
|
|
|
, gflags
|
|
|
|
, libiberty
|
|
|
|
, lz4
|
2021-04-05 15:23:46 +00:00
|
|
|
, xz
|
2020-12-25 13:55:36 +00:00
|
|
|
, zlib
|
|
|
|
, jemalloc
|
|
|
|
, openssl
|
|
|
|
, pkg-config
|
|
|
|
, libunwind
|
|
|
|
, fmt
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-12-25 13:55:36 +00:00
|
|
|
stdenv.mkDerivation (rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "folly";
|
2021-08-08 23:34:03 +00:00
|
|
|
version = "2021.08.02.00";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "facebook";
|
|
|
|
repo = "folly";
|
|
|
|
rev = "v${version}";
|
2021-08-08 23:34:03 +00:00
|
|
|
sha256 = "sha256-Y2CqPlhbfC++udbbURnI9mvRZswC8kmikp1HY0qJz4k=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-12-25 13:55:36 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# See CMake/folly-deps.cmake in the Folly source tree.
|
|
|
|
buildInputs = [
|
|
|
|
boost
|
|
|
|
double-conversion
|
|
|
|
glog
|
|
|
|
gflags
|
|
|
|
libevent
|
|
|
|
libiberty
|
|
|
|
openssl
|
2020-12-25 13:55:36 +00:00
|
|
|
lz4
|
2021-04-05 15:23:46 +00:00
|
|
|
xz
|
2020-12-25 13:55:36 +00:00
|
|
|
zlib
|
|
|
|
jemalloc
|
|
|
|
libunwind
|
|
|
|
fmt
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2020-12-25 13:55:36 +00:00
|
|
|
cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
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 ];
|
|
|
|
};
|
2021-02-05 17:12:51 +00:00
|
|
|
} // lib.optionalAttrs stdenv.isDarwin {
|
2020-12-25 13:55:36 +00:00
|
|
|
LDFLAGS = "-ljemalloc";
|
|
|
|
})
|