2011-08-01 03:10:16 +02:00
|
|
|
{ stdenv
|
|
|
|
, fetchurl
|
|
|
|
, unzip
|
2011-08-01 03:10:28 +02:00
|
|
|
, zip
|
2011-08-01 03:10:16 +02:00
|
|
|
, procps
|
|
|
|
, coreutils
|
|
|
|
, alsaLib
|
|
|
|
, ant
|
2011-08-01 03:11:09 +02:00
|
|
|
, freetype
|
2011-08-01 03:11:40 +02:00
|
|
|
, cups
|
2011-08-01 03:12:19 +02:00
|
|
|
, which
|
2011-08-01 03:12:28 +02:00
|
|
|
, jdk
|
2011-08-01 03:14:49 +02:00
|
|
|
, nettools
|
2011-08-01 03:16:10 +02:00
|
|
|
, libX11
|
2011-08-01 03:16:19 +02:00
|
|
|
, libXt
|
2011-08-01 03:16:27 +02:00
|
|
|
, libXext
|
2011-08-01 03:16:35 +02:00
|
|
|
, libXrender
|
2011-08-01 03:16:42 +02:00
|
|
|
, libXtst
|
2011-08-01 03:16:50 +02:00
|
|
|
, libXi
|
2012-10-09 17:11:19 +02:00
|
|
|
, libXinerama
|
|
|
|
, libXcursor
|
|
|
|
, fontconfig
|
2011-08-01 03:17:16 +02:00
|
|
|
, cpio
|
2012-10-26 05:33:09 +02:00
|
|
|
, cacert
|
2011-08-01 20:48:01 +02:00
|
|
|
, jreOnly ? false
|
2012-10-26 05:33:09 +02:00
|
|
|
, perl
|
2011-08-01 03:10:16 +02:00
|
|
|
}:
|
2011-07-28 20:53:12 +02:00
|
|
|
|
2012-08-27 18:41:13 +02:00
|
|
|
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";
|
|
|
|
|
2013-01-22 18:58:07 +01:00
|
|
|
update = "6";
|
|
|
|
|
|
|
|
build = "24";
|
2012-11-29 16:32:37 +01:00
|
|
|
|
2012-08-27 18:41:13 +02:00
|
|
|
in
|
|
|
|
|
2011-08-01 03:08:58 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2013-01-22 18:58:07 +01:00
|
|
|
name = "openj${if jreOnly then "re" else "dk"}-7u${update}b${build}";
|
2011-07-28 20:53:12 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2013-01-22 18:58:07 +01:00
|
|
|
url = "http://www.java.net/download/openjdk/jdk7u6/promoted/b24/openjdk-7u6-fcs-src-b24-28_aug_2012.zip";
|
|
|
|
sha256 = "1x1iq8ga0hqqh0bpcmydzzy19757hknn2yvgzib85p7b7dx0vfx9";
|
2011-08-11 03:12:55 +02:00
|
|
|
};
|
|
|
|
|
2011-08-11 15:35:20 +02:00
|
|
|
# outputs = [ "out" ] ++ stdenv.lib.optionals (! jreOnly) [ "jre" ];
|
2011-08-11 04:29:10 +02:00
|
|
|
|
2011-08-01 03:16:35 +02:00
|
|
|
buildInputs = [
|
|
|
|
unzip
|
|
|
|
procps
|
|
|
|
ant
|
|
|
|
which
|
|
|
|
zip
|
2011-08-01 03:17:16 +02:00
|
|
|
cpio
|
2011-08-01 03:16:35 +02:00
|
|
|
nettools
|
|
|
|
alsaLib
|
|
|
|
libX11
|
|
|
|
libXt
|
|
|
|
libXext
|
|
|
|
libXrender
|
2011-08-01 03:16:42 +02:00
|
|
|
libXtst
|
2011-08-01 03:16:50 +02:00
|
|
|
libXi
|
2012-10-09 17:11:19 +02:00
|
|
|
libXinerama
|
|
|
|
libXcursor
|
|
|
|
fontconfig
|
2012-10-26 05:33:09 +02:00
|
|
|
perl
|
2011-08-01 04:59:22 +02:00
|
|
|
];
|
2011-08-01 03:08:15 +02:00
|
|
|
|
2012-10-09 17:11:19 +02:00
|
|
|
NIX_LDFLAGS = "-lfontconfig -lXcursor -lXinerama";
|
|
|
|
|
2011-08-01 03:13:36 +02:00
|
|
|
postUnpack = ''
|
2011-08-01 03:15:45 +02:00
|
|
|
sed -i -e "s@/usr/bin/test@${coreutils}/bin/test@" \
|
|
|
|
-e "s@/bin/ls@${coreutils}/bin/ls@" \
|
2011-08-25 00:52:16 +02:00
|
|
|
openjdk/hotspot/make/linux/makefiles/sa.make
|
2011-08-01 03:15:37 +02:00
|
|
|
|
|
|
|
sed -i "s@/bin/echo -e@${coreutils}/bin/echo -e@" \
|
2011-08-01 03:15:53 +02:00
|
|
|
openjdk/{jdk,corba}/make/common/shared/Defs-utils.gmk
|
2011-08-01 03:16:59 +02:00
|
|
|
|
|
|
|
sed -i "s@<Xrender.h>@<X11/extensions/Xrender.h>@" \
|
|
|
|
openjdk/jdk/src/solaris/native/sun/java2d/x11/XRSurfaceData.c
|
2011-08-01 03:13:36 +02:00
|
|
|
'';
|
|
|
|
|
2011-08-11 03:13:04 +02:00
|
|
|
patches = [
|
|
|
|
./cppflags-include-fix.patch
|
2012-11-08 20:50:47 +01:00
|
|
|
./no-crypto-restrictions.patch
|
2011-08-11 03:13:04 +02:00
|
|
|
];
|
2011-08-01 03:17:08 +02:00
|
|
|
|
2011-08-01 03:15:29 +02:00
|
|
|
makeFlags = [
|
|
|
|
"SORT=${coreutils}/bin/sort"
|
|
|
|
"ALSA_INCLUDE=${alsaLib}/include/alsa/version.h"
|
|
|
|
"FREETYPE_HEADERS_PATH=${freetype}/include"
|
|
|
|
"FREETYPE_LIB_PATH=${freetype}/lib"
|
|
|
|
"MILESTONE=release"
|
2012-11-29 16:32:37 +01:00
|
|
|
"BUILD_NUMBER=b${build}"
|
2011-08-01 03:15:29 +02:00
|
|
|
"CUPS_HEADERS_PATH=${cups}/include"
|
|
|
|
"USRBIN_PATH="
|
|
|
|
"COMPILER_PATH="
|
|
|
|
"DEVTOOLS_PATH="
|
|
|
|
"UNIXCOMMAND_PATH="
|
|
|
|
"BOOTDIR=${jdk}"
|
|
|
|
];
|
2011-08-01 03:08:58 +02:00
|
|
|
|
2011-08-01 03:08:23 +02:00
|
|
|
configurePhase = ''
|
2011-08-01 03:15:29 +02:00
|
|
|
make $makeFlags sanity
|
2011-08-01 03:08:23 +02:00
|
|
|
'';
|
2011-08-01 03:17:33 +02:00
|
|
|
|
|
|
|
installPhase = ''
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p $out
|
2011-08-01 20:48:01 +02:00
|
|
|
cp -av build/*/j2${if jreOnly then "re" else "sdk"}-image/* $out
|
2012-10-26 11:19:54 +02:00
|
|
|
pushd $out/${if ! jreOnly then "jre/" else ""}lib/security
|
2012-10-26 05:33:09 +02:00
|
|
|
rm cacerts
|
|
|
|
perl ${./generate-cacerts.pl} $out/bin/keytool ${cacert}/etc/ca-bundle.crt
|
|
|
|
popd
|
2011-08-11 15:35:20 +02:00
|
|
|
'';
|
|
|
|
# '' + (if jreOnly then "" else ''
|
|
|
|
# if [ -z $jre ]; then
|
|
|
|
# exit 0
|
|
|
|
# fi
|
2012-01-18 21:16:00 +01:00
|
|
|
# mkdir -p $jre
|
2011-08-11 15:35:20 +02:00
|
|
|
# cp -av build/*/j2re-image/* $jre
|
|
|
|
# '');
|
2011-08-01 03:17:42 +02:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://openjdk.java.net/;
|
|
|
|
|
|
|
|
license = "GPLv2";
|
|
|
|
|
|
|
|
description = "The open-source Java Development Kit";
|
|
|
|
|
|
|
|
maintainers = [ stdenv.lib.maintainers.shlevy ];
|
2011-08-11 03:12:37 +02:00
|
|
|
|
2011-08-11 16:48:06 +02:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2011-08-01 03:17:42 +02:00
|
|
|
};
|
2012-08-27 18:41:13 +02:00
|
|
|
|
|
|
|
passthru = { inherit architecture; };
|
2011-07-28 20:53:12 +02:00
|
|
|
}
|