nixpkgs/pkgs/development/compilers/jdk/jdk6-linux.nix
Marc Weber 75244dffaf update jdk because jdk-1.6.0_13 provides a mozilla plugin for x86_64
svn path=/nixpkgs/trunk/; revision=15422
2009-05-01 19:34:56 +00:00

81 lines
2.1 KiB
Nix

{ swingSupport ? true
, stdenv
, fetchurl
, unzip
, makeWrapper
, xlibs ? null
, installjdk ? true
, pluginSupport ? true
}:
assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
assert swingSupport -> xlibs != null;
stdenv.mkDerivation ({
name =
if installjdk then "jdk-1.6.0_13" else "jre-1.6.0_13";
src =
if stdenv.system == "i686-linux" then
fetchurl {
url = http://download.java.net/dlj/binaries/jdk-6u13-dlj-linux-i586.bin;
md5 = "b95c9cab85d92b6bbfa2c5b825a478af";
}
else if stdenv.system == "x86_64-linux" then
fetchurl {
url = http://download.java.net/dlj/binaries/jdk-6u13-dlj-linux-amd64.bin;
md5 = "37180c40b18bb1cc23620c0da52d0be4";
}
else
abort "jdk requires i686-linux or x86_64 linux";
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
* gone in jdk6.
*/
construct = ./jdk6-construct.sh;
inherit installjdk;
/**
* 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";
buildInputs = [unzip makeWrapper];
/**
* libXt is only needed on amd64
*/
libraries =
[stdenv.gcc.libc] ++
(if swingSupport then [xlibs.libX11 xlibs.libXext xlibs.libXtst xlibs.libXi xlibs.libXp xlibs.libXt] else []);
inherit swingSupport pluginSupport;
inherit (xlibs) libX11;
} //
/**
* 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.
*/
( if stdenv.system == "i686-linux" then
{
mozillaPlugin =
if installjdk then "/jre/plugin/i386/ns7" else "/plugin/i386/ns7";
}
else
{}
)
)