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-27 06:49:29 +00:00
|
|
|
version = "2024-06-01";
|
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;
|
|
|
|
hash = "sha256-iQETsjdIFcYM5I/W8ytvV3z/4va6TaZ/+KkSjb8CtF0=";
|
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-27 06:49:29 +00:00
|
|
|
buildInputs = lib.optionals finalAttrs.doCheck [
|
|
|
|
gbenchmark
|
|
|
|
gtest
|
|
|
|
];
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
abseil-cpp
|
|
|
|
icu
|
|
|
|
];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
(lib.cmakeBool "RE2_BUILD_TESTING" finalAttrs.doCheck)
|
|
|
|
(lib.cmakeBool "RE2_USE_ICU" true)
|
|
|
|
] ++ lib.optional (!stdenv.hostPlatform.isStatic) (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
|
|
|
})
|