2022-03-30 09:31:56 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, nix-update-script }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "re2";
|
2022-04-27 09:35:20 +00:00
|
|
|
version = "2022-04-01";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "google";
|
|
|
|
repo = "re2";
|
2021-05-20 23:08:51 +00:00
|
|
|
rev = version;
|
2022-04-27 09:35:20 +00:00
|
|
|
sha256 = "sha256-ywmXIAyVWYMKBOsAndcq7dFYpn9ZgNz5YWTPjylXxsk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
substituteInPlace Makefile --replace "/usr/local" "$out"
|
|
|
|
# we're using gnu sed, even on darwin
|
|
|
|
substituteInPlace Makefile --replace "SED_INPLACE=sed -i '''" "SED_INPLACE=sed -i"
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
buildFlags = lib.optionals stdenv.hostPlatform.isStatic [ "static" ];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
enableParallelBuilding = true;
|
2022-03-30 09:31:56 +00:00
|
|
|
# Broken when shared/static are tested in parallel:
|
|
|
|
# cp: cannot create regular file 'obj/testinstall.cc': File exists
|
|
|
|
# make: *** [Makefile:334: static-testinstall] Error 1
|
|
|
|
# Will be fixed by https://code-review.googlesource.com/c/re2/+/59830
|
|
|
|
enableParallelChecking = false;
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
preCheck = "patchShebangs runtests";
|
|
|
|
doCheck = true;
|
|
|
|
checkTarget = "test";
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
installTargets = lib.optionals stdenv.hostPlatform.isStatic [ "static-install" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckTarget = "testinstall";
|
|
|
|
|
2022-01-26 04:04:25 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = nix-update-script {
|
|
|
|
attrPath = pname;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = {
|
|
|
|
homepage = "https://github.com/google/re2";
|
|
|
|
description = "An efficient, principled regular expression library";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = lib.licenses.bsd3;
|
|
|
|
platforms = with lib.platforms; all;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|