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