core/pkgs/by-name/ja/java/openjdk/jre.nix

37 lines
827 B
Nix
Raw Normal View History

2024-05-13 21:24:10 +00:00
{ stdenv, jdk, lib, callPackage, modules ? [ "java.base" ] }:
2024-05-02 00:46:19 +00:00
let
jre = stdenv.mkDerivation {
pname = "${jdk.pname}-minimal-jre";
version = jdk.version;
buildInputs = [ jdk ];
dontUnpack = true;
# Strip more heavily than the default '-S', since if you're
# using this derivation you probably care about this.
stripDebugFlags = [ "--strip-unneeded" ];
buildPhase = ''
runHook preBuild
2024-05-13 21:24:10 +00:00
jlink --module-path ${jdk}/lib/openjdk/jmods --add-modules ${
lib.concatStringsSep "," modules
} --output $out
2024-05-02 00:46:19 +00:00
runHook postBuild
'';
dontInstall = true;
passthru = {
home = "${jre}";
tests = [
2024-05-13 21:24:10 +00:00
(callPackage ./tests/test_jre_minimal.nix { })
(callPackage ./tests/test_jre_minimal_with_logging.nix { })
2024-05-02 00:46:19 +00:00
];
};
};
in jre