2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv
|
2020-12-25 13:55:36 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, boost
|
2022-02-20 05:27:41 +00:00
|
|
|
, cmake
|
2020-12-25 13:55:36 +00:00
|
|
|
, double-conversion
|
2022-02-20 05:27:41 +00:00
|
|
|
, fetchpatch
|
|
|
|
, fmt_8
|
2020-12-25 13:55:36 +00:00
|
|
|
, gflags
|
2022-02-20 05:27:41 +00:00
|
|
|
, glog
|
|
|
|
, libevent
|
2020-12-25 13:55:36 +00:00
|
|
|
, libiberty
|
2022-02-20 05:27:41 +00:00
|
|
|
, libunwind
|
2020-12-25 13:55:36 +00:00
|
|
|
, lz4
|
|
|
|
, openssl
|
|
|
|
, pkg-config
|
2022-02-20 05:27:41 +00:00
|
|
|
, xz
|
|
|
|
, zlib
|
|
|
|
, zstd
|
|
|
|
, follyMobile ? false
|
2020-12-25 13:55:36 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "folly";
|
2022-06-26 10:26:21 +00:00
|
|
|
version = "2022.06.13.00";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "facebook";
|
|
|
|
repo = "folly";
|
|
|
|
rev = "v${version}";
|
2022-06-26 10:26:21 +00:00
|
|
|
sha256 = "sha256-30Fzk97wVK0JR/6YllyBjW9KlYrFj+GJpuV+V2bKXL8=";
|
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
|
|
|
|
libunwind
|
2022-02-20 05:27:41 +00:00
|
|
|
fmt_8
|
|
|
|
zstd
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
NIX_CFLAGS_COMPILE = [ "-DFOLLY_MOBILE=${if follyMobile then "1" else "0"}" "-fpermissive" ];
|
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
|
2022-05-18 14:49:53 +00:00
|
|
|
platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" "aarch64-linux" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ abbradar pierreis ];
|
|
|
|
};
|
2022-02-20 05:27:41 +00:00
|
|
|
}
|