1{ lib
2, stdenv
3, fetchFromGitHub
4, fetchpatch
5, cmake
6, static ? stdenv.hostPlatform.isStatic
7, cxxStandard ? null
8}:
9
10stdenv.mkDerivation rec {
11 pname = "abseil-cpp";
12 version = "20211102.0";
13
14 src = fetchFromGitHub {
15 owner = "abseil";
16 repo = "abseil-cpp";
17 rev = version;
18 sha256 = "sha256-sSXT6D4JSrk3dA7kVaxfKkzOMBpqXQb0WbMYWG+nGwk=";
19 };
20
21 cmakeFlags = [
22 "-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}"
23 ] ++ lib.optionals (cxxStandard != null) [
24 "-DCMAKE_CXX_STANDARD=${cxxStandard}"
25 ];
26
27 nativeBuildInputs = [ cmake ];
28
29 meta = with lib; {
30 description = "An open-source collection of C++ code designed to augment the C++ standard library";
31 homepage = "https://abseil.io/";
32 license = licenses.asl20;
33 platforms = platforms.all;
34 maintainers = [ maintainers.andersk ];
35 };
36}