ammonite: Add test reference, update script
This commit is contained in:
parent
0aaf9d6143
commit
7e062659e9
3 changed files with 39 additions and 4 deletions
|
@ -24,6 +24,7 @@ in
|
|||
_3proxy = handleTest ./3proxy.nix {};
|
||||
acme = handleTest ./acme.nix {};
|
||||
agda = handleTest ./agda.nix {};
|
||||
ammonite = handleTest ./ammonite.nix {};
|
||||
atd = handleTest ./atd.nix {};
|
||||
avahi = handleTest ./avahi.nix {};
|
||||
avahi-with-resolved = handleTest ./avahi.nix { networkd = true; };
|
||||
|
|
|
@ -8,7 +8,7 @@ import ./make-test-python.nix ({ pkgs, ...} : {
|
|||
amm =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = [ pkgs.ammonite ];
|
||||
environment.systemPackages = [ (pkgs.ammonite.override { jre = pkgs.jre8; }) ];
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
{ stdenv, fetchurl, jre, disableRemoteLogging ? true }:
|
||||
{ stdenv, fetchurl, jre, nixosTests, writeScript, common-updater-scripts, git
|
||||
, nixfmt, nix, coreutils, gnused, disableRemoteLogging ? true }:
|
||||
|
||||
with stdenv.lib;
|
||||
|
||||
let
|
||||
repo = "git@github.com:lihaoyi/Ammonite.git";
|
||||
|
||||
common = { scalaVersion, sha256 }:
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "ammonite";
|
||||
|
@ -24,6 +27,37 @@ let
|
|||
sed -i '1i #!/bin/sh' $out/bin/amm
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
tests = { inherit (nixosTests) ammonite; };
|
||||
|
||||
updateScript = writeScript "update.sh" ''
|
||||
#!${stdenv.shell}
|
||||
set -o errexit
|
||||
PATH=${
|
||||
stdenv.lib.makeBinPath [
|
||||
common-updater-scripts
|
||||
coreutils
|
||||
git
|
||||
gnused
|
||||
nix
|
||||
nixfmt
|
||||
]
|
||||
}
|
||||
oldVersion="$(nix-instantiate --eval -E "with import ./. {}; lib.getVersion ${pname}" | tr -d '"')"
|
||||
latestTag="$(git -c 'versionsort.suffix=-' ls-remote --exit-code --refs --sort='version:refname' --tags ${repo} '*.*.*' | tail --lines=1 | cut --delimiter='/' --fields=3)"
|
||||
if [ ! "$oldVersion" = "$latestTag" ]; then
|
||||
nixpkgs="$(git rev-parse --show-toplevel)"
|
||||
default_nix="$nixpkgs/pkgs/development/tools/ammonite/default.nix"
|
||||
update-source-version ${pname}_2_12 "$latestTag" --version-key=version --print-changes
|
||||
sed -i "s|$latestTag|$oldVersion|g" "$default_nix"
|
||||
update-source-version ${pname}_2_13 "$latestTag" --version-key=version --print-changes
|
||||
nixfmt "$default_nix"
|
||||
else
|
||||
echo "${pname} is already up-to-date"
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "Improved Scala REPL";
|
||||
longDescription = ''
|
||||
|
@ -41,10 +75,10 @@ let
|
|||
in {
|
||||
ammonite_2_12 = common {
|
||||
scalaVersion = "2.12";
|
||||
sha256 = "0nclfqwy3jfn1680z1hd0zzmc0b79wpvx6gn1jnm19aq7qcvh5zp";
|
||||
sha256 = "9xe4GT5YpVCtDPaZvi9PZwFW/wcNhg+QCdbJ4Tl2lFk=";
|
||||
};
|
||||
ammonite_2_13 = common {
|
||||
scalaVersion = "2.13";
|
||||
sha256 = "104bnahn382sb6vwjvchsg0jrnkkwjn08rfh0g5ra7lwhgcj2719";
|
||||
sha256 = "KRwh2YOcHpXLA9BlBKzkc9oswdOQbcm3WVqgYaGyi4A=";
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue