2007-03-05 17:13:53 +00:00
|
|
|
{ swingSupport ? true
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, unzip
|
2008-02-26 15:24:33 +00:00
|
|
|
, makeWrapper
|
2007-03-05 17:55:17 +00:00
|
|
|
, xlibs ? null
|
2007-03-05 17:13:53 +00:00
|
|
|
, installjdk ? true
|
2007-03-28 16:21:43 +01:00
|
|
|
, pluginSupport ? true
|
2007-03-05 17:13:53 +00:00
|
|
|
}:
|
|
|
|
|
2007-03-17 14:37:23 +00:00
|
|
|
assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
|
2007-03-05 17:55:17 +00:00
|
|
|
assert swingSupport -> xlibs != null;
|
2007-03-05 17:13:53 +00:00
|
|
|
|
2010-09-14 16:14:18 +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
|
|
|
|
abort "jdk requires i686-linux or x86_64 linux";
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2007-03-05 17:13:53 +00:00
|
|
|
name =
|
2012-11-21 20:31:56 +00:00
|
|
|
if installjdk then "jdk-1.6.0_38b04" else "jre-1.6.0_38b04";
|
2007-03-05 17:13:53 +00:00
|
|
|
|
|
|
|
src =
|
2007-03-17 14:37:23 +00:00
|
|
|
if stdenv.system == "i686-linux" then
|
|
|
|
fetchurl {
|
2012-11-21 20:31:56 +00:00
|
|
|
url = http://www.java.net/download/jdk6/6u38/promoted/b04/binaries/jdk-6u38-ea-bin-b04-linux-i586-31_oct_2012.bin;
|
|
|
|
md5 = "0595473ad371981c7faa709798a5f78e";
|
2007-03-17 14:37:23 +00:00
|
|
|
}
|
|
|
|
else if stdenv.system == "x86_64-linux" then
|
|
|
|
fetchurl {
|
2012-11-21 20:31:56 +00:00
|
|
|
url = http://www.java.net/download/jdk6/6u38/promoted/b04/binaries/jdk-6u38-ea-bin-b04-linux-amd64-31_oct_2012.bin;
|
|
|
|
md5 = "b98c80a963915de32b1abe02c50385de";
|
2007-03-17 14:37:23 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
abort "jdk requires i686-linux or x86_64 linux";
|
2007-03-05 17:13:53 +00:00
|
|
|
|
|
|
|
builder = ./dlj-bundle-builder.sh;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* If jdk5 is added, make sure to use the original construct script.
|
|
|
|
* This copy removes references to kinit, klist, ktab, which seem to be
|
2007-03-21 12:53:01 +00:00
|
|
|
* gone in jdk6.
|
2007-03-05 17:13:53 +00:00
|
|
|
*/
|
|
|
|
construct = ./jdk6-construct.sh;
|
|
|
|
inherit installjdk;
|
|
|
|
|
2008-02-26 15:24:33 +00:00
|
|
|
buildInputs = [unzip makeWrapper];
|
2012-08-22 20:24:04 +01:00
|
|
|
|
2008-03-28 11:58:36 +00:00
|
|
|
/**
|
|
|
|
* libXt is only needed on amd64
|
|
|
|
*/
|
2007-03-05 17:13:53 +00:00
|
|
|
libraries =
|
2008-04-10 13:11:53 +01:00
|
|
|
[stdenv.gcc.libc] ++
|
2008-03-28 11:58:36 +00:00
|
|
|
(if swingSupport then [xlibs.libX11 xlibs.libXext xlibs.libXtst xlibs.libXi xlibs.libXp xlibs.libXt] else []);
|
2007-03-27 23:02:55 +01:00
|
|
|
|
2010-09-14 16:14:18 +01:00
|
|
|
inherit swingSupport pluginSupport architecture;
|
2008-06-14 22:42:07 +01:00
|
|
|
inherit (xlibs) libX11;
|
|
|
|
|
2010-09-14 16:14:18 +01:00
|
|
|
mozillaPlugin = if installjdk then "/jre/lib/${architecture}/plugins" else "/lib/${architecture}/plugins";
|
2012-08-22 20:24:44 +01:00
|
|
|
|
|
|
|
meta.license = "unfree";
|
2010-09-14 16:14:18 +01:00
|
|
|
}
|