<commit_before>{ stdenv, fetchurl, makeWrapper
, haskellPackages, haskell
, which, swiProlog, rlwrap, tk
, curl, git, unzip, gnutar, coreutils, sqlite }:

let
  name = "pakcs-2.2.0";

  # Don't switch to development release without a reason, because its
  # source updates without version bump. Prefer current release instead.
  src = fetchurl {
    url = "https://www.informatik.uni-kiel.de/~pakcs/download/${name}-src.tar.gz";
    sha256 = "0c0a6cp9lwha5i90kv9ya2zi1ggnvkf4gwjfzbffgwwa77s2wz2l";
  };

  curry-frontend = (haskellPackages.override {
    overrides = self: super: {
      curry-base = haskell.lib.overrideCabal (super.callPackage ./curry-base.nix {}) (drv: {
        inherit src;
        postUnpack = "sourceRoot+=/frontend/curry-base";
      });
      curry-frontend = haskell.lib.overrideCabal (super.callPackage ./curry-frontend.nix {}) (drv: {
        inherit src;
        postUnpack = "sourceRoot+=/frontend/curry-frontend";
      });
    };
  }).curry-frontend;
in stdenv.mkDerivation {
  inherit name src;

  buildInputs = [ swiProlog ];
  nativeBuildInputs = [ which makeWrapper ];

  makeFlags = [
    "CURRYFRONTEND=${curry-frontend}/bin/curry-frontend"
    "DISTPKGINSTALL=yes"
    # Not needed, just to make script pass
    "CURRYTOOLSDIR=0"
    "CURRYLIBSDIR=0"
  ];

  preConfigure = ''
    # Since we can't expand $out in `makeFlags`
    #makeFlags="$makeFlags PAKCSINSTALLDIR=$out/pakcs"

    for file in currytools/cpm/src/CPM/Repository.curry \
                currytools/cpm/src/CPM/Repository/CacheDB.curry \<commit_msg>pakcs: 2.2.0 -> 2.2.1<commit_after>{ stdenv, fetchurl, makeWrapper
, haskellPackages, haskell
, which, swiProlog, rlwrap, tk
, curl, git, unzip, gnutar, coreutils, sqlite }:

let
  pname = "pakcs";
  version = "2.2.1";

  # Don't switch to "Current release" without a reason, because its
  # source updates without version bump. Prefer last from "Older releases" instead.
  src = fetchurl {
    url = "https://www.informatik.uni-kiel.de/~pakcs/download/pakcs-${version}-src.tar.gz";
    sha256 = "1jyg29j8r8pgcin7ixdya6c3zzfjdi66rghpwrfnkk133fz4iz7s";
  };

  curry-frontend = (haskellPackages.override {
    overrides = self: super: {
      curry-base = haskell.lib.overrideCabal (super.callPackage ./curry-base.nix {}) (drv: {
        inherit src;
        postUnpack = "sourceRoot+=/frontend/curry-base";
      });
      curry-frontend = haskell.lib.overrideCabal (super.callPackage ./curry-frontend.nix {}) (drv: {
        inherit src;
        postUnpack = "sourceRoot+=/frontend/curry-frontend";
      });
    };
  }).curry-frontend;
in stdenv.mkDerivation {
  inherit pname version src;

  buildInputs = [ swiProlog ];
  nativeBuildInputs = [ which makeWrapper ];

  makeFlags = [
    "CURRYFRONTEND=${curry-frontend}/bin/curry-frontend"
    "DISTPKGINSTALL=yes"
    # Not needed, just to make script pass
    "CURRYTOOLSDIR=0"
    "CURRYLIBSDIR=0"
  ];

  preConfigure = ''
    # Since we can't expand $out in `makeFlags`
    #makeFlags="$makeFlags PAKCSINSTALLDIR=$out/pakcs"

    for file in currytools/cpm/src/CPM/Repository.curry \
                currytools/cpm/src/CPM/Repository/CacheDB.curry \
{'fraction_non_alphanumeric': 0.13183686373695858, 'fraction_numerical': 0.016440088523553588, 'mean_word_length': 3.2699055330634277, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '4431172', 'n_tokens_mistral': 1212, 'n_tokens_neox': 1164, 'n_words': 217}