rundeck-cli: replace `jdk` with `jre11_minimal_headless` (#422077)

authored by Pol Dellaiera and committed by GitHub e3cf06d6 79e56adb

+45 -32
+11 -7
pkgs/by-name/ru/rundeck-cli/package.nix
··· 2 2 lib, 3 3 stdenv, 4 4 fetchurl, 5 - makeWrapper, 6 - jdk11, 7 - unzip, 5 + makeBinaryWrapper, 6 + jre11_minimal, 7 + jdk11_headless, 8 8 versionCheckHook, 9 9 nix-update-script, 10 10 }: 11 - 11 + let 12 + jre11_minimal_headless = jre11_minimal.override { 13 + jdk = jdk11_headless; 14 + }; 15 + in 12 16 stdenv.mkDerivation (finalAttrs: { 13 17 pname = "rundeck-cli"; 14 18 version = "2.0.9"; ··· 18 22 hash = "sha256-c6QAgwyRCtoOlS7DEmjyK3BwHV122bilL6H+Hzrv2dQ="; 19 23 }; 20 24 21 - nativeBuildInputs = [ makeWrapper ]; 22 - buildInputs = [ jdk11 ]; 25 + nativeBuildInputs = [ makeBinaryWrapper ]; 26 + buildInputs = [ jre11_minimal_headless ]; 23 27 24 28 dontUnpack = true; 25 29 ··· 30 34 cp $src $out/share/rundeck-cli/rundeck-cli.jar 31 35 32 36 mkdir -p $out/bin 33 - makeWrapper ${lib.getExe jdk11} $out/bin/rd \ 37 + makeWrapper ${lib.getExe jre11_minimal_headless} $out/bin/rd \ 34 38 --add-flags "-jar $out/share/rundeck-cli/rundeck-cli.jar" 35 39 36 40 runHook postInstall
+30 -25
pkgs/development/compilers/openjdk/jre.nix
··· 7 7 modules ? [ "java.base" ], 8 8 }: 9 9 10 - let 11 - jre = stdenv.mkDerivation { 12 - pname = "${jdk.pname}-minimal-jre"; 13 - version = jdk.version; 10 + stdenv.mkDerivation (finalAttrs: { 11 + pname = "${jdk.pname}-minimal-jre"; 12 + version = jdk.version; 14 13 15 - nativeBuildInputs = [ jdkOnBuild ]; 16 - buildInputs = [ jdk ]; 17 - strictDeps = true; 14 + nativeBuildInputs = [ jdkOnBuild ]; 15 + buildInputs = [ jdk ]; 16 + strictDeps = true; 18 17 19 - dontUnpack = true; 18 + dontUnpack = true; 20 19 21 - # Strip more heavily than the default '-S', since if you're 22 - # using this derivation you probably care about this. 23 - stripDebugFlags = [ "--strip-unneeded" ]; 20 + # Strip more heavily than the default '-S', since if you're 21 + # using this derivation you probably care about this. 22 + stripDebugFlags = [ "--strip-unneeded" ]; 24 23 25 - buildPhase = '' 26 - runHook preBuild 24 + buildPhase = '' 25 + runHook preBuild 27 26 28 - jlink --module-path ${jdk}/lib/openjdk/jmods --add-modules ${lib.concatStringsSep "," modules} --output $out 27 + jlink --module-path ${jdk}/lib/openjdk/jmods --add-modules ${lib.concatStringsSep "," modules} --output $out 29 28 30 - runHook postBuild 31 - ''; 29 + runHook postBuild 30 + ''; 32 31 33 - dontInstall = true; 32 + dontInstall = true; 34 33 35 - passthru = { 36 - home = "${jre}"; 37 - tests = { 38 - jre_minimal-hello = callPackage ./tests/test_jre_minimal.nix { }; 39 - jre_minimal-hello-logging = callPackage ./tests/test_jre_minimal_with_logging.nix { }; 40 - }; 34 + passthru = { 35 + home = "${finalAttrs.finalPackage}"; 36 + tests = { 37 + jre_minimal-hello = callPackage ./tests/test_jre_minimal.nix { }; 38 + jre_minimal-hello-logging = callPackage ./tests/test_jre_minimal_with_logging.nix { }; 41 39 }; 42 40 }; 43 - in 44 - jre 41 + 42 + meta = jdk.meta // { 43 + description = "Minimal JRE for OpenJDK ${jdk.version}"; 44 + longDescription = '' 45 + This is a minimal JRE built from OpenJDK, containing only the specified modules. 46 + It is suitable for running Java applications that do not require the full JDK. 47 + ''; 48 + }; 49 + })
+4
pkgs/top-level/all-packages.nix
··· 5668 5668 jre = jdk; 5669 5669 jre_headless = jdk_headless; 5670 5670 5671 + jre11_minimal = callPackage ../development/compilers/openjdk/jre.nix { 5672 + jdk = jdk11; 5673 + jdkOnBuild = buildPackages.jdk11; 5674 + }; 5671 5675 jre17_minimal = callPackage ../development/compilers/openjdk/jre.nix { 5672 5676 jdk = jdk17; 5673 5677 jdkOnBuild = buildPackages.jdk17;