2021-12-06 16:07:01 +00:00
|
|
|
|
{ lib
|
|
|
|
|
, stdenv
|
|
|
|
|
, fetchFromGitHub
|
|
|
|
|
, cmake
|
|
|
|
|
, static ? stdenv.hostPlatform.isStatic
|
|
|
|
|
, cxxStandard ? null
|
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
pname = "abseil-cpp";
|
2022-02-10 20:34:41 +00:00
|
|
|
|
version = "20211102.0";
|
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;
|
2022-02-10 20:34:41 +00:00
|
|
|
|
sha256 = "sha256-sSXT6D4JSrk3dA7kVaxfKkzOMBpqXQb0WbMYWG+nGwk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
|
patches = lib.optionals stdenv.isDarwin [
|
|
|
|
|
# Don’t propagate the path to CoreFoundation. Otherwise, it’s impossible to build packages
|
|
|
|
|
# that require a different SDK other than the default one.
|
|
|
|
|
./cmake-core-foundation.patch
|
|
|
|
|
];
|
|
|
|
|
|
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; {
|
2024-06-20 14:57:18 +00:00
|
|
|
|
description = "Open-source collection of C++ code designed to augment the C++ standard library";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
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 ];
|
|
|
|
|
};
|
|
|
|
|
}
|