2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub }:
|
2013-08-15 13:07:04 +00:00
|
|
|
|
2021-04-19 00:49:45 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "re2";
|
2021-09-29 16:52:23 +00:00
|
|
|
version = "2021-09-01";
|
2013-08-15 13:07:04 +00:00
|
|
|
|
2019-05-31 19:21:14 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "google";
|
|
|
|
repo = "re2";
|
2021-04-19 00:49:45 +00:00
|
|
|
rev = version;
|
2021-09-29 16:52:23 +00:00
|
|
|
sha256 = "1fyhypw345xz8zdh53gz6j1fwgrx0gszk1d349ja37dpxh4jp2jh";
|
2013-08-15 13:07:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
substituteInPlace Makefile --replace "/usr/local" "$out"
|
2019-05-31 19:21:14 +00:00
|
|
|
# we're using gnu sed, even on darwin
|
|
|
|
substituteInPlace Makefile --replace "SED_INPLACE=sed -i '''" "SED_INPLACE=sed -i"
|
2013-08-15 13:07:04 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-23 23:54:44 +00:00
|
|
|
buildFlags = lib.optionals stdenv.hostPlatform.isStatic [ "static" ];
|
|
|
|
|
2019-05-31 21:28:45 +00:00
|
|
|
preCheck = "patchShebangs runtests";
|
|
|
|
doCheck = true;
|
|
|
|
checkTarget = "test";
|
|
|
|
|
2021-01-23 23:54:44 +00:00
|
|
|
installTargets = lib.optionals stdenv.hostPlatform.isStatic [ "static-install" ];
|
|
|
|
|
2019-05-31 21:28:45 +00:00
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckTarget = "testinstall";
|
|
|
|
|
2013-08-15 13:07:04 +00:00
|
|
|
meta = {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/google/re2";
|
2013-08-15 13:07:04 +00:00
|
|
|
description = "An efficient, principled regular expression library";
|
2021-01-21 17:00:13 +00:00
|
|
|
license = lib.licenses.bsd3;
|
|
|
|
platforms = with lib.platforms; all;
|
2013-08-15 13:07:04 +00:00
|
|
|
};
|
|
|
|
}
|