git.iko.soy/typeable/nixpkgs
on master help sign in
sbt-extras: Convert VM test into installCheckPhase
commitcb72a93d2e4d84c19599679a29794f9867443ef4 authorTim Steinbach <tim@nequissimus.com> dateSun 21 Feb 2021, 18:34 (6 years ago) parenta59e171
3 files changed+50−54
nixos/tests/all-tests.nix−1 nixos/tests/sbt-extras.nix−16 pkgs/development/tools/build-managers/sbt-extras/default.nix+50−37
nixos/tests/all-tests.nix−1
@@ -345,7 +345,6 @@ in
345345 samba-wsdd = handleTest ./samba-wsdd.nix {};
346346 sanoid = handleTest ./sanoid.nix {};
347347 sbt = handleTest ./sbt.nix {};
348− sbt-extras = handleTest ./sbt-extras.nix {};
349348 sddm = handleTest ./sddm.nix {};
350349 searx = handleTest ./searx.nix {};
351350 service-runner = handleTest ./service-runner.nix {};
nixos/tests/sbt-extras.nixdeleted−16
@@ -1,16 +0,0 @@
1−import ./make-test-python.nix ({ pkgs, ...} : {
2− name = "sbt-extras";
3− meta = with pkgs.lib.maintainers; {
4− maintainers = [ nequissimus ];
5− };
6−
7− machine = { pkgs, ... }:
8− {
9− environment.systemPackages = [ pkgs.sbt-extras ];
10− };
11−
12− testScript =
13− ''
14− machine.succeed("(sbt -h)")
15− '';
16−})
pkgs/development/tools/build-managers/sbt-extras/default.nix+50−37
@@ -1,6 +1,20 @@
1−{ lib, stdenv, fetchFromGitHub, which, curl, makeWrapper, jdk, writeScript
2−, common-updater-scripts, cacert, git, nixfmt, nix, jq, coreutils, gnused
3−, nixosTests }:
1+{ lib
2+, stdenv
3+, fetchFromGitHub
4+, which
5+, curl
6+, makeWrapper
7+, jdk
8+, writeScript
9+, common-updater-scripts
10+, cacert
11+, git
12+, nixfmt
13+, nix
14+, jq
15+, coreutils
16+, gnused
17+}:
418
519stdenv.mkDerivation rec {
620 pname = "sbt-extras";
@@ -28,41 +42,40 @@ stdenv.mkDerivation rec {
2842 wrapProgram $out/bin/sbt --prefix PATH : ${lib.makeBinPath [ which curl ]}
2943 '';
3044
31− passthru = {
32− tests = { inherit (nixosTests) sbt-extras; };
33−
34− updateScript = writeScript "update.sh" ''
35− #!${stdenv.shell}
36− set -xo errexit
37− PATH=${
38− lib.makeBinPath [
39− common-updater-scripts
40− curl
41− cacert
42− git
43− nixfmt
44− nix
45− jq
46− coreutils
47− gnused
48− ]
49− }
50−
51− oldVersion="$(nix-instantiate --eval -E "with import ./. {}; lib.getVersion ${pname}" | tr -d '"')"
52− latestSha="$(curl -L -s https://api.github.com/repos/paulp/sbt-extras/commits\?sha\=master\&since\=$oldVersion | jq -r '.[0].sha')"
45+ doInstallCheck = true;
46+ installCheckPhase = ''
47+ $out/bin/sbt -h >/dev/null
48+ '';
5349
54− if [ ! "null" = "$latestSha" ]; then
55− nixpkgs="$(git rev-parse --show-toplevel)"
56− default_nix="$nixpkgs/pkgs/development/tools/build-managers/sbt-extras/default.nix"
57− latestDate="$(curl -L -s https://api.github.com/repos/paulp/sbt-extras/commits/$latestSha | jq '.commit.committer.date' | sed 's|"\(.*\)T.*|\1|g')"
58− update-source-version ${pname} "$latestSha" --version-key=rev
59− update-source-version ${pname} "$latestDate" --ignore-same-hash
60− nixfmt "$default_nix"
61− else
62− echo "${pname} is already up-to-date"
63− fi
64− '';
65− };
50+ passthru.updateScript = writeScript "update.sh" ''
51+ #!${stdenv.shell}
52+ set -xo errexit
53+ PATH=${
54+ lib.makeBinPath [
55+ common-updater-scripts
56+ curl
57+ cacert
58+ git
59+ nixfmt
60+ nix
61+ jq
62+ coreutils
63+ gnused
64+ ]
65+ }
66+ oldVersion="$(nix-instantiate --eval -E "with import ./. {}; lib.getVersion ${pname}" | tr -d '"')"
67+ latestSha="$(curl -L -s https://api.github.com/repos/paulp/sbt-extras/commits\?sha\=master\&since\=$oldVersion | jq -r '.[0].sha')"
68+ if [ ! "null" = "$latestSha" ]; then
69+ nixpkgs="$(git rev-parse --show-toplevel)"
70+ default_nix="$nixpkgs/pkgs/development/tools/build-managers/sbt-extras/default.nix"
71+ latestDate="$(curl -L -s https://api.github.com/repos/paulp/sbt-extras/commits/$latestSha | jq '.commit.committer.date' | sed 's|"\(.*\)T.*|\1|g')"
72+ update-source-version ${pname} "$latestSha" --version-key=rev
73+ update-source-version ${pname} "$latestDate" --ignore-same-hash
74+ nixfmt "$default_nix"
75+ else
76+ echo "${pname} is already up-to-date"
77+ fi
78+ '';
6679
6780 meta = {
6881 description =