@@ -1,4 +1,4 @@
1−{ stdenv, fetchurl, cpio, file, which, unzip, zip, xorg, cups, freetype, alsaLib, openjdk, cacert, perl } :
1+{ stdenv, fetchurl, cpio, file, which, unzip, zip, xorg, cups, freetype, alsaLib, openjdk, cacert, perl, liberation_ttf, fontconfig } :
22let
33 update = "40";
44 build = "25";
@@ -39,12 +39,12 @@ let
3939 };
4040 openjdk8 = stdenv.mkDerivation {
4141 name = "openjdk-8u${update}b${build}";
42− srcs = [jdk8 langtools hotspot corba jdk jaxws jaxp nashorn];
42+ srcs = [ jdk8 langtools hotspot corba jdk jaxws jaxp nashorn ];
4343 outputs = [ "out" "jre" ];
4444 buildInputs = [ cpio file which unzip zip
4545 xorg.libX11 xorg.libXt xorg.libXext xorg.libXrender xorg.libXtst
4646 xorg.libXi xorg.libXinerama xorg.libXcursor xorg.lndir
47− cups freetype alsaLib openjdk perl ];
47+ cups freetype alsaLib openjdk perl liberation_ttf fontconfig ];
4848 setSourceRoot = ''
4949 sourceRoot="jdk8u${update}-jdk8u${update}-b${build}";
5050 '';
@@ -77,18 +77,19 @@ let
7777 "--with-build-number=b${build}"
7878 "--with-milestone=fcs"
7979 ];
80+ NIX_LDFLAGS= "-lfontconfig";
8081 buildFlags = "DEBUG_BINARIES=true all";
8182 installPhase = ''
8283 mkdir -p $out/lib/openjdk $out/share $jre/lib/openjdk
8384
84− cp -av build/*/images/j2sdk-image/* $out/lib/openjdk
85+ cp -av build"/"*/images/j2sdk-image"/"* $out/lib/openjdk
8586
8687 # Move some stuff to top-level.
8788 mv $out/lib/openjdk/include $out/include
8889 mv $out/lib/openjdk/man $out/share/man
8990
9091 # jni.h expects jni_md.h to be in the header search path.
91− ln -s $out/include/linux/*_md.h $out/include/
92+ ln -s $out/include/linux"/"*_md.h $out/include/
9293
9394 # Remove some broken manpages.
9495 rm -rf $out/share/man/ja*
@@ -96,16 +97,18 @@ let
9697 # Remove crap from the installation.
9798 rm -rf $out/lib/openjdk/demo $out/lib/openjdk/sample
9899
99− # Move the JRE to a separate output.
100+ # Move the JRE to a separate output and setup fallback fonts
100101 mv $out/lib/openjdk/jre $jre/lib/openjdk/
101102 mkdir $out/lib/openjdk/jre
103+ mkdir -p $jre/lib/openjdk/jre/lib/fonts/fallback
104+ lndir ${liberation_ttf}/share/fonts/truetype $jre/lib/openjdk/jre/lib/fonts/fallback
102105 lndir $jre/lib/openjdk/jre $out/lib/openjdk/jre
103106
104107 rm -rf $out/lib/openjdk/jre/bina
105108 ln -s $out/lib/openjdk/bin $out/lib/openjdk/jre/bin
106109
107110 # Set PaX markings
108− exes=$(file $out/lib/openjdk/bin/* $jre/lib/openjdk/jre/bin/* 2> /dev/null | grep -E 'ELF.*(executable|shared object)' | sed -e 's/: .*$//')
111+ exes=$(file $out/lib/openjdk/bin"/"* $jre/lib/openjdk/jre/bin"/"* 2> /dev/null | grep -E 'ELF.*(executable|shared object)' | sed -e 's/: .*$//')
109112 echo "to mark: *$exes*"
110113 for file in $exes; do
111114 echo "marking *$file*"
@@ -128,15 +131,16 @@ let
128131
129132 ln -s $out/lib/openjdk/bin $out/bin
130133 ln -s $jre/lib/openjdk/jre/bin $jre/bin
134+
131135 '';
132136
133− meta = {
137+ meta = with stdenv.lib; {
134138 homepage = http://openjdk.java.net/;
135− license = stdenv.lib.licenses.gpl2;
139+ license = licenses.gpl2;
136140 description = "The open-source Java Development Kit";
137− maintainers = [ stdenv.lib.maintainers.cocreature ];
138− platforms = stdenv.lib.platforms.linux;
141+ maintainers = with maintainers; [ cocreature edwtjo ];
142+ platforms = platforms.linux;
139143 };
140−
144+
141145 passthru.home = "${openjdk8}/lib/openjdk";
142146}; in openjdk8