2007-03-05 18:13:53 +01:00
|
|
|
{ swingSupport ? true
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, unzip
|
2008-02-26 16:24:33 +01:00
|
|
|
, makeWrapper
|
2007-03-05 18:55:17 +01:00
|
|
|
, xlibs ? null
|
2007-03-05 18:13:53 +01:00
|
|
|
, installjdk ? true
|
2007-03-28 17:21:43 +02:00
|
|
|
, pluginSupport ? true
|
2007-03-05 18:13:53 +01:00
|
|
|
}:
|
|
|
|
|
2007-03-17 15:37:23 +01:00
|
|
|
assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
|
2007-03-05 18:55:17 +01:00
|
|
|
assert swingSupport -> xlibs != null;
|
2007-03-05 18:13:53 +01:00
|
|
|
|
2008-06-14 23:42:07 +02:00
|
|
|
stdenv.mkDerivation ({
|
2007-03-05 18:13:53 +01:00
|
|
|
name =
|
2010-04-20 13:29:40 +02:00
|
|
|
if installjdk then "jdk-1.6.0_20" else "jre-1.6.0_20";
|
2007-03-05 18:13:53 +01:00
|
|
|
|
|
|
|
src =
|
2007-03-17 15:37:23 +01:00
|
|
|
if stdenv.system == "i686-linux" then
|
|
|
|
fetchurl {
|
2010-04-20 13:29:40 +02:00
|
|
|
url = http://download.java.net/dlj/binaries/jdk-6u20-dlj-linux-i586.bin;
|
|
|
|
sha256 = "1gjd8y7d0a07lpl6x5j8wgyagf2kspl7xs0xf1k9pd8qzlw17z6v";
|
2007-03-17 15:37:23 +01:00
|
|
|
}
|
|
|
|
else if stdenv.system == "x86_64-linux" then
|
|
|
|
fetchurl {
|
2010-04-20 13:29:40 +02:00
|
|
|
url = http://download.java.net/dlj/binaries/jdk-6u20-dlj-linux-amd64.bin;
|
|
|
|
sha256 = "124a5lpcqx3nh3n968rvaca0clj4crfmxlgy2db227vllc2jlj0y";
|
2007-03-17 15:37:23 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
abort "jdk requires i686-linux or x86_64 linux";
|
2007-03-05 18:13:53 +01: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 13:53:01 +01:00
|
|
|
* gone in jdk6.
|
2007-03-05 18:13:53 +01:00
|
|
|
*/
|
|
|
|
construct = ./jdk6-construct.sh;
|
|
|
|
inherit installjdk;
|
|
|
|
|
2007-03-18 01:33:32 +01:00
|
|
|
/**
|
|
|
|
* 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";
|
|
|
|
|
2008-02-26 16:24:33 +01:00
|
|
|
buildInputs = [unzip makeWrapper];
|
2008-03-28 12:58:36 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* libXt is only needed on amd64
|
|
|
|
*/
|
2007-03-05 18:13:53 +01:00
|
|
|
libraries =
|
2008-04-10 14:11:53 +02:00
|
|
|
[stdenv.gcc.libc] ++
|
2008-03-28 12:58:36 +01:00
|
|
|
(if swingSupport then [xlibs.libX11 xlibs.libXext xlibs.libXtst xlibs.libXi xlibs.libXp xlibs.libXt] else []);
|
2007-03-28 00:02:55 +02:00
|
|
|
|
2008-06-14 23:42:07 +02:00
|
|
|
inherit swingSupport pluginSupport;
|
|
|
|
inherit (xlibs) libX11;
|
|
|
|
|
|
|
|
} //
|
2007-03-17 15:37:23 +01:00
|
|
|
/**
|
2009-05-01 21:34:56 +02:00
|
|
|
* comment: there is a plugin for amd64 since 0_13. However it's located in
|
|
|
|
* JRE_STORE_PATH/lib/amd64/libnpjp2.so. I don't know yet how to add it to
|
|
|
|
* MOZ_PLUGIN_PATH so that it's found. Put a symlink into ~/.mozilla/plugins
|
|
|
|
* instead.
|
2007-03-17 15:37:23 +01:00
|
|
|
*/
|
|
|
|
( if stdenv.system == "i686-linux" then
|
|
|
|
{
|
|
|
|
mozillaPlugin =
|
2007-03-28 00:02:55 +02:00
|
|
|
if installjdk then "/jre/plugin/i386/ns7" else "/plugin/i386/ns7";
|
2007-03-17 15:37:23 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{}
|
|
|
|
)
|
2007-10-31 13:17:14 +01:00
|
|
|
)
|