summaryrefslogtreecommitdiff
path: root/pkgs/development/compilers/temurin-bin/jdk-darwin-base.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/compilers/temurin-bin/jdk-darwin-base.nix')
-rw-r--r--pkgs/development/compilers/temurin-bin/jdk-darwin-base.nix20
1 files changed, 12 insertions, 8 deletions
diff --git a/pkgs/development/compilers/temurin-bin/jdk-darwin-base.nix b/pkgs/development/compilers/temurin-bin/jdk-darwin-base.nix
index c4234ab3fda9..58803637f81c 100644
--- a/pkgs/development/compilers/temurin-bin/jdk-darwin-base.nix
+++ b/pkgs/development/compilers/temurin-bin/jdk-darwin-base.nix
@@ -19,7 +19,7 @@ let
providedCpuTypes = builtins.filter (arch: builtins.elem arch validCpuTypes) (
builtins.attrNames sourcePerArch
);
- result = stdenv.mkDerivation {
+ result = stdenv.mkDerivation (finalAttrs: {
pname =
if sourcePerArch.packageType == "jdk" then
"${name-prefix}-bin"
@@ -40,16 +40,19 @@ let
installPhase = ''
cd ..
- mv $sourceRoot $out
+ mkdir -p $out/Library/Java/JavaVirtualMachines
+
+ bundle=$out/Library/Java/JavaVirtualMachines/${name-prefix}-${lib.versions.major finalAttrs.version}.jdk
+ mv $sourceRoot $bundle
# jni.h expects jni_md.h to be in the header search path.
- ln -s $out/Contents/Home/include/darwin/*_md.h $out/Contents/Home/include/
+ ln -s $bundle/Contents/Home/include/darwin/*_md.h $bundle/Contents/Home/include/
# Remove some broken manpages.
# Only for 11 and earlier.
- [ -e "$out/Contents/Home/man/ja" ] && rm -r $out/Contents/Home/man/ja
+ [ -e "$bundle/Contents/Home/man/ja" ] && rm -r $bundle/Contents/Home/man/ja
- ln -s $out/Contents/Home/* $out/
+ ln -s $bundle/Contents/Home/* $out/
# Propagate the setJavaClassPath setup hook from the JDK so that
# any package that depends on the JDK has $CLASSPATH set up
@@ -65,8 +68,9 @@ let
# FIXME: use multiple outputs or return actual JRE package
passthru = {
- jre = result;
- home = result;
+ jre = finalAttrs.finalPackage;
+ home = finalAttrs.finalPackage;
+ bundle = "${finalAttrs.finalPackage}/Library/Java/JavaVirtualMachines/${name-prefix}-${lib.versions.major finalAttrs.version}.jdk";
};
meta = with lib; {
@@ -81,6 +85,6 @@ let
inherit knownVulnerabilities;
mainProgram = "java";
};
- };
+ });
in
result