Make jdk plugin support optional to avoid deps on gcc 3.3.6 everywhere.

svn path=/nixpkgs/trunk/; revision=8452
This commit is contained in:
Martin Bravenboer 2007-03-28 15:21:43 +00:00
parent e0ad264f43
commit 9d9372cd58
3 changed files with 31 additions and 18 deletions

View File

@ -43,18 +43,20 @@ find $out -type f -perm +100 \
-exec patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
--set-rpath "$rpath" {} \;
mv $out/bin/javaws $out/bin/javaws.bin
makeWrapper "$out/bin/javaws.bin" "$out/bin/javaws" \
--suffix-each LD_LIBRARY_PATH ':' "$(addSuffix /lib $libPath)"
function mozillaExtraLibPath() {
p=$1
if test -e "$p"; then
echo "$libstdcpp5/lib" > $p/extra-library-path
fi
}
mozillaExtraLibPath "$out/jre/plugin/i386/ns7"
mozillaExtraLibPath "$out/plugin/i386/ns7"
if test -z "$pluginSupport"; then
rm $out/bin/javaws
else
mv $out/bin/javaws $out/bin/javaws.bin
makeWrapper "$out/bin/javaws.bin" "$out/bin/javaws" \
--suffix-each LD_LIBRARY_PATH ':' "$(addSuffix /lib $libPath)"
mozillaExtraLibPath "$out/jre/plugin/i386/ns7"
mozillaExtraLibPath "$out/plugin/i386/ns7"
fi

View File

@ -4,13 +4,15 @@
, unzip
, xlibs ? null
, installjdk ? true
, libstdcpp5
, pluginSupport ? true
, libstdcpp5 ? null
}:
assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
assert swingSupport -> xlibs != null;
assert pluginSupport -> libstdcpp5 != null;
(stdenv.mkDerivation {
(stdenv.mkDerivation ({
name =
if installjdk then "jdk-1.6.0" else "jre-1.6.0";
@ -53,14 +55,21 @@ assert swingSupport -> xlibs != null;
libraries =
(if swingSupport then [xlibs.libX11 xlibs.libXext xlibs.libXtst xlibs.libXi] else []);
inherit pluginSupport;
} // (
# necessary for javaws and mozilla plugin
makeWrapper = ../../../build-support/make-wrapper/make-wrapper.sh;
libPath = [libstdcpp5];
inherit libstdcpp5;
}
if pluginSupport then
{
makeWrapper = ../../../build-support/make-wrapper/make-wrapper.sh;
libPath = [libstdcpp5];
inherit libstdcpp5;
}
else
{}
))
//
{
inherit swingSupport;
inherit swingSupport pluginSupport;
}
//
/**

View File

@ -748,10 +748,12 @@ rec {
inherit fetchurl stdenv;
};
jre = jdkdistro false;
jdk = jdkdistro true;
jre = jdkdistro false true;
jdk = jdkdistro true true;
jdkdistro = installjdk :
jdkNoPlugin = jdkdistro true false;
jdkdistro = installjdk : pluginSupport:
if stdenv.isDarwin then
"/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home"
else