<commit_before>{ stdenv, fetchFromGitHub }:

stdenv.mkDerivation {
  pname = "agrep";
  version = "3.41.5";

  src = fetchFromGitHub {
    owner = "Wikinaut";
    repo = "agrep";
    # This repository has numbered versions, but not Git tags.
    rev = "eef20411d605d9d17ead07a0ade75046f2728e21";
    sha256 = "14addnwspdf2mxpqyrw8b84bb2257y43g5ccy4ipgrr91fmxq2sk";
  };

  # Related: https://github.com/Wikinaut/agrep/pull/11
  prePatch = stdenv.lib.optionalString (stdenv.hostPlatform.isMusl || stdenv.isDarwin) ''
    sed -i '1i#include <sys/stat.h>' checkfil.c newmgrep.c recursiv.c
  '';
  installPhase = ''
    install -Dm 555 agrep -t "$out/bin"
    install -Dm 444 docs/* -t "$out/doc"
  '';

  meta = {
    description = "Approximate grep for fast fuzzy string searching";
    homepage = "https://www.tgries.de/agrep/";
    license = stdenv.lib.licenses.isc;
    platforms = stdenv.lib.platforms.linux;
  };
}<commit_msg>agrep: enable on darwin<commit_after>{ stdenv, fetchFromGitHub }:

stdenv.mkDerivation {
  pname = "agrep";
  version = "3.41.5";

  src = fetchFromGitHub {
    owner = "Wikinaut";
    repo = "agrep";
    # This repository has numbered versions, but not Git tags.
    rev = "eef20411d605d9d17ead07a0ade75046f2728e21";
    sha256 = "14addnwspdf2mxpqyrw8b84bb2257y43g5ccy4ipgrr91fmxq2sk";
  };

  # Related: https://github.com/Wikinaut/agrep/pull/11
  prePatch = stdenv.lib.optionalString (stdenv.hostPlatform.isMusl || stdenv.isDarwin) ''
    sed -i '1i#include <sys/stat.h>' checkfil.c newmgrep.c recursiv.c
  '';
  installPhase = ''
    install -Dm 555 agrep -t "$out/bin"
    install -Dm 444 docs/* -t "$out/doc"
  '';

  makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];

  meta = with stdenv.lib; {
    description = "Approximate grep for fast fuzzy string searching";
    homepage = "https://www.tgries.de/agrep/";
    license = licenses.isc;
    platforms = with platforms; linux ++ darwin;
  };
}
{'fraction_non_alphanumeric': 0.13923395445134576, 'fraction_numerical': 0.060041407867494824, 'mean_word_length': 3.43348623853211, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, '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': '2994314', 'n_tokens_mistral': 838, 'n_tokens_neox': 752, 'n_words': 146}