summary refs log tree commit diff
path: root/pkgs/development/libraries/re2/default.nix
blob: d36b24d61084ed3fc515c62ca3ab666069953b79 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{ stdenv, fetchFromGitHub }:

stdenv.mkDerivation {
  pname = "re2";
  version = "20201001";

  src = fetchFromGitHub {
    owner = "google";
    repo = "re2";
    rev = "2020-10-01";
    sha256 = "0a5f7av1pk6p3jxc2w6prl00lyrplap97m68hnhw7jllnwljk0bx";
  };

  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"
  '';

  preCheck = "patchShebangs runtests";
  doCheck = true;
  checkTarget = "test";

  doInstallCheck = true;
  installCheckTarget = "testinstall";

  meta = {
    homepage = "https://github.com/google/re2";
    description = "An efficient, principled regular expression library";
    license = stdenv.lib.licenses.bsd3;
    platforms = with stdenv.lib.platforms; all;
  };
}