2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, cmake
|
|
|
|
, static ? stdenv.hostPlatform.isStatic
|
|
|
|
, cxxStandard ? null
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "abseil-cpp";
|
2021-09-18 10:52:07 +00:00
|
|
|
version = "20210324.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "abseil";
|
|
|
|
repo = "abseil-cpp";
|
2020-05-15 21:57:56 +00:00
|
|
|
rev = version;
|
2021-09-18 10:52:07 +00:00
|
|
|
sha256 = "0g9rbhk3mwjdfxk7cscd04vm8fphd5flz9yykpgvyy1nwa34zk3x";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
patches = [
|
|
|
|
# Use CMAKE_INSTALL_FULL_{LIBDIR,INCLUDEDIR}
|
|
|
|
# https://github.com/abseil/abseil-cpp/pull/963
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/abseil/abseil-cpp/commit/5bfa70c75e621c5d5ec095c8c4c0c050dcb2957e.patch";
|
|
|
|
sha256 = "0nhjxqfxpi2pkfinnqvd5m4npf9l1kg39mjx9l3087ajhadaywl5";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-02-22 21:28:39 +00:00
|
|
|
cmakeFlags = [
|
2021-03-20 04:20:00 +00:00
|
|
|
"-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}"
|
2021-12-06 16:07:01 +00:00
|
|
|
] ++ lib.optionals (cxxStandard != null) [
|
|
|
|
"-DCMAKE_CXX_STANDARD=${cxxStandard}"
|
2021-02-22 21:28:39 +00:00
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "An open-source collection of C++ code designed to augment the C++ standard library";
|
|
|
|
homepage = "https://abseil.io/";
|
|
|
|
license = licenses.asl20;
|
2020-05-15 21:57:56 +00:00
|
|
|
platforms = platforms.all;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = [ maintainers.andersk ];
|
|
|
|
};
|
|
|
|
}
|