<commit_before>{ lib, stdenv, fetchFromGitHub, python }:

stdenv.mkDerivation rec {
  pname = "jxrlib";
  version = "1.1";

  # Use the source from a fork on github because CodePlex does not
  # deliver an easily downloadable tarball.
  src = fetchFromGitHub {
    owner = "4creators";
    repo = pname;
    rev = "f7521879862b9085318e814c6157490dd9dbbdb4";
    sha256 = "0rk3hbh00nw0wgbfbqk1szrlfg3yq7w6ar16napww3nrlm9cj65w";
  };

  postPatch = lib.optionalString stdenv.isDarwin ''
    substituteInPlace Makefile \
      --replace '-shared' '-dynamiclib -undefined dynamic_lookup' \
      --replace '.so' '.dylib'
  '';

  nativeBuildInputs = [ python ];

  makeFlags = [ "DIR_INSTALL=$(out)" "SHARED=1" ];<commit_msg>jxrlib: use python3<commit_after>{ lib, stdenv, fetchFromGitHub, python3 }:

stdenv.mkDerivation rec {
  pname = "jxrlib";
  version = "1.1";

  # Use the source from a fork on github because CodePlex does not
  # deliver an easily downloadable tarball.
  src = fetchFromGitHub {
    owner = "4creators";
    repo = pname;
    rev = "f7521879862b9085318e814c6157490dd9dbbdb4";
    sha256 = "0rk3hbh00nw0wgbfbqk1szrlfg3yq7w6ar16napww3nrlm9cj65w";
  };

  postPatch = lib.optionalString stdenv.isDarwin ''
    substituteInPlace Makefile \
      --replace '-shared' '-dynamiclib -undefined dynamic_lookup' \
      --replace '.so' '.dylib'
  '';

  nativeBuildInputs = [ python3 ];

  strictDeps = true;

  makeFlags = [ "DIR_INSTALL=$(out)" "SHARED=1" ];
{'fraction_non_alphanumeric': 0.11752717391304347, 'fraction_numerical': 0.07133152173913043, 'mean_word_length': 3.7060702875399363, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3128970', 'n_tokens_mistral': 621, 'n_tokens_neox': 553, 'n_words': 116}