<commit_before>{ stdenv, fetchurl, jre
, disableRemoteLogging ? true
}:

with stdenv.lib;

let
common = { scalaVersion, sha256 }:
stdenv.mkDerivation rec {
  pname = "ammonite";
  version = "1.7.4";

  src = fetchurl {
    url = "https://github.com/lihaoyi/Ammonite/releases/download/${version}/${scalaVersion}-${version}";
    inherit sha256;
  };

  phases = "installPhase";

  installPhase = ''
    install -Dm755 ${src} $out/bin/amm
    sed -i '0,/java/{s|java|${jre}/bin/java|}' $out/bin/amm
  '' + optionalString (disableRemoteLogging) ''
    sed -i '0,/ammonite.Main/{s|ammonite.Main|ammonite.Main --no-remote-logging|}' $out/bin/amm
    sed -i '1i #!/bin/sh' $out/bin/amm
  '';

  meta = {
    description = "Improved Scala REPL";
    longDescription = ''
        The Ammonite-REPL is an improved Scala REPL, re-implemented from first principles.
        It is much more featureful than the default REPL and comes
        with a lot of ergonomic improvements and configurability
        that may be familiar to people coming from IDEs or other REPLs such as IPython or Zsh.
    '';
    homepage = http://www.lihaoyi.com/Ammonite/;
    license = licenses.mit;
    platforms = platforms.all;
    maintainers = [ maintainers.nequissimus ];
  };
};
in {
  ammonite_2_12 = common { scalaVersion = "2.12"; sha256 = "0d2xjhxrly4cv5fpjv1i0a74ayij7c2x5sb6lsgzxpq7jj0bk1m6"; };
  ammonite_2_13 = common { scalaVersion = "2.13"; sha256 = "0hmdizzf8l8i07vdfik24iby39xg1vjfp1cwgjpbcmxv8klf50b0"; };
}
<commit_msg>ammonite: fix source reference to allow dynamic binding<commit_after>{ stdenv, fetchurl, jre
, disableRemoteLogging ? true
}:

with stdenv.lib;

let
common = { scalaVersion, sha256 }:
stdenv.mkDerivation rec {
  pname = "ammonite";
  version = "1.7.4";

  src = fetchurl {
    url = "https://github.com/lihaoyi/Ammonite/releases/download/${version}/${scalaVersion}-${version}";
    inherit sha256;
  };

  phases = "installPhase";

  installPhase = ''
    install -Dm755 $src $out/bin/amm
    sed -i '0,/java/{s|java|${jre}/bin/java|}' $out/bin/amm
  '' + optionalString (disableRemoteLogging) ''
    sed -i '0,/ammonite.Main/{s|ammonite.Main|ammonite.Main --no-remote-logging|}' $out/bin/amm
    sed -i '1i #!/bin/sh' $out/bin/amm
  '';

  meta = {
    description = "Improved Scala REPL";
    longDescription = ''
        The Ammonite-REPL is an improved Scala REPL, re-implemented from first principles.
        It is much more featureful than the default REPL and comes
        with a lot of ergonomic improvements and configurability
        that may be familiar to people coming from IDEs or other REPLs such as IPython or Zsh.
    '';
    homepage = http://www.lihaoyi.com/Ammonite/;
    license = licenses.mit;
    platforms = platforms.all;
    maintainers = [ maintainers.nequissimus ];
  };
};
in {
  ammonite_2_12 = common { scalaVersion = "2.12"; sha256 = "0d2xjhxrly4cv5fpjv1i0a74ayij7c2x5sb6lsgzxpq7jj0bk1m6"; };
  ammonite_2_13 = common { scalaVersion = "2.13"; sha256 = "0hmdizzf8l8i07vdfik24iby39xg1vjfp1cwgjpbcmxv8klf50b0"; };
}

{'fraction_non_alphanumeric': 0.131217277486911, 'fraction_numerical': 0.041884816753926704, 'mean_word_length': 3.4824046920821115, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3509826', 'n_tokens_mistral': 1214, 'n_tokens_neox': 1153, 'n_words': 249}