2021-05-22 15:11:44 +02:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, static ? stdenv.hostPlatform.isStatic }:
|
2019-03-27 01:02:15 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "abseil-cpp";
|
2021-09-01 06:20:00 +02:00
|
|
|
version = "20210324.2";
|
2019-03-27 01:02:15 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "abseil";
|
|
|
|
repo = "abseil-cpp";
|
2020-05-04 12:11:55 +02:00
|
|
|
rev = version;
|
2021-09-01 06:20:00 +02:00
|
|
|
sha256 = "0g9rbhk3mwjdfxk7cscd04vm8fphd5flz9yykpgvyy1nwa34zk3x";
|
2019-03-27 01:02:15 +01:00
|
|
|
};
|
|
|
|
|
2021-05-22 15:11:44 +02: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-13 20:58:22 +01:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DCMAKE_CXX_STANDARD=17"
|
2021-03-20 05:20:00 +01:00
|
|
|
"-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}"
|
2021-02-13 20:58:22 +01:00
|
|
|
];
|
|
|
|
|
2019-03-27 01:02:15 +01:00
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
2021-01-21 18:00:13 +01:00
|
|
|
meta = with lib; {
|
2019-03-27 01:02:15 +01:00
|
|
|
description = "An open-source collection of C++ code designed to augment the C++ standard library";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://abseil.io/";
|
2019-03-27 01:02:15 +01:00
|
|
|
license = licenses.asl20;
|
2020-05-04 12:11:55 +02:00
|
|
|
platforms = platforms.all;
|
2019-03-27 01:02:15 +01:00
|
|
|
maintainers = [ maintainers.andersk ];
|
|
|
|
};
|
|
|
|
}
|