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