diff options
Diffstat (limited to 'pkgs/development/libraries/re2/default.nix')
-rw-r--r-- | pkgs/development/libraries/re2/default.nix | 88 |
1 files changed, 45 insertions, 43 deletions
diff --git a/pkgs/development/libraries/re2/default.nix b/pkgs/development/libraries/re2/default.nix index 2310ce33ea4f3..278d63702ed2f 100644 --- a/pkgs/development/libraries/re2/default.nix +++ b/pkgs/development/libraries/re2/default.nix @@ -1,61 +1,60 @@ -{ lib -, stdenv -, fetchFromGitHub -, cmake -, ninja -, chromium -, grpc -, haskellPackages -, mercurial -, python3Packages -, abseil-cpp +{ + abseil-cpp, + chromium, + cmake, + fetchFromGitHub, + gbenchmark, + grpc, + gtest, + haskellPackages, + icu, + lib, + mercurial, + ninja, + python3Packages, + stdenv, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "re2"; - version = "2024-05-01"; + version = "2024-07-02"; src = fetchFromGitHub { owner = "google"; repo = "re2"; - rev = version; - hash = "sha256-p4MdHjTk0SQsBPVkEy+EceAN/QTyzBDe7Pd1hJwOs3A="; + rev = finalAttrs.version; + hash = "sha256-IeANwJlJl45yf8iu/AZNDoiyIvTCZIeK1b74sdCfAIc="; }; - outputs = [ "out" "dev" ]; + outputs = [ + "out" + "dev" + ]; - nativeBuildInputs = [ cmake ninja ]; + nativeBuildInputs = [ + cmake + ninja + ]; - propagatedBuildInputs = [ abseil-cpp ]; + buildInputs = [ + gbenchmark + gtest + ]; - postPatch = '' - substituteInPlace re2Config.cmake.in \ - --replace "\''${PACKAGE_PREFIX_DIR}/" "" - ''; + propagatedBuildInputs = [ abseil-cpp ] ++ lib.optionals (!stdenv.hostPlatform.isStatic) [ icu ]; - # Needed for case-insensitive filesystems (i.e. MacOS) because a file named - # BUILD already exists. - cmakeBuildDir = "build_dir"; - - cmakeFlags = lib.optional (!stdenv.hostPlatform.isStatic) "-DBUILD_SHARED_LIBS:BOOL=ON"; - - # This installs a pkg-config definition. - postInstall = '' - pushd "$src" - make common-install prefix="$dev" SED_INPLACE="sed -i" - popd - ''; + cmakeFlags = + [ (lib.cmakeBool "RE2_BUILD_TESTING" true) ] + ++ lib.optionals (!stdenv.hostPlatform.isStatic) [ + (lib.cmakeBool "RE2_USE_ICU" true) + (lib.cmakeBool "BUILD_SHARED_LIBS" true) + ]; doCheck = true; passthru.tests = { - inherit - chromium - grpc - mercurial; - inherit (python3Packages) - fb-re2 - google-re2; + inherit chromium grpc mercurial; + inherit (python3Packages) fb-re2 google-re2; haskell-re2 = haskellPackages.re2; }; @@ -68,7 +67,10 @@ stdenv.mkDerivation rec { ''; license = licenses.bsd3; homepage = "https://github.com/google/re2"; - maintainers = with maintainers; [ azahi networkexception ]; + maintainers = with maintainers; [ + azahi + networkexception + ]; platforms = platforms.all; }; -} +}) |