@@ -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 =