Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f4902a941c63
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ac9ba67ec5b5
Choose a head ref
  • 4 commits
  • 3 files changed
  • 2 contributors

Commits on Nov 3, 2020

  1. sbt: Add update script

    NeQuissimus committed Nov 3, 2020

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    d92254f View commit details
  2. sbt: 1.4.0 → 1.4.2

    NeQuissimus committed Nov 3, 2020

    Verified

    This commit was signed with the committer’s verified signature.
    vcunat Vladimír Čunát
    Copy the full SHA
    8d279bb View commit details

Commits on Nov 4, 2020

  1. sbt: Add test

    NeQuissimus committed Nov 4, 2020
    Copy the full SHA
    23be792 View commit details
  2. Merge pull request #102642 from NeQuissimus/sbt_1_4_2

    SBT: Add test, update script, 1.4.0 -> 1.4.2
    NeQuissimus authored Nov 4, 2020
    Copy the full SHA
    ac9ba67 View commit details
Showing with 54 additions and 3 deletions.
  1. +1 −0 nixos/tests/all-tests.nix
  2. +18 −0 nixos/tests/sbt.nix
  3. +35 −3 pkgs/development/tools/build-managers/sbt/default.nix
1 change: 1 addition & 0 deletions nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
@@ -311,6 +311,7 @@ in
rxe = handleTest ./rxe.nix {};
samba = handleTest ./samba.nix {};
sanoid = handleTest ./sanoid.nix {};
sbt = handleTest ./sbt.nix {};
sddm = handleTest ./sddm.nix {};
service-runner = handleTest ./service-runner.nix {};
shadowsocks = handleTest ./shadowsocks {};
18 changes: 18 additions & 0 deletions nixos/tests/sbt.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import ./make-test-python.nix ({ pkgs, ...} : {
name = "sbt";
meta = with pkgs.stdenv.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)'"
)
'';
})
38 changes: 35 additions & 3 deletions pkgs/development/tools/build-managers/sbt/default.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{ stdenv, fetchurl, jre, autoPatchelfHook, zlib }:
{ stdenv, fetchurl, jre, autoPatchelfHook, zlib, writeScript
, common-updater-scripts, git, nixfmt, nix, coreutils, gnused, nixosTests }:

stdenv.mkDerivation rec {
pname = "sbt";
version = "1.4.0";
version = "1.4.2";

src = fetchurl {
url =
"https://github.com/sbt/sbt/releases/download/v${version}/sbt-${version}.tgz";
sha256 = "1mgfs732w1c1p7dna7h47x8h073lvjs224fqlpkkvq10153mnxxl";
sha256 = "1dw4l91sw4ybqxjid1hsb6r33ka5bl85rfdrbsr9m5vxl82a3mmc";
};

patchPhase = ''
@@ -34,4 +35,35 @@ 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=${
stdenv.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
'';
};
}