From da40dbd19583179f78f894e003851971d83b906d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Koz=C5=82owski?= Date: Wed, 28 Dec 2022 20:35:01 +0100 Subject: [PATCH] scala-cli: move assert to build time --- .../development/tools/build-managers/scala-cli/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/build-managers/scala-cli/default.nix b/pkgs/development/tools/build-managers/scala-cli/default.nix index 307efdd9458a..9381922a5fb5 100644 --- a/pkgs/development/tools/build-managers/scala-cli/default.nix +++ b/pkgs/development/tools/build-managers/scala-cli/default.nix @@ -10,7 +10,6 @@ , jre }: -assert lib.versionAtLeast jre.version "17.0.0"; let pname = "scala-cli"; sources = builtins.fromJSON (builtins.readFile ./sources.json); @@ -22,7 +21,11 @@ stdenv.mkDerivation { inherit pname version; nativeBuildInputs = [ installShellFiles makeWrapper ] ++ lib.optional stdenv.isLinux autoPatchelfHook; - buildInputs = [ coreutils zlib stdenv.cc.cc ]; + buildInputs = + assert lib.assertMsg (lib.versionAtLeast jre.version "17.0.0") '' + scala-cli requires Java 17 or newer, but ${jre.name} is ${jre.version} + ''; + [ coreutils zlib stdenv.cc.cc ]; src = let asset = assets."${stdenv.hostPlatform.system}" or (throw "Unsupported platform ${stdenv.hostPlatform.system}");