diff options
author | volth <volth@volth.com> | 2020-07-20 04:55:05 +0000 |
---|---|---|
committer | volth <volth@volth.com> | 2020-07-20 04:55:18 +0000 |
commit | 1de96eba5a3ec4e54a07b232fcf0b993ec8fce9a (patch) | |
tree | 3f2fc1a9c52418de025e88a93f453db64bed3d7a | |
parent | b3fcaa5440170a1d060ee2ec5a03c1309217ce9f (diff) |
oraclejdk11: init at 11.0.8, oraclejdk14: init at 14.0.2
-rw-r--r-- | pkgs/development/compilers/oraclejdk/jdk11-linux.nix | 54 | ||||
-rw-r--r-- | pkgs/development/compilers/oraclejdk/jdk14-linux.nix | 54 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 4 |
3 files changed, 112 insertions, 0 deletions
diff --git a/pkgs/development/compilers/oraclejdk/jdk11-linux.nix b/pkgs/development/compilers/oraclejdk/jdk11-linux.nix new file mode 100644 index 0000000000000..b73270e8dd8c0 --- /dev/null +++ b/pkgs/development/compilers/oraclejdk/jdk11-linux.nix @@ -0,0 +1,54 @@ +{ stdenv +, requireFile +, xorg +, zlib +, freetype +, alsaLib +, setJavaClassPath +}: + +let result = stdenv.mkDerivation rec { + pname = "oraclejdk"; + version = "11.0.8"; + + src = requireFile { + name = "jdk-${version}_linux-x64_bin.tar.gz"; + url = "https://www.oracle.com/java/technologies/javase-jdk11-downloads.html"; + sha256 = "6390878c91e29bad7b2483eb0b470620bd145269600f3b6a9d65724e6f83b6fd"; + }; + + installPhase = '' + mv ../$sourceRoot $out + + mkdir -p $out/nix-support + printWords ${setJavaClassPath} > $out/nix-support/propagated-build-inputs + + # Set JAVA_HOME automatically. + cat <<EOF >> $out/nix-support/setup-hook + if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi + EOF + ''; + + postFixup = '' + rpath="$out/lib/jli:$out/lib/server:$out/lib:${stdenv.lib.strings.makeLibraryPath [ zlib xorg.libX11 xorg.libXext xorg.libXtst xorg.libXi xorg.libXrender freetype alsaLib]}" + + for f in $(find $out -name "*.so") $(find $out -type f -perm -0100); do + patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$f" || true + patchelf --set-rpath "$rpath" "$f" || true + done + + for f in $(find $out -name "*.so") $(find $out -type f -perm -0100); do + if ldd "$f" | fgrep 'not found'; then echo "in file $f"; fi + done + ''; + + passthru.jre = result; + passthru.home = result; + + dontStrip = true; # See: https://github.com/NixOS/patchelf/issues/10 + + meta = with stdenv.lib; { + license = licenses.unfree; + platforms = [ "x86_64-linux" ]; + }; +}; in result diff --git a/pkgs/development/compilers/oraclejdk/jdk14-linux.nix b/pkgs/development/compilers/oraclejdk/jdk14-linux.nix new file mode 100644 index 0000000000000..427c7cedad151 --- /dev/null +++ b/pkgs/development/compilers/oraclejdk/jdk14-linux.nix @@ -0,0 +1,54 @@ +{ stdenv +, requireFile +, xorg +, zlib +, freetype +, alsaLib +, setJavaClassPath +}: + +let result = stdenv.mkDerivation rec { + pname = "oraclejdk"; + version = "14.0.2"; + + src = requireFile { + name = "jdk-${version}_linux-x64_bin.tar.gz"; + url = "https://www.oracle.com/java/technologies/javase-jdk14-downloads.html"; + sha256 = "cb811a86926cc0f529d16bec7bd2e25fb73e75125bbd1775cdb9a96998593dde"; + }; + + installPhase = '' + mv ../$sourceRoot $out + + mkdir -p $out/nix-support + printWords ${setJavaClassPath} > $out/nix-support/propagated-build-inputs + + # Set JAVA_HOME automatically. + cat <<EOF >> $out/nix-support/setup-hook + if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi + EOF + ''; + + postFixup = '' + rpath="$out/lib/jli:$out/lib/server:$out/lib:${stdenv.lib.strings.makeLibraryPath [ stdenv.cc.cc zlib xorg.libX11 xorg.libXext xorg.libXtst xorg.libXi xorg.libXrender freetype alsaLib]}" + + for f in $(find $out -name "*.so") $(find $out -type f -perm -0100); do + patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$f" || true + patchelf --set-rpath "$rpath" "$f" || true + done + + for f in $(find $out -name "*.so") $(find $out -type f -perm -0100); do + if ldd "$f" | fgrep 'not found'; then echo "in file $f"; fi + done + ''; + + passthru.jre = result; + passthru.home = result; + + dontStrip = true; # See: https://github.com/NixOS/patchelf/issues/10 + + meta = with stdenv.lib; { + license = licenses.unfree; + platforms = [ "x86_64-linux" ]; + }; +}; in result diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0d964b5baeb31..4f8e325c2c5aa 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8967,6 +8967,10 @@ in inherit installjdk pluginSupport; }); + oraclejdk11 = callPackage ../development/compilers/oraclejdk/jdk11-linux.nix { }; + + oraclejdk14 = callPackage ../development/compilers/oraclejdk/jdk14-linux.nix { }; + jasmin = callPackage ../development/compilers/jasmin { }; java-service-wrapper = callPackage ../tools/system/java-service-wrapper { }; |