@@ -1,4 +1,4 @@
1−{ stdenv, lib, fetchurl, bash, cpio, pkgconfig, file, which, unzip, zip, cups, freetype
1+{ stdenv, lib, fetchurl, bash, cpio, autoconf, pkgconfig, file, which, unzip, zip, cups, freetype
22, alsaLib, bootjdk, perl, liberation_ttf, fontconfig, zlib, lndir
33, libX11, libICE, libXrender, libXext, libXt, libXtst, libXi, libXinerama, libXcursor, libXrandr
44, libjpeg, giflib
@@ -10,31 +10,30 @@
1010let
1111
1212 /**
13− * The JRE libraries are in directories that depend on the CPU.
13+ * The JDK libraries are in directories that depend on the CPU.
1414 */
1515 architecture =
1616 if stdenv.hostPlatform.system == "i686-linux" then
1717 "i386"
1818 else "amd64";
1919
20− update = "10.0.2";
20+ major = "11";
21+ update = ".0.1";
2122 build = "13";
22− repover = "jdk-${update}+${build}";
23+ repover = "jdk-${major}${update}+${build}";
2324 paxflags = if stdenv.isi686 then "msp" else "m";
2425
25− openjdk10 = stdenv.mkDerivation {
26− name = "openjdk-${update}-b${build}";
26+ openjdk = stdenv.mkDerivation {
27+ name = "openjdk-${major}${update}-b${build}";
2728
2829 src = fetchurl {
29− url = "http://hg.openjdk.java.net/jdk-updates/jdk10u/archive/${repover}.tar.gz";
30− sha256 = "0y7hyzgvn6z8gyp3h9xvxwj6zda899y6i629jn6yxqzj96q56jpk";
30+ url = "http://hg.openjdk.java.net/jdk-updates/jdk${major}u/archive/${repover}.tar.gz";
31+ sha256 = "1ri3fv67rvs9xxhc3ynklbprhxbdsgpwafbw6wqj950xy5crgysm";
3132 };
3233
33− outputs = [ "out" "jre" ];
34−
3534 nativeBuildInputs = [ pkgconfig ];
3635 buildInputs = [
37− cpio file which unzip zip perl bootjdk zlib cups freetype alsaLib
36+ autoconf cpio file which unzip zip perl bootjdk zlib cups freetype alsaLib
3837 libjpeg giflib libX11 libICE libXext libXrender libXtst libXt libXtst
3938 libXi libXinerama libXcursor libXrandr lndir fontconfig
4039 ] ++ lib.optionals (!minimal && enableGnome2) [
@@ -55,12 +54,11 @@ let
5554
5655 configureFlagsArray=(
5756 "--with-boot-jdk=${bootjdk.home}"
58− "--with-update-version=${update}"
57+ "--with-update-version=${major}${update}"
5958 "--with-build-number=${build}"
6059 "--with-milestone=fcs"
6160 "--enable-unlimited-crypto"
6261 "--disable-debug-symbols"
63− "--disable-freetype-bundling"
6462 "--with-zlib=system"
6563 "--with-giflib=system"
6664 "--with-stdc++lib=dynamic"
@@ -86,7 +84,7 @@ let
8684 buildFlags = [ "all" ];
8785
8886 installPhase = ''
89− mkdir -p $out/lib/openjdk $out/share $jre/lib/openjdk
87+ mkdir -p $out/lib/openjdk $out/share
9088
9189 cp -av build/*/images/jdk/* $out/lib/openjdk
9290
@@ -101,57 +99,29 @@ let
10199 # jni.h expects jni_md.h to be in the header search path.
102100 ln -s $out/include/linux/*_md.h $out/include/
103101
104− # Copy the JRE to a separate output and setup fallback fonts
105− cp -av build/*/images/jre $jre/lib/openjdk/
106− mkdir $out/lib/openjdk/jre
107− ${lib.optionalString (!minimal) ''
108− mkdir -p $jre/lib/openjdk/jre/lib/fonts/fallback
109− lndir ${liberation_ttf}/share/fonts/truetype $jre/lib/openjdk/jre/lib/fonts/fallback
110− ''}
111−
112102 # Remove crap from the installation.
113103 rm -rf $out/lib/openjdk/demo
114104 ${lib.optionalString minimal ''
115− for d in $out/lib/openjdk/lib $jre/lib/openjdk/jre/lib; do
116− rm ''${d}/{libjsound,libjsoundalsa,libfontmanager}.so
117− done
105+ rm $out/lib/openjdk/lib/{libjsound,libfontmanager}.so
118106 ''}
119107
120− lndir $jre/lib/openjdk/jre $out/lib/openjdk/jre
121−
122108 # Set PaX markings
123− exes=$(file $out/lib/openjdk/bin/* $jre/lib/openjdk/jre/bin/* 2> /dev/null | grep -E 'ELF.*(executable|shared object)' | sed -e 's/: .*$//')
109+ exes=$(file $out/lib/openjdk/bin/* 2> /dev/null | grep -E 'ELF.*(executable|shared object)' | sed -e 's/: .*$//')
124110 echo "to mark: *$exes*"
125111 for file in $exes; do
126112 echo "marking *$file*"
127113 paxmark ${paxflags} "$file"
128114 done
129115
130− # Remove duplicate binaries.
131− for i in $(cd $out/lib/openjdk/bin && echo *); do
132− if [ "$i" = java ]; then continue; fi
133− if cmp -s $out/lib/openjdk/bin/$i $jre/lib/openjdk/jre/bin/$i; then
134− ln -sfn $jre/lib/openjdk/jre/bin/$i $out/lib/openjdk/bin/$i
135− fi
136− done
137−
138116 ln -s $out/lib/openjdk/bin $out/bin
139− ln -s $jre/lib/openjdk/jre/bin $jre/bin
140− ln -s $jre/lib/openjdk/jre $out/jre
141117 '';
142118
143− # FIXME: this is unnecessary once the multiple-outputs branch is merged.
144119 preFixup = ''
145− prefix=$jre stripDirs "$STRIP" "$stripDebugList" "''${stripDebugFlags:--S}"
146− patchELF $jre
147− propagatedBuildInputs+=" $jre"
148−
149− # Propagate the setJavaClassPath setup hook from the JRE so that
150− # any package that depends on the JRE has $CLASSPATH set up
151− # properly.
152− mkdir -p $jre/nix-support
120+ # Propagate the setJavaClassPath setup hook so that any package
121+ # that depends on the JDK has $CLASSPATH set up properly.
122+ mkdir -p $out/nix-support
153123 #TODO or printWords? cf https://github.com/NixOS/nixpkgs/pull/27427#issuecomment-317293040
154− echo -n "${setJavaClassPath}" > $jre/nix-support/propagated-build-inputs
124+ echo -n "${setJavaClassPath}" > $out/nix-support/propagated-build-inputs
155125
156126 # Set JAVA_HOME automatically.
157127 mkdir -p $out/nix-support
@@ -196,7 +166,7 @@ let
196166
197167 passthru = {
198168 inherit architecture;
199− home = "${openjdk10}/lib/openjdk";
169+ home = "${openjdk}/lib/openjdk";
200170 };
201171 };
202−in openjdk10
172+in openjdk