2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub }:
|
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";
|
2021-05-20 23:08:51 +00:00
|
|
|
version = "2021-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;
|
|
|
|
sha256 = "1iia0883lssj7ckbsr0n7yb3gdw24c8wnl2q5hhzlml23h4ipbh3";
|
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" ];
|
|
|
|
|
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";
|
|
|
|
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|