sbt: Replace VM test with installCheckPhase
This commit is contained in:
parent
2962d51b90
commit
af2e9e5046
@ -343,7 +343,6 @@ in
|
||||
samba = handleTest ./samba.nix {};
|
||||
samba-wsdd = handleTest ./samba-wsdd.nix {};
|
||||
sanoid = handleTest ./sanoid.nix {};
|
||||
sbt = handleTest ./sbt.nix {};
|
||||
sddm = handleTest ./sddm.nix {};
|
||||
searx = handleTest ./searx.nix {};
|
||||
service-runner = handleTest ./service-runner.nix {};
|
||||
|
@ -1,18 +0,0 @@
|
||||
import ./make-test-python.nix ({ pkgs, ...} : {
|
||||
name = "sbt";
|
||||
meta = with pkgs.lib.maintainers; {
|
||||
maintainers = [ nequissimus ];
|
||||
};
|
||||
|
||||
machine = { pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = [ pkgs.sbt ];
|
||||
};
|
||||
|
||||
testScript =
|
||||
''
|
||||
machine.succeed(
|
||||
"(sbt --offline --version 2>&1 || true) | grep 'getting org.scala-sbt sbt ${pkgs.sbt.version} (this may take some time)'"
|
||||
)
|
||||
'';
|
||||
})
|
@ -1,5 +1,18 @@
|
||||
{ lib, stdenv, fetchurl, jre, autoPatchelfHook, zlib, writeScript
|
||||
, common-updater-scripts, git, nixfmt, nix, coreutils, gnused, nixosTests }:
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchurl
|
||||
, jre
|
||||
, autoPatchelfHook
|
||||
, zlib
|
||||
, writeScript
|
||||
, common-updater-scripts
|
||||
, git
|
||||
, nixfmt
|
||||
, nix
|
||||
, coreutils
|
||||
, gnused
|
||||
, nixosTests
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "sbt";
|
||||
@ -28,6 +41,11 @@ stdenv.mkDerivation rec {
|
||||
} $out/bin/sbtn
|
||||
'';
|
||||
|
||||
doInstallCheck = true;
|
||||
installCheckPhase = ''
|
||||
($out/bin/sbt --offline --version 2>&1 || true) | grep 'getting org.scala-sbt sbt ${version} (this may take some time)'
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://www.scala-sbt.org/";
|
||||
license = licenses.bsd3;
|
||||
@ -36,34 +54,30 @@ stdenv.mkDerivation rec {
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
|
||||
passthru = {
|
||||
tests = { inherit (nixosTests) sbt; };
|
||||
passthru.updateScript = writeScript "update.sh" ''
|
||||
#!${stdenv.shell}
|
||||
set -o errexit
|
||||
PATH=${
|
||||
lib.makeBinPath [
|
||||
common-updater-scripts
|
||||
git
|
||||
nixfmt
|
||||
nix
|
||||
coreutils
|
||||
gnused
|
||||
]
|
||||
}
|
||||
|
||||
updateScript = writeScript "update.sh" ''
|
||||
#!${stdenv.shell}
|
||||
set -o errexit
|
||||
PATH=${
|
||||
lib.makeBinPath [
|
||||
common-updater-scripts
|
||||
git
|
||||
nixfmt
|
||||
nix
|
||||
coreutils
|
||||
gnused
|
||||
]
|
||||
}
|
||||
oldVersion="$(nix-instantiate --eval -E "with import ./. {}; lib.getVersion sbt" | tr -d '"')"
|
||||
latestTag="$(git -c 'versionsort.suffix=-' ls-remote --exit-code --refs --sort='version:refname' --tags git@github.com:sbt/sbt.git '*.*.*' | tail --lines=1 | cut --delimiter='/' --fields=3 | sed 's|^v||g')"
|
||||
|
||||
oldVersion="$(nix-instantiate --eval -E "with import ./. {}; lib.getVersion sbt" | tr -d '"')"
|
||||
latestTag="$(git -c 'versionsort.suffix=-' ls-remote --exit-code --refs --sort='version:refname' --tags git@github.com:sbt/sbt.git '*.*.*' | tail --lines=1 | cut --delimiter='/' --fields=3 | sed 's|^v||g')"
|
||||
|
||||
if [ ! "$oldVersion" = "$latestTag" ]; then
|
||||
update-source-version sbt "$latestTag" --version-key=version --print-changes
|
||||
nixpkgs="$(git rev-parse --show-toplevel)"
|
||||
default_nix="$nixpkgs/pkgs/development/tools/build-managers/sbt/default.nix"
|
||||
nixfmt "$default_nix"
|
||||
else
|
||||
echo "sbt is already up-to-date"
|
||||
fi
|
||||
'';
|
||||
};
|
||||
if [ ! "$oldVersion" = "$latestTag" ]; then
|
||||
update-source-version sbt "$latestTag" --version-key=version --print-changes
|
||||
nixpkgs="$(git rev-parse --show-toplevel)"
|
||||
default_nix="$nixpkgs/pkgs/development/tools/build-managers/sbt/default.nix"
|
||||
nixfmt "$default_nix"
|
||||
else
|
||||
echo "sbt is already up-to-date"
|
||||
fi
|
||||
'';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user