lol

openjdk: boostrap with adoptopenjdk-bin and cleanup

This allows OpenJDK 11 to build for armv6l, armv7l and aarch64, and OpenJDK 8 to
build for aarch64.

+187 -208
+47 -67
pkgs/development/compilers/openjdk/11.nix
··· 1 - { stdenv, lib, fetchurl, bash, cpio, autoconf, pkgconfig, file, which, unzip, zip, cups, freetype 2 - , alsaLib, bootjdk, perl, fontconfig, zlib, lndir 3 - , libX11, libICE, libXrender, libXext, libXt, libXtst, libXi, libXinerama, libXcursor, libXrandr 4 - , libjpeg, giflib 1 + { stdenv, lib, fetchurl, bash, pkgconfig, autoconf, cpio, file, which, unzip 2 + , zip, perl, cups, freetype, alsaLib, libjpeg, giflib, libpng, zlib, lcms2 3 + , libX11, libICE, libXrender, libXext, libXt, libXtst, libXi, libXinerama 4 + , libXcursor, libXrandr, fontconfig, openjdk11-bootstrap 5 5 , setJavaClassPath 6 - , minimal ? false 7 - , enableJavaFX ? true, openjfx 6 + , headless ? false 7 + , enableJavaFX ? openjfx.meta.available, openjfx 8 8 , enableGnome2 ? true, gtk3, gnome_vfs, glib, GConf 9 9 }: 10 10 11 11 let 12 - 13 - /** 14 - * The JDK libraries are in directories that depend on the CPU. 15 - */ 16 - architecture = 17 - if stdenv.hostPlatform.system == "i686-linux" then 18 - "i386" 19 - else "amd64"; 20 - 21 12 major = "11"; 22 13 update = ".0.3"; 23 14 build = "ga"; 24 - repover = "jdk-${major}${update}-${build}"; 25 15 26 - openjdk = stdenv.mkDerivation { 27 - name = "openjdk-${major}${update}-${build}"; 16 + openjdk = stdenv.mkDerivation rec { 17 + pname = "openjdk" + lib.optionalString headless "-headless"; 18 + version = "${major}${update}-${build}"; 28 19 29 20 src = fetchurl { 30 - url = "http://hg.openjdk.java.net/jdk-updates/jdk${major}u/archive/${repover}.tar.gz"; 21 + url = "http://hg.openjdk.java.net/jdk-updates/jdk${major}u/archive/jdk-${version}.tar.gz"; 31 22 sha256 = "1v6pam38iidlhz46046h17hf5kki6n3kl302awjcyxzk7bmkvb8x"; 32 23 }; 33 24 34 - nativeBuildInputs = [ pkgconfig ]; 25 + nativeBuildInputs = [ pkgconfig autoconf ]; 35 26 buildInputs = [ 36 - autoconf cpio file which unzip zip perl bootjdk zlib cups freetype alsaLib 37 - libjpeg giflib libX11 libICE libXext libXrender libXtst libXt libXtst 38 - libXi libXinerama libXcursor libXrandr lndir fontconfig 39 - ] ++ lib.optionals (!minimal && enableGnome2) [ 27 + cpio file which unzip zip perl zlib cups freetype alsaLib libjpeg giflib 28 + libpng zlib lcms2 libX11 libICE libXrender libXext libXtst libXt libXtst 29 + libXi libXinerama libXcursor libXrandr fontconfig openjdk11-bootstrap 30 + ] ++ lib.optionals (!headless && enableGnome2) [ 40 31 gtk3 gnome_vfs GConf glib 41 32 ]; 42 33 ··· 45 36 ./read-truststore-from-env-jdk10.patch 46 37 ./currency-date-range-jdk10.patch 47 38 ./increase-javadoc-heap.patch 48 - ] ++ lib.optionals (!minimal && enableGnome2) [ 39 + ] ++ lib.optionals (!headless && enableGnome2) [ 49 40 ./swing-use-gtk-jdk10.patch 50 41 ]; 51 42 52 43 preConfigure = '' 53 44 chmod +x configure 54 45 substituteInPlace configure --replace /bin/bash "${bash}/bin/bash" 46 + ''; 55 47 56 - configureFlagsArray=( 57 - "--with-boot-jdk=${bootjdk.home}" 58 - "--with-update-version=${major}${update}" 59 - "--with-build-number=${build}" 60 - "--with-milestone=fcs" 61 - "--enable-unlimited-crypto" 62 - "--disable-debug-symbols" 63 - "--with-zlib=system" 64 - "--with-giflib=system" 65 - "--with-stdc++lib=dynamic" 48 + configureFlags = [ 49 + "--with-boot-jdk=${openjdk11-bootstrap.home}" 50 + "--enable-unlimited-crypto" 51 + "--with-native-debug-symbols=internal" 52 + "--with-libjpeg=system" 53 + "--with-giflib=system" 54 + "--with-libpng=system" 55 + "--with-zlib=system" 56 + "--with-lcms=system" 57 + "--with-stdc++lib=dynamic" 58 + ] ++ lib.optional stdenv.isx86_64 "--with-jvm-features=zgc" 59 + ++ lib.optional headless "--enable-headless-only" 60 + ++ lib.optional (!headless && enableJavaFX) "--with-import-modules=${openjfx}"; 66 61 67 - # glibc 2.24 deprecated readdir_r so we need this 68 - # See https://www.mail-archive.com/openembedded-devel@lists.openembedded.org/msg49006.html 69 - "--with-extra-cflags=-Wno-error=deprecated-declarations -Wno-error=format-contains-nul -Wno-error=unused-result" 70 - '' 71 - + lib.optionalString (architecture == "amd64") " \"--with-jvm-features=zgc\"" 72 - + lib.optionalString minimal " \"--enable-headless-only\"" 73 - + lib.optionalString (!minimal && enableJavaFX) " \"--with-import-modules=${openjfx}\"" 74 - + ");" 75 - # https://bugzilla.redhat.com/show_bug.cgi?id=1306558 76 - # https://github.com/JetBrains/jdk8u/commit/eaa5e0711a43d64874111254d74893fa299d5716 77 - + stdenv.lib.optionalString stdenv.cc.isGNU '' 78 - NIX_CFLAGS_COMPILE+=" -fno-lifetime-dse -fno-delete-null-pointer-checks -std=gnu++98 -Wno-error" 79 - ''; 62 + separateDebugInfo = true; 63 + 64 + NIX_CFLAGS_COMPILE = [ "-Wno-error" ]; 80 65 81 - NIX_LDFLAGS= lib.optionals (!minimal) [ 66 + NIX_LDFLAGS = lib.optionals (!headless) [ 82 67 "-lfontconfig" "-lcups" "-lXinerama" "-lXrandr" "-lmagic" 83 - ] ++ lib.optionals (!minimal && enableGnome2) [ 68 + ] ++ lib.optionals (!headless && enableGnome2) [ 84 69 "-lgtk-3" "-lgio-2.0" "-lgnomevfs-2" "-lgconf-2" 85 70 ]; 86 71 87 72 buildFlags = [ "all" ]; 88 73 89 74 installPhase = '' 90 - mkdir -p $out/lib/openjdk $out/share 75 + mkdir -p $out/lib 91 76 92 - cp -av build/*/images/jdk/* $out/lib/openjdk 77 + mv build/*/images/jdk $out/lib/openjdk 93 78 94 79 # Remove some broken manpages. 95 80 rm -rf $out/lib/openjdk/man/ja* 96 81 97 82 # Mirror some stuff in top-level. 98 - mkdir $out/include $out/share/man 99 - ln -s $out/lib/openjdk/include/* $out/include/ 100 - ln -s $out/lib/openjdk/man/* $out/share/man/ 83 + mkdir -p $out/share 84 + ln -s $out/lib/openjdk/include $out/include 85 + ln -s $out/lib/openjdk/man $out/share/man 101 86 102 87 # jni.h expects jni_md.h to be in the header search path. 103 88 ln -s $out/include/linux/*_md.h $out/include/ 104 89 105 90 # Remove crap from the installation. 106 91 rm -rf $out/lib/openjdk/demo 107 - ${lib.optionalString minimal '' 92 + ${lib.optionalString headless '' 108 93 rm $out/lib/openjdk/lib/{libjsound,libfontmanager}.so 109 94 ''} 110 95 ··· 129 114 # Build the set of output library directories to rpath against 130 115 LIBDIRS="" 131 116 for output in $outputs; do 117 + if [ "$output" = debug ]; then continue; fi 132 118 LIBDIRS="$(find $(eval echo \$$output) -name \*.so\* -exec dirname {} \+ | sort | uniq | tr '\n' ':'):$LIBDIRS" 133 119 done 134 - 135 120 # Add the local library paths to remove dependencies on the bootstrap 136 121 for output in $outputs; do 122 + if [ "$output" = debug ]; then continue; fi 137 123 OUTPUTDIR=$(eval echo \$$output) 138 124 BINLIBS=$(find $OUTPUTDIR/bin/ -type f; find $OUTPUTDIR -name \*.so\*) 139 125 echo "$BINLIBS" | while read i; do ··· 141 127 patchelf --shrink-rpath "$i" || true 142 128 done 143 129 done 144 - 145 - # Test to make sure that we don't depend on the bootstrap 146 - for output in $outputs; do 147 - if grep -q -r '${bootjdk}' $(eval echo \$$output); then 148 - echo "Extraneous references to ${bootjdk} detected" 149 - exit 1 150 - fi 151 - done 152 130 ''; 131 + 132 + disallowedReferences = [ openjdk11-bootstrap ]; 153 133 154 134 meta = with stdenv.lib; { 155 135 homepage = http://openjdk.java.net/; 156 136 license = licenses.gpl2; 157 137 description = "The open-source Java Development Kit"; 158 138 maintainers = with maintainers; [ edwtjo ]; 159 - platforms = ["i686-linux" "x86_64-linux"]; 139 + platforms = [ "i686-linux" "x86_64-linux" "aarch64-linux" "armv7l-linux" "armv6l-linux" ]; 160 140 }; 161 141 162 142 passthru = { 163 - inherit architecture; 143 + architecture = ""; 164 144 home = "${openjdk}/lib/openjdk"; 165 145 }; 166 146 };
+86 -76
pkgs/development/compilers/openjdk/8.nix
··· 1 1 { stdenv, lib, fetchurl, bash, cpio, pkgconfig, file, which, unzip, zip, cups, freetype 2 - , alsaLib, bootjdk, cacert, perl, liberation_ttf, fontconfig, zlib, lndir 2 + , alsaLib, cacert, perl, liberation_ttf, fontconfig, zlib 3 3 , libX11, libICE, libXrender, libXext, libXt, libXtst, libXi, libXinerama, libXcursor, libXrandr 4 4 , libjpeg, giflib 5 + , openjdk8-bootstrap 5 6 , setJavaClassPath 6 - , minimal ? false 7 + , headless ? false 7 8 , enableInfinality ? true # font rendering patch 8 9 , enableGnome2 ? true, gtk2, gnome_vfs, glib, GConf 9 10 }: ··· 13 14 /** 14 15 * The JRE libraries are in directories that depend on the CPU. 15 16 */ 16 - architecture = 17 - if stdenv.hostPlatform.system == "i686-linux" then 18 - "i386" 19 - else if stdenv.hostPlatform.system == "x86_64-linux" then 20 - "amd64" 21 - else 22 - throw "openjdk requires i686-linux or x86_64 linux"; 17 + architecture = { 18 + "i686-linux" = "i386"; 19 + "x86_64-linux" = "amd64"; 20 + "aarch64-linux" = "aarch64"; 21 + }.${stdenv.system} or (throw "Unsupported platform"); 23 22 24 23 update = "212"; 25 - build = "ga"; 26 - baseurl = "http://hg.openjdk.java.net/jdk8u/jdk8u"; 27 - repover = "jdk8u${update}-${build}"; 24 + build = if stdenv.isAarch64 then "b04" 25 + else "ga"; 26 + baseurl = if stdenv.isAarch64 then "https://hg.openjdk.java.net/aarch64-port/jdk8u-shenandoah" 27 + else "https://hg.openjdk.java.net/jdk8u/jdk8u"; 28 + repover = lib.optionalString stdenv.isAarch64 "aarch64-shenandoah-" 29 + + "jdk8u${update}-${build}"; 30 + 28 31 jdk8 = fetchurl { 32 + name = "jdk8-${repover}.tar.gz"; 29 33 url = "${baseurl}/archive/${repover}.tar.gz"; 30 - sha256 = "00rl33h4cl4b4p3hcid765h38x2jdkb14ylh8k1zhnd0ka76crgg"; 34 + sha256 = if stdenv.isAarch64 then "0z2n2b5f1jmdzycb7ppqz3dx5sf1rwwd3fvk15zq4cm7908wapjw" 35 + else "00rl33h4cl4b4p3hcid765h38x2jdkb14ylh8k1zhnd0ka76crgg"; 31 36 }; 32 37 langtools = fetchurl { 38 + name = "langtools-${repover}.tar.gz"; 33 39 url = "${baseurl}/langtools/archive/${repover}.tar.gz"; 34 - sha256 = "0va6g2dccf1ph6mpwxswbks5axp7zz258cl89qq9r8jn4ni04agw"; 40 + sha256 = if stdenv.isAarch64 then "0j0fbxj7fkl8bn8lq3s3sssa26hskaf8c9rmsay8r91m4vnxisv1" 41 + else "0va6g2dccf1ph6mpwxswbks5axp7zz258cl89qq9r8jn4ni04agw"; 35 42 }; 36 43 hotspot = fetchurl { 44 + name = "hotspot-${repover}.tar.gz"; 37 45 url = "${baseurl}/hotspot/archive/${repover}.tar.gz"; 38 - sha256 = "0sgr9df10hs49pjld6c6kr374v4zwd9s52pc3drz68zrlk71ja4s"; 46 + sha256 = if stdenv.isAarch64 then "1ld76jx0v1z6755a61k5da0cks7dqwvwc5l8rvyw9r9py1n7421w" 47 + else "0sgr9df10hs49pjld6c6kr374v4zwd9s52pc3drz68zrlk71ja4s"; 39 48 }; 40 49 corba = fetchurl { 50 + name = "corba-${repover}.tar.gz"; 41 51 url = "${baseurl}/corba/archive/${repover}.tar.gz"; 42 - sha256 = "1hq0sr4k4k4iv815kg72i9lvd7n7mn5pmw96ckk9p1rnyagn9z03"; 52 + sha256 = if stdenv.isAarch64 then "1jcw90y3d8rnvqpiyyvsx976f5i8d60p0d6652v4mz41pyjjhyw5" 53 + else "1hq0sr4k4k4iv815kg72i9lvd7n7mn5pmw96ckk9p1rnyagn9z03"; 43 54 }; 44 55 jdk = fetchurl { 56 + name = "jdk-${repover}.tar.gz"; 45 57 url = "${baseurl}/jdk/archive/${repover}.tar.gz"; 46 - sha256 = "1fc59jrbfq8l067mggzy5dnrvni7lwaqd7hahs4nqv87kyrfg545"; 58 + sha256 = if stdenv.isAarch64 then "19mnlw7igxblxx8qp6l9rn2w0xw1akdx2v1rw6pq14d03dgwby22" 59 + else "1fc59jrbfq8l067mggzy5dnrvni7lwaqd7hahs4nqv87kyrfg545"; 47 60 }; 48 61 jaxws = fetchurl { 62 + name = "jaxws-${repover}.tar.gz"; 49 63 url = "${baseurl}/jaxws/archive/${repover}.tar.gz"; 50 - sha256 = "1ka2fvyxdmpfhk814s314gx53yvdr19vpsqygx283v9nbq90l1yg"; 64 + sha256 = if stdenv.isAarch64 then "1dvlcj5jrwia08im1is9ms6r619jvzkhyg3ls0czh2yycabg6p51" 65 + else "1ka2fvyxdmpfhk814s314gx53yvdr19vpsqygx283v9nbq90l1yg"; 51 66 }; 52 67 jaxp = fetchurl { 68 + name = "jaxp-${repover}.tar.gz"; 53 69 url = "${baseurl}/jaxp/archive/${repover}.tar.gz"; 54 - sha256 = "15vlgs5v2ax8sqwh7bg50fnlrwlpnkp0myzrvpqs1mcza8pyasp8"; 70 + sha256 = if stdenv.isAarch64 then "1imz7bsiqhhh5qx8hjpm46y7a4j282vmdd6xljz8n148vml2p936" 71 + else "15vlgs5v2ax8sqwh7bg50fnlrwlpnkp0myzrvpqs1mcza8pyasp8"; 55 72 }; 56 73 nashorn = fetchurl { 74 + name = "nashorn-${repover}.tar.gz"; 57 75 url = "${baseurl}/nashorn/archive/${repover}.tar.gz"; 58 - sha256 = "1jzn0yi0v6lda5y8ib07g1p6zymnbcx9yy6iz8niggpm7205y93h"; 76 + sha256 = if stdenv.isAarch64 then "0rnrzz42f3ismhwj05sim7d05wccp5bcr5rhxgnvs3hjqaqvq51n" 77 + else "1jzn0yi0v6lda5y8ib07g1p6zymnbcx9yy6iz8niggpm7205y93h"; 59 78 }; 60 79 openjdk8 = stdenv.mkDerivation { 61 - name = "openjdk-8u${update}-${build}"; 80 + pname = "openjdk" + lib.optionalString headless "-headless"; 81 + version = "8u${update}-${build}"; 62 82 63 83 srcs = [ jdk8 langtools hotspot corba jdk jaxws jaxp nashorn ]; 64 84 sourceRoot = "."; ··· 67 87 68 88 nativeBuildInputs = [ pkgconfig ]; 69 89 buildInputs = [ 70 - cpio file which unzip zip perl bootjdk zlib cups freetype alsaLib 90 + cpio file which unzip zip perl openjdk8-bootstrap zlib cups freetype alsaLib 71 91 libjpeg giflib libX11 libICE libXext libXrender libXtst libXt libXtst 72 - libXi libXinerama libXcursor libXrandr lndir fontconfig 73 - ] ++ lib.optionals (!minimal && enableGnome2) [ 92 + libXi libXinerama libXcursor libXrandr fontconfig 93 + ] ++ lib.optionals (!headless && enableGnome2) [ 74 94 gtk2 gnome_vfs GConf glib 75 95 ]; 76 96 77 - #move the seven other source dirs under the main jdk8u directory, 78 - #with version suffixes removed, as the remainder of the build will expect 97 + # move the seven other source dirs under the main jdk8u directory, 98 + # with version suffixes removed, as the remainder of the build will expect 79 99 prePatch = '' 80 100 mainDir=$(find . -maxdepth 1 -name jdk8u\*); 81 101 find . -maxdepth 1 -name \*jdk\* -not -name jdk8u\* | awk -F- '{print $1}' | while read p; do ··· 88 108 ./fix-java-home-jdk8.patch 89 109 ./read-truststore-from-env-jdk8.patch 90 110 ./currency-date-range-jdk8.patch 91 - ] ++ lib.optionals (!minimal && enableInfinality) [ 111 + ] ++ lib.optionals (!headless && enableInfinality) [ 92 112 ./004_add-fontconfig.patch 93 113 ./005_enable-infinality.patch 94 - ] ++ lib.optionals (!minimal && enableGnome2) [ 114 + ] ++ lib.optionals (!headless && enableGnome2) [ 95 115 ./swing-use-gtk-jdk8.patch 96 116 ]; 97 117 ··· 103 123 substituteInPlace configure --replace /bin/bash "${bash}/bin/bash" 104 124 substituteInPlace hotspot/make/linux/adlc_updater --replace /bin/sh "${stdenv.shell}" 105 125 substituteInPlace hotspot/make/linux/makefiles/dtrace.make --replace /usr/include/sys/sdt.h "/no-such-path" 106 - '' 107 - # https://bugzilla.redhat.com/show_bug.cgi?id=1306558 108 - # https://github.com/JetBrains/jdk8u/commit/eaa5e0711a43d64874111254d74893fa299d5716 109 - + stdenv.lib.optionalString stdenv.cc.isGNU '' 110 - NIX_CFLAGS_COMPILE+=" -fno-lifetime-dse -fno-delete-null-pointer-checks -std=gnu++98 -Wno-error" 111 126 ''; 112 127 113 128 configureFlags = [ 114 - "--with-boot-jdk=${bootjdk.home}" 129 + "--with-boot-jdk=${openjdk8-bootstrap.home}" 115 130 "--with-update-version=${update}" 116 131 "--with-build-number=${build}" 117 132 "--with-milestone=fcs" 118 133 "--enable-unlimited-crypto" 119 - "--disable-debug-symbols" 134 + "--with-native-debug-symbols=internal" 120 135 "--disable-freetype-bundling" 121 136 "--with-zlib=system" 122 137 "--with-giflib=system" 123 138 "--with-stdc++lib=dynamic" 139 + ] ++ lib.optional headless "--disable-headful"; 124 140 141 + separateDebugInfo = true; 142 + 143 + NIX_CFLAGS_COMPILE = [ 125 144 # glibc 2.24 deprecated readdir_r so we need this 126 145 # See https://www.mail-archive.com/openembedded-devel@lists.openembedded.org/msg49006.html 127 - "--with-extra-cflags=\"-Wno-error=deprecated-declarations\"" 128 - ] ++ lib.optional minimal "--disable-headful"; 146 + "-Wno-error=deprecated-declarations" 147 + ] ++ lib.optionals stdenv.cc.isGNU [ 148 + # https://bugzilla.redhat.com/show_bug.cgi?id=1306558 149 + # https://github.com/JetBrains/jdk8u/commit/eaa5e0711a43d64874111254d74893fa299d5716 150 + "-fno-lifetime-dse" 151 + "-fno-delete-null-pointer-checks" 152 + "-std=gnu++98" 153 + "-Wno-error" 154 + ]; 129 155 130 - NIX_LDFLAGS= lib.optionals (!minimal) [ 156 + NIX_LDFLAGS= lib.optionals (!headless) [ 131 157 "-lfontconfig" "-lcups" "-lXinerama" "-lXrandr" "-lmagic" 132 - ] ++ lib.optionals (!minimal && enableGnome2) [ 158 + ] ++ lib.optionals (!headless && enableGnome2) [ 133 159 "-lgtk-x11-2.0" "-lgio-2.0" "-lgnomevfs-2" "-lgconf-2" 134 160 ]; 135 161 ··· 138 164 doCheck = false; # fails with "No rule to make target 'y'." 139 165 140 166 installPhase = '' 141 - mkdir -p $out/lib/openjdk $out/share $jre/lib/openjdk 167 + mkdir -p $out/lib 142 168 143 - cp -av build/*/images/j2sdk-image/* $out/lib/openjdk 169 + mv build/*/images/j2sdk-image $out/lib/openjdk 144 170 145 171 # Remove some broken manpages. 146 172 rm -rf $out/lib/openjdk/man/ja* 147 173 148 174 # Mirror some stuff in top-level. 149 - mkdir $out/include $out/share/man 150 - ln -s $out/lib/openjdk/include/* $out/include/ 151 - ln -s $out/lib/openjdk/man/* $out/share/man/ 175 + mkdir -p $out/share 176 + ln -s $out/lib/openjdk/include $out/include 177 + ln -s $out/lib/openjdk/man $out/share/man 152 178 153 179 # jni.h expects jni_md.h to be in the header search path. 154 180 ln -s $out/include/linux/*_md.h $out/include/ 155 181 156 182 # Remove crap from the installation. 157 183 rm -rf $out/lib/openjdk/demo $out/lib/openjdk/sample 158 - ${lib.optionalString minimal '' 184 + ${lib.optionalString headless '' 159 185 rm $out/lib/openjdk/jre/lib/${architecture}/{libjsound,libjsoundalsa,libsplashscreen,libawt*,libfontmanager}.so 160 186 rm $out/lib/openjdk/jre/bin/policytool 161 187 rm $out/lib/openjdk/bin/{policytool,appletviewer} 162 188 ''} 163 189 164 - # Move the JRE to a separate output and setup fallback fonts 165 - mv $out/lib/openjdk/jre $jre/lib/openjdk/ 166 - mkdir $out/lib/openjdk/jre 167 - ${lib.optionalString (!minimal) '' 168 - mkdir -p $jre/lib/openjdk/jre/lib/fonts/fallback 169 - lndir ${liberation_ttf}/share/fonts/truetype $jre/lib/openjdk/jre/lib/fonts/fallback 190 + # Move the JRE to a separate output 191 + mkdir -p $jre/lib/openjdk 192 + mv $out/lib/openjdk/jre $jre/lib/openjdk/jre 193 + ln -s $jre/lib/openjdk/jre $out/lib/openjdk/jre 194 + 195 + # Setup fallback fonts 196 + ${lib.optionalString (!headless) '' 197 + mkdir -p $jre/lib/openjdk/jre/lib/fonts 198 + ln -s ${liberation_ttf}/share/fonts/truetype $jre/lib/openjdk/jre/lib/fonts/fallback 170 199 ''} 171 - lndir $jre/lib/openjdk/jre $out/lib/openjdk/jre 172 - 173 - rm -rf $out/lib/openjdk/jre/bina 174 - ln -s $out/lib/openjdk/bin $out/lib/openjdk/jre/bin 175 - 176 - # Make sure cmm/*.pf are not symlinks: 177 - # https://youtrack.jetbrains.com/issue/IDEA-147272 178 - rm -rf $out/lib/openjdk/jre/lib/cmm 179 - ln -s {$jre,$out}/lib/openjdk/jre/lib/cmm 180 200 181 201 # Remove duplicate binaries. 182 202 for i in $(cd $out/lib/openjdk/bin && echo *); do ··· 198 218 ln -s $jre/lib/openjdk/jre $out/jre 199 219 ''; 200 220 201 - # FIXME: this is unnecessary once the multiple-outputs branch is merged. 202 221 preFixup = '' 203 - prefix=$jre stripDirs "$STRIP" "$stripDebugList" "''${stripDebugFlags:--S}" 204 - patchELF $jre 205 - propagatedBuildInputs+=" $jre" 206 - 207 222 # Propagate the setJavaClassPath setup hook from the JRE so that 208 223 # any package that depends on the JRE has $CLASSPATH set up 209 224 # properly. ··· 221 236 # Build the set of output library directories to rpath against 222 237 LIBDIRS="" 223 238 for output in $outputs; do 239 + if [ "$output" = debug ]; then continue; fi 224 240 LIBDIRS="$(find $(eval echo \$$output) -name \*.so\* -exec dirname {} \+ | sort | uniq | tr '\n' ':'):$LIBDIRS" 225 241 done 226 - 227 242 # Add the local library paths to remove dependencies on the bootstrap 228 243 for output in $outputs; do 244 + if [ "$output" = debug ]; then continue; fi 229 245 OUTPUTDIR=$(eval echo \$$output) 230 246 BINLIBS=$(find $OUTPUTDIR/bin/ -type f; find $OUTPUTDIR -name \*.so\*) 231 247 echo "$BINLIBS" | while read i; do ··· 233 249 patchelf --shrink-rpath "$i" || true 234 250 done 235 251 done 236 - 237 - # Test to make sure that we don't depend on the bootstrap 238 - for output in $outputs; do 239 - if grep -q -r '${bootjdk}' $(eval echo \$$output); then 240 - echo "Extraneous references to ${bootjdk} detected" 241 - exit 1 242 - fi 243 - done 244 252 ''; 245 253 246 - meta = with stdenv.lib; { 254 + disallowedReferences = [ openjdk8-bootstrap ]; 255 + 256 + meta = with lib; { 247 257 homepage = http://openjdk.java.net/; 248 258 license = licenses.gpl2; 249 259 description = "The open-source Java Development Kit"; 250 260 maintainers = with maintainers; [ edwtjo nequissimus ]; 251 - platforms = platforms.linux; 261 + platforms = [ "i686-linux" "x86_64-linux" "aarch64-linux" ]; 252 262 }; 253 263 254 264 passthru = {
+15 -18
pkgs/development/compilers/openjdk/openjfx/11.nix
··· 1 - { stdenv, fetchurl, writeText, openjdk, bootjdk, gradleGen, pkgconfig, perl, cmake, gperf 2 - , gtk2, gtk3, libXtst, libXxf86vm, glib, alsaLib, ffmpeg, python, ruby }: 1 + { stdenv, lib, fetchurl, writeText, openjdk11, gradleGen, pkgconfig, perl, cmake 2 + , gperf, gtk2, gtk3, libXtst, libXxf86vm, glib, alsaLib, ffmpeg, python, ruby 3 + , openjdk11-bootstrap }: 3 4 4 5 let 5 6 major = "11"; ··· 7 8 build = "1"; 8 9 repover = "${major}${update}+${build}"; 9 10 gradle_ = (gradleGen.override { 10 - java = bootjdk; 11 + java = openjdk11-bootstrap; 11 12 }).gradle_4_10; 12 13 13 14 makePackage = args: stdenv.mkDerivation ({ ··· 25 26 26 27 config = writeText "gradle.properties" ('' 27 28 CONF = Release 28 - JDK_HOME = ${bootjdk}/lib/openjdk 29 + JDK_HOME = ${openjdk11-bootstrap.home} 29 30 '' + args.gradleProperties or ""); 30 31 31 32 buildPhase = '' ··· 56 57 57 58 outputHashAlgo = "sha256"; 58 59 outputHashMode = "recursive"; 59 - outputHash = 60 - # Downloaded AWT jars differ by platform. 61 - if stdenv.system == "x86_64-linux" then "0d4msxswdav1xsfkpr0qd3xgqkcbxzf47v1zdy5jmg5w4bs6a78a" 62 - else if stdenv.system == "i686-linux" then "0mjlyf6jvbis7nrm5d394sjv4hjw6k3753hr1nwdxk8skwc3ry08" 63 - else throw "Unsupported platform"; 60 + # Downloaded AWT jars differ by platform. 61 + outputHash = { 62 + "i686-linux" = "0mjlyf6jvbis7nrm5d394sjv4hjw6k3753hr1nwdxk8skwc3ry08"; 63 + "x86_64-linux" = "0d4msxswdav1xsfkpr0qd3xgqkcbxzf47v1zdy5jmg5w4bs6a78a"; 64 + }.${stdenv.system} or (throw "Unsupported platform"); 64 65 }; 65 66 66 67 in makePackage { ··· 87 88 postFixup = '' 88 89 # Remove references to bootstrap. 89 90 find "$out" -name \*.so | while read lib; do 90 - new_refs="$(patchelf --print-rpath "$lib" | sed -E 's,:?${bootjdk}[^:]*,,')" 91 + new_refs="$(patchelf --print-rpath "$lib" | sed -E 's,:?${openjdk11-bootstrap}[^:]*,,')" 91 92 patchelf --set-rpath "$new_refs" "$lib" 92 93 done 93 - 94 - # Test to make sure that we don't depend on the bootstrap 95 - if grep -q -r '${bootjdk}' "$out"; then 96 - echo "Extraneous references to ${bootjdk} detected" >&2 97 - exit 1 98 - fi 99 94 ''; 95 + 96 + disallowedReferences = [ openjdk11-bootstrap ]; 100 97 101 98 passthru.deps = deps; 102 99 103 100 meta = with stdenv.lib; { 104 101 homepage = http://openjdk.java.net/projects/openjfx/; 105 - license = openjdk.meta.license; 102 + license = openjdk11.meta.license; 106 103 description = "The next-generation Java client toolkit."; 107 104 maintainers = with maintainers; [ abbradar ]; 108 - platforms = openjdk.meta.platforms; 105 + platforms = [ "i686-linux" "x86_64-linux" ]; 109 106 }; 110 107 }
+39 -47
pkgs/top-level/all-packages.nix
··· 7862 7862 7863 7863 hugs = callPackage ../development/interpreters/hugs { }; 7864 7864 7865 - bootjdk = callPackage ../development/compilers/openjdk/bootstrap.nix { version = "10"; }; 7865 + openjfx11 = callPackage ../development/compilers/openjdk/openjfx/11.nix { }; 7866 7866 7867 - openjfx11 = 7868 - if stdenv.isDarwin then 7869 - null 7867 + openjfx12 = callPackage ../development/compilers/openjdk/openjfx/12.nix { }; 7868 + 7869 + openjdk8-bootstrap = 7870 + if adoptopenjdk-hotspot-bin-8.meta.available then 7871 + adoptopenjdk-hotspot-bin-8 7870 7872 else 7871 - callPackage ../development/compilers/openjdk/openjfx/11.nix { 7872 - openjdk = openjdk11; 7873 - }; 7873 + callPackage ../development/compilers/openjdk/bootstrap.nix { version = "8"; }; 7874 7874 7875 7875 /* legacy jdk for use as needed by older apps */ 7876 7876 openjdk8 = ··· 7878 7878 callPackage ../development/compilers/openjdk/darwin/8.nix { } 7879 7879 else 7880 7880 callPackage ../development/compilers/openjdk/8.nix { 7881 - bootjdk = bootjdk.override { version = "8"; }; 7882 7881 inherit (gnome2) GConf gnome_vfs; 7883 7882 }; 7884 7883 7884 + openjdk8_headless = 7885 + if stdenv.isDarwin || stdenv.isAarch64 then 7886 + openjdk8 7887 + else 7888 + openjdk8.override { headless = true; }; 7889 + 7890 + openjdk11-bootstrap = 7891 + if adoptopenjdk-hotspot-bin-11.meta.available then 7892 + adoptopenjdk-hotspot-bin-11 7893 + else 7894 + callPackage ../development/compilers/openjdk/bootstrap.nix { version = "10"; }; 7895 + 7885 7896 /* currently maintained LTS JDK */ 7886 7897 openjdk11 = 7887 7898 if stdenv.isDarwin then ··· 7892 7903 inherit (gnome2) GConf gnome_vfs; 7893 7904 }; 7894 7905 7895 - openjfx12 = 7906 + openjdk11_headless = 7896 7907 if stdenv.isDarwin then 7897 - null 7908 + openjdk11 7898 7909 else 7899 - callPackage ../development/compilers/openjdk/openjfx/12.nix { 7900 - openjdk = openjdk12; 7901 - bootjdk = openjdk11; 7902 - }; 7910 + openjdk11.override { headless = true; }; 7903 7911 7904 7912 /* current JDK */ 7905 7913 openjdk12 = 7906 7914 if stdenv.isDarwin then 7907 - callPackage ../development/compilers/openjdk/darwin/default.nix { } 7915 + callPackage ../development/compilers/openjdk/darwin { } 7908 7916 else 7909 - callPackage ../development/compilers/openjdk/default.nix { 7917 + callPackage ../development/compilers/openjdk { 7910 7918 openjfx = openjfx12; 7911 7919 inherit (gnome2) GConf gnome_vfs; 7912 - bootjdk = openjdk11; 7913 7920 }; 7914 7921 7922 + openjdk12_headless = 7923 + if stdenv.isDarwin then 7924 + openjdk12 7925 + else 7926 + openjdk12.override { headless = true; }; 7927 + 7915 7928 openjdk = openjdk8; 7929 + openjdk_headless = openjdk8_headless; 7916 7930 7917 - jdk8 = if stdenv.isAarch32 || stdenv.isAarch64 then oraclejdk8 else openjdk8 // { outputs = [ "out" ]; }; 7918 - jre8 = if stdenv.isAarch32 || stdenv.isAarch64 then oraclejre8 else lib.setName "openjre-${lib.getVersion pkgs.openjdk8.jre}" 7919 - (lib.addMetaAttrs { outputsToInstall = [ "jre" ]; } 7920 - (openjdk8.jre // { outputs = [ "jre" ]; })); 7921 - jre8_headless = 7922 - if stdenv.isAarch32 || stdenv.isAarch64 then 7923 - oraclejre8 7924 - else if stdenv.isDarwin then 7925 - jre8 7926 - else 7927 - lib.setName "openjre-${lib.getVersion pkgs.openjdk8.jre}-headless" 7928 - (lib.addMetaAttrs { outputsToInstall = [ "jre" ]; } 7929 - ((openjdk8.override { minimal = true; }).jre // { outputs = [ "jre" ]; })); 7931 + jdk8 = openjdk8; 7932 + jre8 = openjdk8.jre; 7933 + jre8_headless = openjdk8_headless.jre; 7930 7934 7931 - jdk11 = openjdk11 // { outputs = [ "out" ]; }; 7932 - jdk11_headless = 7933 - if stdenv.isDarwin then 7934 - jdk11 7935 - else 7936 - lib.setName "openjdk-${lib.getVersion pkgs.openjdk11}-headless" 7937 - (lib.addMetaAttrs {} 7938 - ((openjdk11.override { minimal = true; }) // {})); 7935 + jdk11 = openjdk11; 7936 + jdk11_headless = openjdk11_headless; 7939 7937 7940 - jdk12 = openjdk12 // { outputs = [ "out" ]; }; 7941 - jdk12_headless = 7942 - if stdenv.isDarwin then 7943 - jdk12 7944 - else 7945 - lib.setName "openjdk-${lib.getVersion pkgs.openjdk12}-headless" 7946 - (lib.addMetaAttrs {} 7947 - ((openjdk12.override { minimal = true; }) // {})); 7938 + jdk12 = openjdk12; 7939 + jdk12_headless = openjdk12_headless; 7948 7940 7949 7941 jdk = jdk8; 7950 - jre = if stdenv.isAarch32 || stdenv.isAarch64 then adoptopenjdk-jre-bin else jre8; 7942 + jre = jre8; 7951 7943 jre_headless = jre8_headless; 7952 7944 7953 7945 inherit (callPackages ../development/compilers/graalvm { }) mx jvmci8 graalvm8;