3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/compilers/jdk/jdk6-linux.nix
Martin Bravenboer 9d9372cd58 Make jdk plugin support optional to avoid deps on gcc 3.3.6 everywhere.
svn path=/nixpkgs/trunk/; revision=8452
2007-03-28 15:21:43 +00:00

86 lines
2.1 KiB
Nix

{ swingSupport ? true
, stdenv
, fetchurl
, unzip
, xlibs ? null
, installjdk ? true
, pluginSupport ? true
, libstdcpp5 ? null
}:
assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
assert swingSupport -> xlibs != null;
assert pluginSupport -> libstdcpp5 != null;
(stdenv.mkDerivation ({
name =
if installjdk then "jdk-1.6.0" else "jre-1.6.0";
src =
if stdenv.system == "i686-linux" then
fetchurl {
url = http://download.java.net/dlj/binaries/jdk-6-dlj-linux-i586.bin;
sha256 = "0rw48124fdc5rhafj6qzrysb4w823jbn3awxgn07kcy1nvnrhkqw";
}
else if stdenv.system == "x86_64-linux" then
fetchurl {
url = http://download.java.net/dlj/binaries/jdk-6-dlj-linux-amd64.bin;
sha256 = "1hr16f5kr3xcyhkl3yc2qi2kxg2avr3cmlxv4awpnj0930rmvwzi";
}
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];
libraries =
(if swingSupport then [xlibs.libX11 xlibs.libXext xlibs.libXtst xlibs.libXi] else []);
inherit pluginSupport;
} // (
# necessary for javaws and mozilla plugin
if pluginSupport then
{
makeWrapper = ../../../build-support/make-wrapper/make-wrapper.sh;
libPath = [libstdcpp5];
inherit libstdcpp5;
}
else
{}
))
//
{
inherit swingSupport pluginSupport;
}
//
/**
* The mozilla plugin is not available in the amd64 distribution (?)
*/
( if stdenv.system == "i686-linux" then
{
mozillaPlugin =
if installjdk then "/jre/plugin/i386/ns7" else "/plugin/i386/ns7";
}
else
{}
)
)