2007-03-05 17:13:53 +00:00
|
|
|
{ swingSupport ? true
|
|
|
|
, stdenv
|
2013-05-16 09:34:35 +01:00
|
|
|
, requireFile
|
2007-03-05 17:13:53 +00:00
|
|
|
, unzip
|
2008-02-26 15:24:33 +00:00
|
|
|
, makeWrapper
|
2015-09-15 10:26:18 +01:00
|
|
|
, xorg ? null
|
2007-03-05 17:13:53 +00:00
|
|
|
, installjdk ? true
|
2007-03-28 16:21:43 +01:00
|
|
|
, pluginSupport ? true
|
2013-10-08 10:30:54 +01:00
|
|
|
, installjce ? false
|
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";
|
2015-09-15 10:26:18 +01:00
|
|
|
assert swingSupport -> xorg != 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";
|
|
|
|
|
2013-10-08 10:30:54 +01:00
|
|
|
jce =
|
|
|
|
if installjce then
|
|
|
|
requireFile {
|
|
|
|
name = "jce_policy-6.zip";
|
|
|
|
url = http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html;
|
|
|
|
sha256 = "0qljzfxbikm8br5k7rkamibp1vkyjrf6blbxpx6hn4k46f62bhnh";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
null;
|
2010-09-14 16:14:18 +01:00
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2007-03-05 17:13:53 +00:00
|
|
|
name =
|
2013-04-18 19:18:09 +01:00
|
|
|
if installjdk then "jdk-1.6.0_45b06" else "jre-1.6.0_45b06";
|
2007-03-05 17:13:53 +00:00
|
|
|
|
|
|
|
src =
|
2007-03-17 14:37:23 +00:00
|
|
|
if stdenv.system == "i686-linux" then
|
2013-05-16 09:34:35 +01:00
|
|
|
requireFile {
|
|
|
|
name = "jdk-6u45-linux-i586.bin";
|
|
|
|
url = http://www.oracle.com/technetwork/java/javase/downloads/jdk6downloads-1902814.html;
|
2013-04-18 19:18:09 +01:00
|
|
|
sha256 = "0mx3d2qlal5zyz1a7ld1yk2rs8pf9sjxs2jzasais3nq30jmlfym";
|
2007-03-17 14:37:23 +00:00
|
|
|
}
|
|
|
|
else if stdenv.system == "x86_64-linux" then
|
2013-05-16 09:34:35 +01:00
|
|
|
requireFile {
|
|
|
|
name = "jdk-6u45-linux-x64.bin";
|
|
|
|
url = http://www.oracle.com/technetwork/java/javase/downloads/jdk6downloads-1902814.html;
|
2013-04-18 19:18:09 +01:00
|
|
|
sha256 = "1s0j1pdr6y8c816d9i86rx4zp12nbhmas1rxksp0r53cn7m3ljbb";
|
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 =
|
2014-12-17 18:11:30 +00:00
|
|
|
[stdenv.cc.libc] ++
|
2015-09-15 10:26:18 +01:00
|
|
|
(if swingSupport then [xorg.libX11 xorg.libXext xorg.libXtst xorg.libXi xorg.libXp xorg.libXt] else []);
|
2007-03-27 23:02:55 +01:00
|
|
|
|
2013-10-08 10:30:54 +01:00
|
|
|
inherit swingSupport pluginSupport architecture jce;
|
2015-09-15 10:26:18 +01:00
|
|
|
inherit (xorg) libX11;
|
2008-06-14 22:42:07 +01:00
|
|
|
|
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
|
|
|
|
2014-06-19 05:19:00 +01:00
|
|
|
meta.license = stdenv.lib.licenses.unfree;
|
2010-09-14 16:14:18 +01:00
|
|
|
}
|