diff --git a/pkgs/development/tools/build-managers/scala-cli/default.nix b/pkgs/development/tools/build-managers/scala-cli/default.nix index 1eb6b92cbd44..314acfe71ffd 100644 --- a/pkgs/development/tools/build-managers/scala-cli/default.nix +++ b/pkgs/development/tools/build-managers/scala-cli/default.nix @@ -1,5 +1,16 @@ -{ stdenv, coreutils, lib, installShellFiles, zlib, autoPatchelfHook, fetchurl, callPackage }: +{ stdenv +, coreutils +, lib +, installShellFiles +, zlib +, autoPatchelfHook +, fetchurl +, makeWrapper +, callPackage +, jre +}: +assert lib.versionAtLeast jre.version "17.0.0"; let pname = "scala-cli"; sources = builtins.fromJSON (builtins.readFile ./sources.json); @@ -9,7 +20,7 @@ let in stdenv.mkDerivation { inherit pname version; - nativeBuildInputs = [ installShellFiles ] + nativeBuildInputs = [ installShellFiles makeWrapper ] ++ lib.optional stdenv.isLinux autoPatchelfHook; buildInputs = [ coreutils zlib stdenv.cc.cc ]; src = @@ -28,7 +39,9 @@ stdenv.mkDerivation { installPhase = '' runHook preInstall - install -Dm755 scala-cli $out/bin/scala-cli + install -Dm755 scala-cli $out/bin/.scala-cli-wrapped + makeWrapper $out/bin/.scala-cli-wrapped $out/bin/scala-cli \ + --set JAVA_HOME ${jre.home} runHook postInstall ''; diff --git a/pkgs/development/tools/build-managers/scala-cli/sources.json b/pkgs/development/tools/build-managers/scala-cli/sources.json index 464675569fd7..5bf6e5f3e2fd 100644 --- a/pkgs/development/tools/build-managers/scala-cli/sources.json +++ b/pkgs/development/tools/build-managers/scala-cli/sources.json @@ -1,13 +1,13 @@ { - "version": "0.1.7", + "version": "0.1.8", "assets": { "x86_64-darwin": { "asset": "scala-cli-x86_64-apple-darwin.gz", - "sha256": "1sly3s9y742nms8kqwh2cikjkcnbkkafsql8sw2w2zr53z28g10v" + "sha256": "1dxhwhdk7kflzn4ckqxfxkz4v26l39ki6ykpml6k6kvy3nn0wwz3" }, "x86_64-linux": { "asset": "scala-cli-x86_64-pc-linux.gz", - "sha256": "1lgcbxzhwqfnj6n81w1ssdcrn1j0c93chqgh0zzqi08w8wk3x4j5" + "sha256": "0hj22lcmbbfgv69k778myb0kp79gbg7xx9a3b66g3svxmanlbvxf" } } }