From 93cc932ee66da799dabd036a5e957443ed6a8172 Mon Sep 17 00:00:00 2001 From: Sean Gilligan Date: Wed, 2 Jul 2025 17:06:14 -0700 Subject: [PATCH] zulu: Fix passthru.tests * Eliminate duplicate passthru definition by moving "tests.version" * Only compare major version (because the ".0.0" can be truncated * Special case major version 8 to "1.8" for the comparison --- pkgs/development/compilers/zulu/common.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pkgs/development/compilers/zulu/common.nix b/pkgs/development/compilers/zulu/common.nix index 60b090c1f2f9..361c90dfbd68 100644 --- a/pkgs/development/compilers/zulu/common.nix +++ b/pkgs/development/compilers/zulu/common.nix @@ -3,6 +3,7 @@ stdenv, fetchurl, setJavaClassPath, + testers, enableJavaFX ? false, dists, # minimum dependencies @@ -141,11 +142,6 @@ let fi ''; - passthru.tests.version = testers.testVersion { - package = jdk; - command = "java -version"; - version = ''openjdk version "${if lib.versions.major version == "23" then "23" else version}"''; - }; preFixup = '' # Propagate the setJavaClassPath setup hook from the ${if isJdk8 then "JRE" else "JDK"} so that @@ -188,6 +184,13 @@ let }) // { home = jdk; + tests.version = testers.testVersion { + package = jdk; + command = "java -version"; + version = ''openjdk version \""${ + if lib.versions.major version == "8" then "1.8" else lib.versions.major version + }"''; + }; } // lib.optionalAttrs stdenv.hostPlatform.isDarwin { bundle = "${jdk}/Library/Java/JavaVirtualMachines/zulu-${lib.versions.major version}.jdk";