lol

oraclejdk: Export the same setup hooks as openjdk

+14 -2
+14 -2
pkgs/development/compilers/jdk/jdk-linux-base.nix
··· 30 30 , alsaLib 31 31 , atk 32 32 , gdk_pixbuf 33 + , setJavaClassPath 33 34 }: 34 35 35 36 assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux"; ··· 59 60 ""; 60 61 in 61 62 62 - stdenv.mkDerivation rec { 63 + let result = stdenv.mkDerivation rec { 63 64 name = 64 65 if installjdk then "oraclejdk-${productVersion}u${patchVersion}" else "oraclejre-${productVersion}u${patchVersion}"; 65 66 ··· 156 157 157 158 mkdir $jrePath/lib/${architecture}/plugins 158 159 ln -s $jrePath/lib/${architecture}/libnpjp2.so $jrePath/lib/${architecture}/plugins 160 + 161 + mkdir -p $out/nix-support 162 + echo -n "${setJavaClassPath}" > $out/nix-support/propagated-native-build-inputs 163 + 164 + # Set JAVA_HOME automatically. 165 + cat <<EOF >> $out/nix-support/setup-hook 166 + if [ -z "\$JAVA_HOME" ]; then export JAVA_HOME=$out; fi 167 + EOF 159 168 ''; 160 169 161 170 inherit installjdk pluginSupport; ··· 169 178 170 179 passthru.mozillaPlugin = if installjdk then "/jre/lib/${architecture}/plugins" else "/lib/${architecture}/plugins"; 171 180 181 + passthru.jre = result; # FIXME: use multiple outputs or return actual JRE package 182 + 172 183 meta.license = "unfree"; 173 - } 184 + 185 + }; in result