Making the firefox java plugin work in i686-linux and x86_64-linux.

It should work for both firefox 3.6 and firefox 3.5 (said roconnor on irc).

Thanks to the wiki page http://wiki.nixos.org/wiki/Java_in_Firefox which explained
why what we had did not work.

svn path=/nixpkgs/trunk/; revision=23801
This commit is contained in:
Lluís Batlle i Rossell 2010-09-14 15:14:18 +00:00
parent 76a02e762a
commit d0b42b2927
2 changed files with 22 additions and 29 deletions

View file

@ -50,5 +50,8 @@ if test -z "$pluginSupport"; then
rm -f $out/bin/javaws
fi
mkdir $jrePath/lib/$architecture/plugins
ln -s $jrePath/lib/$architecture/libnpjp2.so $jrePath/lib/$architecture/plugins
# Workaround for assertions in xlib, see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6532373.
substituteInPlace $jrePath/lib/*/xawt/libmawt.so --replace XINERAMA FAKEEXTN

View file

@ -11,7 +11,22 @@
assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
assert swingSupport -> xlibs != null;
stdenv.mkDerivation ({
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";
in
stdenv.mkDerivation {
name =
if installjdk then "jdk-1.6.0_20" else "jre-1.6.0_20";
@ -39,17 +54,6 @@ stdenv.mkDerivation ({
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];
/**
@ -59,22 +63,8 @@ stdenv.mkDerivation ({
[stdenv.gcc.libc] ++
(if swingSupport then [xlibs.libX11 xlibs.libXext xlibs.libXtst xlibs.libXi xlibs.libXp xlibs.libXt] else []);
inherit swingSupport pluginSupport;
inherit swingSupport pluginSupport architecture;
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/lib/i386" else "/lib/i386";
}
else
{}
)
)
mozillaPlugin = if installjdk then "/jre/lib/${architecture}/plugins" else "/lib/${architecture}/plugins";
}