2024-07-27 06:49:29 +00:00
|
|
|
{
|
|
|
|
abseil-cpp,
|
|
|
|
chromium,
|
|
|
|
cmake,
|
|
|
|
fetchFromGitHub,
|
|
|
|
gbenchmark,
|
|
|
|
grpc,
|
|
|
|
gtest,
|
|
|
|
haskellPackages,
|
|
|
|
icu,
|
|
|
|
lib,
|
|
|
|
mercurial,
|
|
|
|
ninja,
|
|
|
|
python3Packages,
|
|
|
|
stdenv,
|
2022-05-18 14:49:53 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "re2";
|
2024-07-31 10:19:44 +00:00
|
|
|
version = "2024-07-02";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "google";
|
|
|
|
repo = "re2";
|
2024-07-27 06:49:29 +00:00
|
|
|
rev = finalAttrs.version;
|
2024-07-31 10:19:44 +00:00
|
|
|
hash = "sha256-IeANwJlJl45yf8iu/AZNDoiyIvTCZIeK1b74sdCfAIc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"dev"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
ninja
|
|
|
|
];
|
2021-02-05 17:12:51 +00:00
|
|
|
|
2024-07-31 10:19:44 +00:00
|
|
|
buildInputs = [
|
2024-07-27 06:49:29 +00:00
|
|
|
gbenchmark
|
|
|
|
gtest
|
|
|
|
];
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2024-07-31 10:19:44 +00:00
|
|
|
propagatedBuildInputs = [ abseil-cpp ] ++ lib.optionals (!stdenv.hostPlatform.isStatic) [ icu ];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2024-07-31 10:19:44 +00:00
|
|
|
cmakeFlags =
|
|
|
|
[ (lib.cmakeBool "RE2_BUILD_TESTING" true) ]
|
|
|
|
++ lib.optionals (!stdenv.hostPlatform.isStatic) [
|
|
|
|
(lib.cmakeBool "RE2_USE_ICU" true)
|
|
|
|
(lib.cmakeBool "BUILD_SHARED_LIBS" true)
|
|
|
|
];
|
2021-02-05 17:12:51 +00:00
|
|
|
|
2022-11-02 22:02:43 +00:00
|
|
|
doCheck = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-11-02 22:02:43 +00:00
|
|
|
passthru.tests = {
|
2024-07-27 06:49:29 +00:00
|
|
|
inherit chromium grpc mercurial;
|
|
|
|
inherit (python3Packages) fb-re2 google-re2;
|
2022-11-02 22:02:43 +00:00
|
|
|
haskell-re2 = haskellPackages.re2;
|
2022-01-26 04:04:25 +00:00
|
|
|
};
|
|
|
|
|
2022-11-02 22:02:43 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Regular expression library";
|
2022-11-02 22:02:43 +00:00
|
|
|
longDescription = ''
|
|
|
|
RE2 is a fast, safe, thread-friendly alternative to backtracking regular
|
|
|
|
expression engines like those used in PCRE, Perl, and Python. It is a C++
|
|
|
|
library.
|
|
|
|
'';
|
|
|
|
license = licenses.bsd3;
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/google/re2";
|
2024-07-27 06:49:29 +00:00
|
|
|
maintainers = with maintainers; [
|
|
|
|
azahi
|
|
|
|
networkexception
|
|
|
|
];
|
2022-11-02 22:02:43 +00:00
|
|
|
platforms = platforms.all;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2024-07-27 06:49:29 +00:00
|
|
|
})
|