ammonite: add scala-2.13 version
This commit is contained in:
parent
b952f5dd1e
commit
1673f3d458
2 changed files with 19 additions and 15 deletions
|
@ -1,30 +1,27 @@
|
|||
{ stdenv, lib, fetchurl, makeWrapper, jre, gnused
|
||||
{ stdenv, fetchurl, jre
|
||||
, disableRemoteLogging ? true
|
||||
}:
|
||||
|
||||
with stdenv.lib;
|
||||
|
||||
let
|
||||
common = { scalaVersion, sha256 }:
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "ammonite";
|
||||
version = "1.7.1";
|
||||
scalaVersion = "2.12";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/lihaoyi/Ammonite/releases/download/${version}/${scalaVersion}-${version}";
|
||||
sha256 = "0isg9flnzc2ldbx6q0lg0xyg9lnvqkd8qhgfln8p1hbzdq0n6jd0";
|
||||
inherit sha256;
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ jre ] ;
|
||||
buildInputs = [ makeWrapper gnused ] ;
|
||||
|
||||
phases = "installPhase";
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp ${src} $out/bin/amm
|
||||
chmod +x $out/bin/amm
|
||||
${gnused}/bin/sed -i '0,/java/{s|java|${jre}/bin/java|}' $out/bin/amm
|
||||
install -Dm755 ${src} $out/bin/amm
|
||||
sed -i '0,/java/{s|java|${jre}/bin/java|}' $out/bin/amm
|
||||
'' + optionalString (disableRemoteLogging) ''
|
||||
${gnused}/bin/sed -i '0,/ammonite.Main/{s|ammonite.Main|ammonite.Main --no-remote-logging|}' $out/bin/amm
|
||||
sed -i '0,/ammonite.Main/{s|ammonite.Main|ammonite.Main --no-remote-logging|}' $out/bin/amm
|
||||
'';
|
||||
|
||||
meta = {
|
||||
|
@ -36,8 +33,12 @@ stdenv.mkDerivation rec {
|
|||
that may be familiar to people coming from IDEs or other REPLs such as IPython or Zsh.
|
||||
'';
|
||||
homepage = http://www.lihaoyi.com/Ammonite/;
|
||||
license = lib.licenses.mit;
|
||||
platforms = lib.platforms.all;
|
||||
maintainers = [ lib.maintainers.nequissimus ];
|
||||
license = licenses.mit;
|
||||
platforms = platforms.all;
|
||||
maintainers = [ maintainers.nequissimus ];
|
||||
};
|
||||
};
|
||||
in {
|
||||
ammonite_2_12 = common { scalaVersion = "2.12"; sha256 = "0isg9flnzc2ldbx6q0lg0xyg9lnvqkd8qhgfln8p1hbzdq0n6jd0"; };
|
||||
ammonite_2_13 = common { scalaVersion = "2.13"; sha256 = "01dyc6bilhcr1mwrpmhjc8nhzfqgjh44bx36gd3gk9mkvlbys5mp"; };
|
||||
}
|
||||
|
|
|
@ -576,7 +576,10 @@ in
|
|||
inherit (darwin.apple_sdk.frameworks) Security;
|
||||
};
|
||||
|
||||
ammonite = callPackage ../development/tools/ammonite {};
|
||||
inherit (callPackages ../development/tools/ammonite {})
|
||||
ammonite_2_12
|
||||
ammonite_2_13;
|
||||
ammonite = if scala == scala_2_12 then ammonite_2_12 else ammonite_2_13;
|
||||
|
||||
amp = callPackage ../applications/editors/amp {};
|
||||
|
||||
|
|
Loading…
Reference in a new issue