3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/libraries/re2/default.nix
sterni 33406ad455
re2: 20201001 -> 20210401 (#119742)
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2021-04-19 02:49:45 +02:00

38 lines
1,000 B
Nix

{ lib, stdenv, fetchFromGitHub }:
stdenv.mkDerivation rec {
pname = "re2";
version = "2021-04-01";
src = fetchFromGitHub {
owner = "google";
repo = "re2";
rev = version;
sha256 = "1iia0883lssj7ckbsr0n7yb3gdw24c8wnl2q5hhzlml23h4ipbh3";
};
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"
'';
buildFlags = lib.optionals stdenv.hostPlatform.isStatic [ "static" ];
preCheck = "patchShebangs runtests";
doCheck = true;
checkTarget = "test";
installTargets = lib.optionals stdenv.hostPlatform.isStatic [ "static-install" ];
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;
};
}