<commit_before>{ stdenv, fetchurl }:

stdenv.mkDerivation rec {
  name = "re2-${version}";
  version = "20140304";

  src = fetchurl {
    url = "https://re2.googlecode.com/files/${name}.tgz";
    sha256 = "19wn0472c9dsxp35d0m98hlwhngx1f2xhxqgr8cb5x72gnjx3zqb";
  };

  preConfigure = ''
    substituteInPlace Makefile --replace "/usr/local" "$out"
  '' + stdenv.lib.optionalString stdenv.isDarwin ''
    # Fixed in https://github.com/google/re2/commit/b2c9765b4a7afbea8b6be1dae548b6f4d5f39e42
    substituteInPlace Makefile \
        --replace '-dynamiclib' '-dynamiclib -Wl,-install_name,$(libdir)/libre2.so.$(SONAME)'
  '';

  meta = {
    homepage = https://code.google.com/p/re2/;
    description = "An efficient, principled regular expression library";
    license = stdenv.lib.licenses.bsd3;
    platforms = with stdenv.lib.platforms; all;
  };
}
<commit_msg>re2: 20140304 -> 20190401<commit_after>{ stdenv, fetchFromGitHub }:

stdenv.mkDerivation rec {
  name = "re2-${version}";
  version = "20190401";

  src = fetchFromGitHub {
    owner = "google";
    repo = "re2";
    rev = "2019-04-01";
    sha256 = "018b8z3fgcr02rmhxdz80r363k40938cbgmk1c9b46k6xkc4q0hd";
  };

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

  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;
  };
}

{'fraction_non_alphanumeric': 0.14373843306600864, 'fraction_numerical': 0.07402837754472548, 'mean_word_length': 3.5690140845070424, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3388995', 'n_tokens_mistral': 690, 'n_tokens_neox': 631, 'n_words': 105}