diff options
Diffstat (limited to 'pkgs/development/compilers/openjdk')
-rw-r--r-- | pkgs/development/compilers/openjdk/10.nix | 2 | ||||
-rw-r--r-- | pkgs/development/compilers/openjdk/7.nix | 244 | ||||
-rw-r--r-- | pkgs/development/compilers/openjdk/8.nix | 2 | ||||
-rw-r--r-- | pkgs/development/compilers/openjdk/9.nix | 262 | ||||
-rw-r--r-- | pkgs/development/compilers/openjdk/bootstrap.nix | 35 | ||||
-rw-r--r-- | pkgs/development/compilers/openjdk/cppflags-include-fix.patch | 16 | ||||
-rw-r--r-- | pkgs/development/compilers/openjdk/currency-date-range.patch | 14 | ||||
-rw-r--r-- | pkgs/development/compilers/openjdk/fix-java-home-jdk9.patch | 14 | ||||
-rw-r--r-- | pkgs/development/compilers/openjdk/fix-java-home.patch | 17 | ||||
-rw-r--r-- | pkgs/development/compilers/openjdk/paxctl.patch | 28 | ||||
-rw-r--r-- | pkgs/development/compilers/openjdk/read-truststore-from-env-jdk9.patch | 20 | ||||
-rw-r--r-- | pkgs/development/compilers/openjdk/read-truststore-from-env.patch | 21 | ||||
-rw-r--r-- | pkgs/development/compilers/openjdk/swing-use-gtk-jdk8.patch (renamed from pkgs/development/compilers/openjdk/swing-use-gtk.patch) | 0 | ||||
-rw-r--r-- | pkgs/development/compilers/openjdk/swing-use-gtk-jdk9.patch | 26 |
14 files changed, 14 insertions, 687 deletions
diff --git a/pkgs/development/compilers/openjdk/10.nix b/pkgs/development/compilers/openjdk/10.nix index 2a0c7a1ac01c..545a333029d7 100644 --- a/pkgs/development/compilers/openjdk/10.nix +++ b/pkgs/development/compilers/openjdk/10.nix @@ -113,7 +113,7 @@ let rm -rf $out/lib/openjdk/demo ${lib.optionalString minimal '' for d in $out/lib/openjdk/lib $jre/lib/openjdk/jre/lib; do - rm ''${d}/{libjsound,libjsoundalsa,libawt*,libfontmanager}.so + rm ''${d}/{libjsound,libjsoundalsa,libfontmanager}.so done ''} diff --git a/pkgs/development/compilers/openjdk/7.nix b/pkgs/development/compilers/openjdk/7.nix deleted file mode 100644 index 13f8bcfdb1de..000000000000 --- a/pkgs/development/compilers/openjdk/7.nix +++ /dev/null @@ -1,244 +0,0 @@ -{ stdenv, fetchurl, unzip, zip, procps, coreutils, alsaLib, ant, freetype -, which, bootjdk, nettools, xorg, file, cups -, fontconfig, cpio, cacert, perl, setJavaClassPath -, minimal ? false -}: - -let - - /** - * The JRE libraries are in directories that depend on the CPU. - */ - architecture = - if stdenv.system == "i686-linux" then - "i386" - else if stdenv.system == "x86_64-linux" then - "amd64" - else - throw "openjdk requires i686-linux or x86_64 linux"; - - update = "111"; - - build = "01"; - - # On x86 for heap sizes over 700MB disable SEGMEXEC and PAGEEXEC as well. - paxflags = if stdenv.isi686 then "msp" else "m"; - - baseurl = "http://hg.openjdk.java.net/jdk7u/jdk7u"; - repover = "jdk7u${update}-b${build}"; - jdk7 = fetchurl { - url = "${baseurl}/archive/${repover}.tar.gz"; - sha256 = "0wgb7hr2gipx1jg28fnsjh7xa744sh1mgr6z3xivmnsfy3dm91gi"; - }; - langtools = fetchurl { - url = "${baseurl}/langtools/archive/${repover}.tar.gz"; - sha256 = "0x1xs923h6sma02cbp1whg735x8vcndh5k01b7rkf714g6rxwa0y"; - }; - hotspot = fetchurl { - url = "${baseurl}/hotspot/archive/${repover}.tar.gz"; - sha256 = "187apnsvnd4cfa7ss5g59dbh7x5ah8f1lwa2wvjfv055h2cmphpn"; - }; - corba = fetchurl { - url = "${baseurl}/corba/archive/${repover}.tar.gz"; - sha256 = "0vmxf5sgjcmkm7i1scanaa2x75a1byj8b36vcajlr6j7qmdx6r8c"; - }; - jdk = fetchurl { - url = "${baseurl}/jdk/archive/${repover}.tar.gz"; - sha256 = "1f8f2dgrjhx8aw1gzawrf8qggf5j0dygsla08bbsxhx5mc5a6cka"; - }; - jaxws = fetchurl { - url = "${baseurl}/jaxws/archive/${repover}.tar.gz"; - sha256 = "03982ajxm0hzany1jg009ym84vryx7a8qfi6wcgjxyxvk8vnz37c"; - }; - jaxp = fetchurl { - url = "${baseurl}/jaxp/archive/${repover}.tar.gz"; - sha256 = "0578h04y1ha60yjplsa8lqdjds9s2lxzgs9ybm9rs1rqzxmm0xmy"; - }; - openjdk = stdenv.mkDerivation rec { - name = "openjdk-7u${update}b${build}"; - - srcs = [ jdk7 langtools hotspot corba jdk jaxws jaxp ]; - sourceRoot = "."; - - outputs = [ "out" "jre" ]; - - buildInputs = - [ unzip procps ant which zip cpio nettools alsaLib - xorg.libX11 xorg.libXt xorg.libXext xorg.libXrender xorg.libXtst - xorg.libXi xorg.libXinerama xorg.libXcursor xorg.lndir - fontconfig perl file bootjdk - ]; - - NIX_CFLAGS_COMPILE = [ - "-Wno-error=deprecated-declarations" - "-Wno-error=format-overflow" # newly detected by gcc7 - ]; - - NIX_LDFLAGS = if minimal then null else "-lfontconfig -lXcursor -lXinerama"; - - postUnpack = '' - ls | grep jdk | grep -v '^jdk7u' | awk -F- '{print $1}' | while read p; do - mv $p-* $(ls | grep '^jdk7u')/$p - done - cd jdk7u-* - - sed -i -e "s@/usr/bin/test@${coreutils}/bin/test@" \ - -e "s@/bin/ls@${coreutils}/bin/ls@" \ - hotspot/make/linux/makefiles/sa.make - - sed -i "s@/bin/echo -e@${coreutils}/bin/echo -e@" \ - {jdk,corba}/make/common/shared/Defs-utils.gmk - - tar xf ${cups.src} - cupsDir=$(echo $(pwd)/cups-*) - makeFlagsArray+=(CUPS_HEADERS_PATH=$cupsDir) - ''; - - patches = [ - ./cppflags-include-fix.patch - ./fix-java-home.patch - ./paxctl.patch - ./read-truststore-from-env.patch - ./currency-date-range.patch - ]; - - NIX_NO_SELF_RPATH = true; - - makeFlags = [ - "SORT=${coreutils}/bin/sort" - "ALSA_INCLUDE=${alsaLib.dev}/include/alsa/version.h" - "FREETYPE_HEADERS_PATH=${freetype.dev}/include" - "FREETYPE_LIB_PATH=${freetype.out}/lib" - "MILESTONE=${update}" - "BUILD_NUMBER=b${build}" - "USRBIN_PATH=" - "COMPILER_PATH=" - "DEVTOOLS_PATH=" - "UNIXCOMMAND_PATH=" - "BOOTDIR=${bootjdk.home}" - "STATIC_CXX=false" - "UNLIMITED_CRYPTO=1" - "FULL_DEBUG_SYMBOLS=0" - ] ++ stdenv.lib.optional minimal "BUILD_HEADLESS=1"; - - configurePhase = "true"; - - preBuild = '' - # We also need to PaX-mark in the middle of the build - substituteInPlace hotspot/make/linux/makefiles/launcher.make \ - --replace XXX_PAXFLAGS_XXX ${paxflags} - substituteInPlace jdk/make/common/Program.gmk \ - --replace XXX_PAXFLAGS_XXX ${paxflags} - ''; - - installPhase = '' - mkdir -p $out/lib/openjdk $out/share $jre/lib/openjdk - - cp -av build/*/j2sdk-image/* $out/lib/openjdk - - # Move some stuff to top-level. - mv $out/lib/openjdk/include $out/include - mv $out/lib/openjdk/man $out/share/man - - # jni.h expects jni_md.h to be in the header search path. - ln -s $out/include/linux/*_md.h $out/include/ - - # Remove some broken manpages. - rm -rf $out/share/man/ja* - - # Remove crap from the installation. - rm -rf $out/lib/openjdk/demo $out/lib/openjdk/sample - - # Move the JRE to a separate output. - mv $out/lib/openjdk/jre $jre/lib/openjdk/ - mkdir $out/lib/openjdk/jre - lndir $jre/lib/openjdk/jre $out/lib/openjdk/jre - - rm -rf $out/lib/openjdk/jre/bin - ln -s $out/lib/openjdk/bin $out/lib/openjdk/jre/bin - - # Set PaX markings - exes=$(file $out/lib/openjdk/bin/* $jre/lib/openjdk/jre/bin/* 2> /dev/null | grep -E 'ELF.*(executable|shared object)' | sed -e 's/: .*$//') - echo "to mark: *$exes*" - for file in $exes; do - echo "marking *$file*" - paxmark ${paxflags} "$file" - done - - # Remove duplicate binaries. - for i in $(cd $out/lib/openjdk/bin && echo *); do - if [ "$i" = java ]; then continue; fi - if cmp -s $out/lib/openjdk/bin/$i $jre/lib/openjdk/jre/bin/$i; then - ln -sfn $jre/lib/openjdk/jre/bin/$i $out/lib/openjdk/bin/$i - fi - done - - # Generate certificates. - pushd $jre/lib/openjdk/jre/lib/security - rm cacerts - perl ${./generate-cacerts.pl} $jre/lib/openjdk/jre/bin/keytool ${cacert}/etc/ssl/certs/ca-bundle.crt - popd - - ln -s $out/lib/openjdk/bin $out/bin - ln -s $jre/lib/openjdk/jre/bin $jre/bin - ''; # */ - - # FIXME: this is unnecessary once the multiple-outputs branch is merged. - preFixup = '' - prefix=$jre stripDirs "$stripDebugList" "''${stripDebugFlags:--S}" - patchELF $jre - propagatedBuildInputs+=" $jre" - - # Propagate the setJavaClassPath setup hook from the JRE so that - # any package that depends on the JRE has $CLASSPATH set up - # properly. - mkdir -p $jre/nix-support - printWords ${setJavaClassPath} > $jre/nix-support/propagated-build-inputs - - # Set JAVA_HOME automatically. - mkdir -p $out/nix-support - cat <<EOF > $out/nix-support/setup-hook - if [ -z "\$JAVA_HOME" ]; then export JAVA_HOME=$out/lib/openjdk; fi - EOF - ''; - - postFixup = '' - # Build the set of output library directories to rpath against - LIBDIRS="" - for output in $outputs; do - LIBDIRS="$(find $(eval echo \$$output) -name \*.so\* -exec dirname {} \; | sort | uniq | tr '\n' ':'):$LIBDIRS" - done - - # Add the local library paths to remove dependencies on the bootstrap - for output in $outputs; do - OUTPUTDIR="$(eval echo \$$output)" - BINLIBS="$(find $OUTPUTDIR/bin/ -type f; find $OUTPUTDIR -name \*.so\*)" - echo "$BINLIBS" | while read i; do - patchelf --set-rpath "$LIBDIRS:$(patchelf --print-rpath "$i")" "$i" || true - patchelf --shrink-rpath "$i" || true - done - done - - # Test to make sure that we don't depend on the bootstrap - for output in $outputs; do - if grep -q -r '${bootjdk}' $(eval echo \$$output); then - echo "Extraneous references to ${bootjdk} detected" - exit 1 - fi - done - ''; - - meta = { - homepage = http://openjdk.java.net/; - license = stdenv.lib.licenses.gpl2; - description = "The open-source Java Development Kit"; - maintainers = [ stdenv.lib.maintainers.eelco ]; - platforms = stdenv.lib.platforms.linux; - }; - - passthru = { - inherit architecture; - home = "${openjdk}/lib/openjdk"; - }; - }; -in openjdk diff --git a/pkgs/development/compilers/openjdk/8.nix b/pkgs/development/compilers/openjdk/8.nix index 24cf1b8a0c93..705898a74f37 100644 --- a/pkgs/development/compilers/openjdk/8.nix +++ b/pkgs/development/compilers/openjdk/8.nix @@ -93,7 +93,7 @@ let ./004_add-fontconfig.patch ./005_enable-infinality.patch ] ++ lib.optionals (!minimal && enableGnome2) [ - ./swing-use-gtk.patch + ./swing-use-gtk-jdk8.patch ]; preConfigure = '' diff --git a/pkgs/development/compilers/openjdk/9.nix b/pkgs/development/compilers/openjdk/9.nix deleted file mode 100644 index 7ac3931c93d7..000000000000 --- a/pkgs/development/compilers/openjdk/9.nix +++ /dev/null @@ -1,262 +0,0 @@ -{ stdenv, lib, fetchurl, bash, cpio, pkgconfig, file, which, unzip, zip, cups, freetype -, alsaLib, bootjdk, cacert, perl, liberation_ttf, fontconfig, zlib, lndir -, libX11, libICE, libXrender, libXext, libXt, libXtst, libXi, libXinerama, libXcursor -, libjpeg, giflib -, setJavaClassPath -, minimal ? false -#, enableInfinality ? true # font rendering patch -, enableGnome2 ? true, gtk2, gnome_vfs, glib, GConf -}: - -let - - /** - * The JRE libraries are in directories that depend on the CPU. - */ - architecture = - if stdenv.system == "i686-linux" then - "i386" - else if stdenv.system == "x86_64-linux" then - "amd64" - else - throw "openjdk requires i686-linux or x86_64 linux"; - - update = "9.0.4"; - build = "12"; - baseurl = "http://hg.openjdk.java.net/jdk-updates/jdk9u"; - repover = "jdk-${update}+${build}"; - paxflags = if stdenv.isi686 then "msp" else "m"; - jdk9 = fetchurl { - url = "${baseurl}/archive/${repover}.tar.gz"; - sha256 = "06hnrzkwxgrfq26il1mjyl6wgb7x3qym69pjbddhl9m29n2si3jh"; - }; - langtools = fetchurl { - url = "${baseurl}/langtools/archive/${repover}.tar.gz"; - sha256 = "16xqnqn773p6ywcdjx801vbng2skjal7svydn0s7wf3ldqzx64mi"; - }; - hotspot = fetchurl { - url = "${baseurl}/hotspot/archive/${repover}.tar.gz"; - sha256 = "0g5ddffl2qykrjf17ac9as60rd4sfyv7s2fpgjn86k4a69gkx93v"; - }; - corba = fetchurl { - url = "${baseurl}/corba/archive/${repover}.tar.gz"; - sha256 = "14585dzs2mfzgzrnbvc062pigngs35hajwpr22m6fzbm7580vnqk"; - }; - jdk = fetchurl { - url = "${baseurl}/jdk/archive/${repover}.tar.gz"; - sha256 = "16595jdg3y9zy70q8i615a7d6w0zzbydfxylvaq42wrsc7jw733h"; - }; - jaxws = fetchurl { - url = "${baseurl}/jaxws/archive/${repover}.tar.gz"; - sha256 = "1m1aspc1hq74w0bkasrfvp8ygs6psbc1l61vfw9244j2vgfahjgn"; - }; - jaxp = fetchurl { - url = "${baseurl}/jaxp/archive/${repover}.tar.gz"; - sha256 = "06ns2giw366vjivb6d46gqwfvfzkaddrgd1x6y8w37ywygp50lxm"; - }; - nashorn = fetchurl { - url = "${baseurl}/nashorn/archive/${repover}.tar.gz"; - sha256 = "0z6mlzvz1hh1yzli69qjlrcwqdjnivbjbqqrqi4hhpls6z0a2ch7"; - }; - openjdk9 = stdenv.mkDerivation { - name = "openjdk-${update}-b${build}"; - - srcs = [ jdk9 langtools hotspot corba jdk jaxws jaxp nashorn ]; - sourceRoot = "."; - - outputs = [ "out" "jre" ]; - - nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ - cpio file which unzip zip perl bootjdk zlib cups freetype alsaLib - libjpeg giflib libX11 libICE libXext libXrender libXtst libXt libXtst - libXi libXinerama libXcursor lndir fontconfig - ] ++ lib.optionals (!minimal && enableGnome2) [ - gtk2 gnome_vfs GConf glib - ]; - - #move the seven other source dirs under the main jdk8u directory, - #with version suffixes removed, as the remainder of the build will expect - prePatch = '' - mainDir=$(find . -maxdepth 1 -name jdk9\*); - find . -maxdepth 1 -name \*jdk\* -not -name jdk9\* | awk -F- '{print $1}' | while read p; do - mv $p-* $mainDir/$p - done - cd $mainDir - ''; - - patches = [ - ./fix-java-home-jdk9.patch - ./read-truststore-from-env-jdk9.patch - ./currency-date-range-jdk8.patch - #] ++ lib.optionals (!minimal && enableInfinality) [ - # ./004_add-fontconfig.patch - # ./005_enable-infinality.patch - ] ++ lib.optionals (!minimal && enableGnome2) [ - ./swing-use-gtk-jdk9.patch - ]; - - preConfigure = '' - chmod +x configure - substituteInPlace configure --replace /bin/bash "${bash}/bin/bash" - - configureFlagsArray=( - "--with-boot-jdk=${bootjdk.home}" - "--with-update-version=${update}" - "--with-build-number=${build}" - "--with-milestone=fcs" - "--enable-unlimited-crypto" - "--disable-debug-symbols" - "--disable-freetype-bundling" - "--with-zlib=system" - "--with-giflib=system" - "--with-stdc++lib=dynamic" - - # glibc 2.24 deprecated readdir_r so we need this - # See https://www.mail-archive.com/openembedded-devel@lists.openembedded.org/msg49006.html - "--with-extra-cflags=-Wno-error=deprecated-declarations -Wno-error=format-contains-nul -Wno-error=unused-result" - '' - + lib.optionalString minimal "\"--enable-headless-only\"" - + ");" - # https://bugzilla.redhat.com/show_bug.cgi?id=1306558 - # https://github.com/JetBrains/jdk8u/commit/eaa5e0711a43d64874111254d74893fa299d5716 - + stdenv.lib.optionalString stdenv.cc.isGNU '' - NIX_CFLAGS_COMPILE+=" -fno-lifetime-dse -fno-delete-null-pointer-checks -std=gnu++98 -Wno-error" - ''; - - NIX_LDFLAGS= lib.optionals (!minimal) [ - "-lfontconfig" "-lcups" "-lXinerama" "-lXrandr" "-lmagic" - ] ++ lib.optionals (!minimal && enableGnome2) [ - "-lgtk-x11-2.0" "-lgio-2.0" "-lgnomevfs-2" "-lgconf-2" - ]; - - buildFlags = [ "all" ]; - - installPhase = '' - mkdir -p $out/lib/openjdk $out/share $jre/lib/openjdk - - cp -av build/*/images/jdk/* $out/lib/openjdk - - # Remove some broken manpages. - rm -rf $out/lib/openjdk/man/ja* - - # Mirror some stuff in top-level. - mkdir $out/include $out/share/man - ln -s $out/lib/openjdk/include/* $out/include/ - ln -s $out/lib/openjdk/man/* $out/share/man/ - - # jni.h expects jni_md.h to be in the header search path. - ln -s $out/include/linux/*_md.h $out/include/ - - # Copy the JRE to a separate output and setup fallback fonts - cp -av build/*/images/jre $jre/lib/openjdk/ - mkdir $out/lib/openjdk/jre - ${lib.optionalString (!minimal) '' - mkdir -p $jre/lib/openjdk/jre/lib/fonts/fallback - lndir ${liberation_ttf}/share/fonts/truetype $jre/lib/openjdk/jre/lib/fonts/fallback - ''} - - # Remove crap from the installation. - rm -rf $out/lib/openjdk/demo - ${lib.optionalString minimal '' - for d in $out/lib/openjdk/lib $jre/lib/openjdk/jre/lib; do - rm ''${d}/{libjsound,libjsoundalsa,libawt*,libfontmanager}.so - done - ''} - - lndir $jre/lib/openjdk/jre $out/lib/openjdk/jre - - # Make sure cmm/*.pf are not symlinks: - # https://youtrack.jetbrains.com/issue/IDEA-147272 - # in 9, it seems no *.pf files end up in $out ... ? - # rm -rf $out/lib/openjdk/jre/lib/cmm - # ln -s {$jre,$out}/lib/openjdk/jre/lib/cmm - - # Set PaX markings - exes=$(file $out/lib/openjdk/bin/* $jre/lib/openjdk/jre/bin/* 2> /dev/null | grep -E 'ELF.*(executable|shared object)' | sed -e 's/: .*$//') - echo "to mark: *$exes*" - for file in $exes; do - echo "marking *$file*" - paxmark ${paxflags} "$file" - done - - # Remove duplicate binaries. - for i in $(cd $out/lib/openjdk/bin && echo *); do - if [ "$i" = java ]; then continue; fi - if cmp -s $out/lib/openjdk/bin/$i $jre/lib/openjdk/jre/bin/$i; then - ln -sfn $jre/lib/openjdk/jre/bin/$i $out/lib/openjdk/bin/$i - fi - done - - # Generate certificates. - ( - cd $jre/lib/openjdk/jre/lib/security - rm cacerts - perl ${./generate-cacerts.pl} $jre/lib/openjdk/jre/bin/keytool ${cacert}/etc/ssl/certs/ca-bundle.crt - ) - - ln -s $out/lib/openjdk/bin $out/bin - ln -s $jre/lib/openjdk/jre/bin $jre/bin - ln -s $jre/lib/openjdk/jre $out/jre - ''; - - # FIXME: this is unnecessary once the multiple-outputs branch is merged. - preFixup = '' - prefix=$jre stripDirs "$stripDebugList" "''${stripDebugFlags:--S}" - patchELF $jre - propagatedBuildInputs+=" $jre" - - # Propagate the setJavaClassPath setup hook from the JRE so that - # any package that depends on the JRE has $CLASSPATH set up - # properly. - mkdir -p $jre/nix-support - #TODO or printWords? cf https://github.com/NixOS/nixpkgs/pull/27427#issuecomment-317293040 - echo -n "${setJavaClassPath}" > $jre/nix-support/propagated-build-inputs - - # Set JAVA_HOME automatically. - mkdir -p $out/nix-support - cat <<EOF > $out/nix-support/setup-hook - if [ -z "\$JAVA_HOME" ]; then export JAVA_HOME=$out/lib/openjdk; fi - EOF - ''; - - postFixup = '' - # Build the set of output library directories to rpath against - LIBDIRS="" - for output in $outputs; do - LIBDIRS="$(find $(eval echo \$$output) -name \*.so\* -exec dirname {} \+ | sort | uniq | tr '\n' ':'):$LIBDIRS" - done - - # Add the local library paths to remove dependencies on the bootstrap - for output in $outputs; do - OUTPUTDIR=$(eval echo \$$output) - BINLIBS=$(find $OUTPUTDIR/bin/ -type f; find $OUTPUTDIR -name \*.so\*) - echo "$BINLIBS" | while read i; do - patchelf --set-rpath "$LIBDIRS:$(patchelf --print-rpath "$i")" "$i" || true - patchelf --shrink-rpath "$i" || true - done - done - - # Test to make sure that we don't depend on the bootstrap - for output in $outputs; do - if grep -q -r '${bootjdk}' $(eval echo \$$output); then - echo "Extraneous references to ${bootjdk} detected" - exit 1 - fi - done - ''; - - meta = with stdenv.lib; { - homepage = http://openjdk.java.net/; - license = licenses.gpl2; - description = "The open-source Java Development Kit"; - maintainers = with maintainers; [ edwtjo ]; - platforms = platforms.linux; - }; - - passthru = { - inherit architecture; - home = "${openjdk9}/lib/openjdk"; - }; - }; -in openjdk9 diff --git a/pkgs/development/compilers/openjdk/bootstrap.nix b/pkgs/development/compilers/openjdk/bootstrap.nix index 668ca552adf1..3c29df7ec78e 100644 --- a/pkgs/development/compilers/openjdk/bootstrap.nix +++ b/pkgs/development/compilers/openjdk/bootstrap.nix @@ -1,5 +1,5 @@ { stdenv -, runCommand, fetchurl, file +, runCommand, fetchurl, file, zlib , version }: @@ -7,30 +7,19 @@ assert stdenv.hostPlatform.libc == "glibc"; let - # !!! These should be on nixos.org + fetchboot = version: arch: sha256: fetchurl { + name = "openjdk${version}-bootstrap-${arch}-linux.tar.xz"; + url = "http://tarballs.nixos.org/openjdk/2018-03-31/${version}/${arch}-linux.tar.xz"; + inherit sha256; + }; + src = if stdenv.hostPlatform.system == "x86_64-linux" then - (if version == "8" then - fetchurl { - url = "https://www.dropbox.com/s/a0lsq2ig4uguky5/openjdk8-bootstrap-x86_64-linux.tar.xz?dl=1"; - sha256 = "18zqx6jhm3lizn9hh6ryyqc9dz3i96pwaz8f6nxfllk70qi5gvks"; - } - else if version == "7" then - fetchurl { - url = "https://www.dropbox.com/s/rssfbeommrfbsjf/openjdk7-bootstrap-x86_64-linux.tar.xz?dl=1"; - sha256 = "024gg2sgg4labxbc1nhn8lxls2p7d9h3b82hnsahwaja2pm1hbra"; - } + (if version == "10" then fetchboot "10" "x86_64" "08085fsxc1qhqiv3yi38w8lrg3vm7s0m2yvnwr1c92v019806yq2" + else if version == "8" then fetchboot "8" "x86_64" "18zqx6jhm3lizn9hh6ryyqc9dz3i96pwaz8f6nxfllk70qi5gvks" else throw "No bootstrap for version") else if stdenv.hostPlatform.system == "i686-linux" then - (if version == "8" then - fetchurl { - url = "https://www.dropbox.com/s/rneqjhlerijsw74/openjdk8-bootstrap-i686-linux.tar.xz?dl=1"; - sha256 = "1yx04xh8bqz7amg12d13rw5vwa008rav59mxjw1b9s6ynkvfgqq9"; - } - else if version == "7" then - fetchurl { - url = "https://www.dropbox.com/s/6xe64td7eg2wurs/openjdk7-bootstrap-i686-linux.tar.xz?dl=1"; - sha256 = "0xwqjk1zx8akziw8q9sbjc1rs8s7c0w6mw67jdmmi26cwwp8ijnx"; - } + (if version == "10" then fetchboot "10" "i686" "1blb9gyzp8gfyggxvggqgpcgfcyi00ndnnskipwgdm031qva94p7" + else if version == "8" then fetchboot "8" "i686" "1yx04xh8bqz7amg12d13rw5vwa008rav59mxjw1b9s6ynkvfgqq9" else throw "No bootstrap for version") else throw "No bootstrap for system"; @@ -45,7 +34,7 @@ let find "$out" -type f -print0 | while IFS= read -r -d "" elf; do isELF "$elf" || continue patchelf --set-interpreter $(cat "${stdenv.cc}/nix-support/dynamic-linker") "$elf" || true - patchelf --set-rpath "${stdenv.cc.libc}/lib:${stdenv.cc.cc.lib}/lib:$LIBDIRS" "$elf" || true + patchelf --set-rpath "${stdenv.cc.libc}/lib:${stdenv.cc.cc.lib}/lib:${zlib}/lib:$LIBDIRS" "$elf" || true done # Temporarily, while NixOS's OpenJDK bootstrap tarball doesn't have PaX markings: diff --git a/pkgs/development/compilers/openjdk/cppflags-include-fix.patch b/pkgs/development/compilers/openjdk/cppflags-include-fix.patch deleted file mode 100644 index 8931c122538f..000000000000 --- a/pkgs/development/compilers/openjdk/cppflags-include-fix.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff -Naur openjdk-orig/jdk/make/sun/awt/mawt.gmk openjdk/jdk/make/sun/awt/mawt.gmk ---- openjdk-orig/jdk/make/sun/awt/mawt.gmk 2012-08-28 19:13:16.000000000 -0400 -+++ openjdk/jdk/make/sun/awt/mawt.gmk 2013-01-22 11:56:22.315418708 -0500 -@@ -234,12 +234,6 @@ - endif # !HEADLESS - endif # PLATFORM - --ifeq ($(PLATFORM), linux) -- # Checking for the X11/extensions headers at the additional location -- CPPFLAGS += -I$(firstword $(wildcard $(OPENWIN_HOME)/include/X11/extensions) \ -- $(wildcard /usr/include/X11/extensions)) --endif -- - ifeq ($(PLATFORM), macosx)) - CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions \ - -I$(OPENWIN_HOME)/include diff --git a/pkgs/development/compilers/openjdk/currency-date-range.patch b/pkgs/development/compilers/openjdk/currency-date-range.patch deleted file mode 100644 index b1c461591d1e..000000000000 --- a/pkgs/development/compilers/openjdk/currency-date-range.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -Naur openjdk-7u65-b32-upstream/jdk/make/tools/src/build/tools/generatecurrencydata/GenerateCurrencyData.java openjdk-7u65-b32/jdk/make/tools/src/build/tools/generatecurrencydata/GenerateCurrencyData.java ---- openjdk-7u65-b32-upstream/jdk/make/tools/src/build/tools/generatecurrencydata/GenerateCurrencyData.java 2014-07-17 05:42:14.000000000 -0430 -+++ openjdk-7u65-b32/jdk/make/tools/src/build/tools/generatecurrencydata/GenerateCurrencyData.java 2014-12-30 10:15:50.327905933 -0430 -@@ -281,8 +281,8 @@ - checkCurrencyCode(newCurrency); - String timeString = currencyInfo.substring(4, length - 4); - long time = format.parse(timeString).getTime(); -- if (Math.abs(time - System.currentTimeMillis()) > ((long) 10) * 365 * 24 * 60 * 60 * 1000) { -- throw new RuntimeException("time is more than 10 years from present: " + time); -+ if (Math.abs(time - System.currentTimeMillis()) > ((long) 20) * 365 * 24 * 60 * 60 * 1000) { -+ throw new RuntimeException("time is more than 20 years from present: " + time); - } - specialCaseCutOverTimes[specialCaseCount] = time; - specialCaseOldCurrencies[specialCaseCount] = oldCurrency; diff --git a/pkgs/development/compilers/openjdk/fix-java-home-jdk9.patch b/pkgs/development/compilers/openjdk/fix-java-home-jdk9.patch deleted file mode 100644 index f9755d58e48f..000000000000 --- a/pkgs/development/compilers/openjdk/fix-java-home-jdk9.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/hotspot/src/os/linux/vm/os_linux.cpp 2017-07-04 23:09:02.533972226 -0400 -+++ b/hotspot/src/os/linux/vm/os_linux.cpp 2017-07-04 23:07:52.118338845 -0400 -@@ -2318,10 +2318,7 @@ - assert(ret, "cannot locate libjvm"); - char *rp = NULL; - if (ret && dli_fname[0] != '\0') { -- rp = realpath(dli_fname, buf); -- } -- if (rp == NULL) { -- return; -+ snprintf(buf, buflen, "%s", dli_fname); - } - - if (Arguments::sun_java_launcher_is_altjvm()) { diff --git a/pkgs/development/compilers/openjdk/fix-java-home.patch b/pkgs/development/compilers/openjdk/fix-java-home.patch deleted file mode 100644 index 5def344f1717..000000000000 --- a/pkgs/development/compilers/openjdk/fix-java-home.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff -ru -x '*~' openjdk-orig/hotspot/src/os/linux/vm/os_linux.cpp openjdk/hotspot/src/os/linux/vm/os_linux.cpp ---- openjdk-orig/hotspot/src/os/linux/vm/os_linux.cpp 2013-09-06 20:22:03.000000000 +0200 -+++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp 2014-01-24 22:44:08.223857012 +0100 -@@ -2358,12 +2358,10 @@ - CAST_FROM_FN_PTR(address, os::jvm_path), - dli_fname, sizeof(dli_fname), NULL); - assert(ret, "cannot locate libjvm"); - char *rp = NULL; - if (ret && dli_fname[0] != '\0') { -- rp = realpath(dli_fname, buf); -+ snprintf(buf, buflen, "%s", dli_fname); - } -- if (rp == NULL) -- return; - - if (Arguments::created_by_gamma_launcher()) { - // Support for the gamma launcher. Typical value for buf is diff --git a/pkgs/development/compilers/openjdk/paxctl.patch b/pkgs/development/compilers/openjdk/paxctl.patch deleted file mode 100644 index 12528a601cc8..000000000000 --- a/pkgs/development/compilers/openjdk/paxctl.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/hotspot/make/linux/makefiles/launcher.make b/hotspot/make/linux/makefiles/launcher.make -index 34bbcd6..41b9332 100644 ---- a/hotspot/make/linux/makefiles/launcher.make -+++ b/hotspot/make/linux/makefiles/launcher.make -@@ -83,6 +83,8 @@ $(LAUNCHER): $(OBJS) $(LIBJVM) $(LAUNCHER_MAPFILE) - $(QUIETLY) echo Linking launcher... - $(QUIETLY) $(LINK_LAUNCHER/PRE_HOOK) - $(QUIETLY) $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(OBJS) $(LIBS_LAUNCHER) -+ paxctl -c $(LAUNCHER) -+ paxctl -zex -XXX_PAXFLAGS_XXX $(LAUNCHER) - $(QUIETLY) $(LINK_LAUNCHER/POST_HOOK) - - $(LAUNCHER): $(LAUNCHER_SCRIPT) -diff --git a/jdk/make/common/Program.gmk b/jdk/make/common/Program.gmk -index 091800d..1de8cb4 100644 ---- a/jdk/make/common/Program.gmk -+++ b/jdk/make/common/Program.gmk -@@ -60,6 +60,10 @@ ACTUAL_PROGRAM = $(ACTUAL_PROGRAM_DIR)/$(ACTUAL_PROGRAM_NAME) - program_default_rule: all - - program: $(ACTUAL_PROGRAM) -+ if [[ "$(PROGRAM)" = "java" ]]; then \ -+ paxctl -c $(ACTUAL_PROGRAM); \ -+ paxctl -zex -XXX_PAXFLAGS_XXX $(ACTUAL_PROGRAM); \ -+ fi - - # Work-around for missing processor specific mapfiles - ifndef CROSS_COMPILE_ARCH diff --git a/pkgs/development/compilers/openjdk/read-truststore-from-env-jdk9.patch b/pkgs/development/compilers/openjdk/read-truststore-from-env-jdk9.patch deleted file mode 100644 index cb8d59ff8063..000000000000 --- a/pkgs/development/compilers/openjdk/read-truststore-from-env-jdk9.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/jdk/src/java.base/share/classes/sun/security/ssl/TrustStoreManager.java 2017-06-26 21:48:25.000000000 -0400 -+++ b/jdk/src/java.base/share/classes/sun/security/ssl/TrustStoreManager.java.new 2017-07-05 20:45:57.491295030 -0400 -@@ -71,6 +71,7 @@ - * - * The preference of the default trusted KeyStore is: - * javax.net.ssl.trustStore -+ * system environment variable JAVAX_NET_SSL_TRUSTSTORE - * jssecacerts - * cacerts - */ -@@ -144,6 +145,9 @@ - String temporaryName = ""; - File temporaryFile = null; - long temporaryTime = 0L; -+ if (storePropName == null){ -+ storePropName = System.getenv("JAVAX_NET_SSL_TRUSTSTORE"); -+ } - if (!"NONE".equals(storePropName)) { - String[] fileNames = - new String[] {storePropName, defaultStore}; diff --git a/pkgs/development/compilers/openjdk/read-truststore-from-env.patch b/pkgs/development/compilers/openjdk/read-truststore-from-env.patch deleted file mode 100644 index 8fb0f409d0ab..000000000000 --- a/pkgs/development/compilers/openjdk/read-truststore-from-env.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -ur openjdk-7u65-b32/jdk/src/share/classes/sun/security/ssl/TrustManagerFactoryImpl.java openjdk-7u65-b32.new/jdk/src/share/classes/sun/security/ssl/TrustManagerFactoryImpl.java ---- openjdk-7u65-b32/jdk/src/share/classes/sun/security/ssl/TrustManagerFactoryImpl.java 2014-07-17 12:12:14.000000000 +0200 -+++ openjdk-7u65-b32.new/jdk/src/share/classes/sun/security/ssl/TrustManagerFactoryImpl.java 2014-12-09 13:31:27.821960372 +0100 -@@ -158,6 +158,7 @@ - /* - * Try: - * javax.net.ssl.trustStore (if this variable exists, stop) -+ * system environment variable JAVAX_NET_SSL_TRUSTSTORE - * jssecacerts - * cacerts - * -@@ -165,6 +166,9 @@ - */ - - storeFileName = props.get("trustStore"); -+ if (storeFileName == null) { -+ storeFileName = System.getenv("JAVAX_NET_SSL_TRUSTSTORE"); -+ } - if (!"NONE".equals(storeFileName)) { - if (storeFileName != null) { - storeFile = new File(storeFileName); diff --git a/pkgs/development/compilers/openjdk/swing-use-gtk.patch b/pkgs/development/compilers/openjdk/swing-use-gtk-jdk8.patch index 9538aade6726..9538aade6726 100644 --- a/pkgs/development/compilers/openjdk/swing-use-gtk.patch +++ b/pkgs/development/compilers/openjdk/swing-use-gtk-jdk8.patch diff --git a/pkgs/development/compilers/openjdk/swing-use-gtk-jdk9.patch b/pkgs/development/compilers/openjdk/swing-use-gtk-jdk9.patch deleted file mode 100644 index 07d95ba71b8a..000000000000 --- a/pkgs/development/compilers/openjdk/swing-use-gtk-jdk9.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff -ru3 a/jdk/src/share/classes/javax/swing/UIManager.java b/jdk/src/share/classes/javax/swing/UIManager.java ---- a/jdk/src/java.desktop/share/classes/javax/swing/UIManager.java 2016-07-26 00:41:37.000000000 +0300 -+++ b/jdk/src/java.desktop/share/classes/javax/swing/UIManager.java 2016-10-02 22:46:01.890071761 +0300 -@@ -607,11 +607,9 @@ - if (osType == OSInfo.OSType.WINDOWS) { - return "com.sun.java.swing.plaf.windows.WindowsLookAndFeel"; - } else { -- String desktop = AccessController.doPrivileged(new GetPropertyAction("sun.desktop")); - Toolkit toolkit = Toolkit.getDefaultToolkit(); -- if ("gnome".equals(desktop) && -- toolkit instanceof SunToolkit && -- ((SunToolkit) toolkit).isNativeGTKAvailable()) { -+ if (toolkit instanceof SunToolkit && -+ ((SunToolkit) toolkit).isNativeGTKAvailable()) { - // May be set on Linux and Solaris boxs. - return "com.sun.java.swing.plaf.gtk.GTKLookAndFeel"; - } -@@ -1341,7 +1339,7 @@ - lafName = (String) lafData.remove("defaultlaf"); - } - if (lafName == null) { -- lafName = getCrossPlatformLookAndFeelClassName(); -+ lafName = getSystemLookAndFeelClassName(); - } - lafName = swingProps.getProperty(defaultLAFKey, lafName); - |