nixpkgs/pkgs/development/libraries/re2/default.nix

38 lines
1000 B
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub }:
stdenv.mkDerivation rec {
pname = "re2";
2021-09-29 16:52:23 +00:00
version = "2021-09-01";
2019-05-31 19:21:14 +00:00
src = fetchFromGitHub {
owner = "google";
repo = "re2";
rev = version;
2021-09-29 16:52:23 +00:00
sha256 = "1fyhypw345xz8zdh53gz6j1fwgrx0gszk1d349ja37dpxh4jp2jh";
};
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"
'';
buildFlags = lib.optionals stdenv.hostPlatform.isStatic [ "static" ];
2019-05-31 21:28:45 +00:00
preCheck = "patchShebangs runtests";
doCheck = true;
checkTarget = "test";
installTargets = lib.optionals stdenv.hostPlatform.isStatic [ "static-install" ];
2019-05-31 21:28:45 +00:00
doInstallCheck = true;
installCheckTarget = "testinstall";
meta = {
homepage = "https://github.com/google/re2";
description = "An efficient, principled regular expression library";
license = lib.licenses.bsd3;
platforms = with lib.platforms; all;
};
}