aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/development/tools/build-managers/sbt/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/development/tools/build-managers/sbt/default.nix')
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/tools/build-managers/sbt/default.nix46
1 files changed, 12 insertions, 34 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/development/tools/build-managers/sbt/default.nix b/infra/libkookie/nixpkgs/pkgs/development/tools/build-managers/sbt/default.nix
index 9e45c3e8b902..7ea10ac90abb 100644
--- a/infra/libkookie/nixpkgs/pkgs/development/tools/build-managers/sbt/default.nix
+++ b/infra/libkookie/nixpkgs/pkgs/development/tools/build-managers/sbt/default.nix
@@ -1,5 +1,10 @@
-{ lib, stdenv, fetchurl, jre, autoPatchelfHook, zlib, writeScript
-, common-updater-scripts, git, nixfmt, nix, coreutils, gnused, nixosTests }:
+{ lib
+, stdenv
+, fetchurl
+, jre
+, autoPatchelfHook
+, zlib
+}:
stdenv.mkDerivation rec {
pname = "sbt";
@@ -11,7 +16,7 @@ stdenv.mkDerivation rec {
sha256 = "sha256-wqdZ/kCjwhoWtaiNAM1m869vByHk6mG2OULfuDotVP0=";
};
- patchPhase = ''
+ postPatch = ''
echo -java-home ${jre.home} >>conf/sbtopts
'';
@@ -20,12 +25,16 @@ stdenv.mkDerivation rec {
buildInputs = lib.optionals stdenv.isLinux [ zlib ];
installPhase = ''
+ runHook preInstall
+
mkdir -p $out/share/sbt $out/bin
cp -ra . $out/share/sbt
ln -sT ../share/sbt/bin/sbt $out/bin/sbt
ln -sT ../share/sbt/bin/sbtn-x86_64-${
if (stdenv.isDarwin) then "apple-darwin" else "pc-linux"
} $out/bin/sbtn
+
+ runHook postInstall
'';
meta = with lib; {
@@ -35,35 +44,4 @@ stdenv.mkDerivation rec {
maintainers = with maintainers; [ nequissimus ];
platforms = platforms.unix;
};
-
- passthru = {
- tests = { inherit (nixosTests) sbt; };
-
- 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')"
-
- 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
- '';
- };
}