* firefox-wrapper: plugins no longer have to declare additional

LD_LIBRARY_PATH elements, since they can use patchelf --rpath if
  necessary.
* Flashplayer / JRE: do just that.
* JRE: libstdcpp5 no longer seems to be necessary for the plugin.

svn path=/nixpkgs/trunk/; revision=12094
This commit is contained in:
Eelco Dolstra 2008-06-14 21:42:07 +00:00
parent 7219a09001
commit faba06ce54
8 changed files with 23 additions and 52 deletions

View File

@ -1,7 +0,0 @@
source $stdenv/setup
source $makeWrapper
makeWrapper "$firefox/bin/firefox" "$out/bin/firefox$nameSuffix" \
--suffix-each MOZ_PLUGIN_PATH ':' "$plugins" \
--suffix-contents LD_LIBRARY_PATH ':' "$(filterExisting $(addSuffix /extra-library-path $plugins))" \
--suffix-contents PATH ':' "$(filterExisting $(addSuffix /extra-bin-path $plugins))"

View File

@ -1,14 +1,15 @@
args: with args;
{stdenv, firefox, nameSuffix ? "", makeWrapper, plugins}:
stdenv.mkDerivation {
name = firefox.name + "-with-plugins";
builder = ./builder.sh;
makeWrapper = ../../../../build-support/make-wrapper/make-wrapper.sh;
buildInputs = [makeWrapper];
inherit firefox;
nameSuffix = (if args ? nameSuffix then args.nameSuffix else "");
buildCommand = ''
makeWrapper "${firefox}/bin/firefox" "$out/bin/firefox${nameSuffix}" \
--suffix-each MOZ_PLUGIN_PATH ':' "$plugins" \
--suffix-contents PATH ':' "$(filterExisting $(addSuffix /extra-bin-path $plugins))"
'';
# Let each plugin tell us (through its `mozillaPlugin') attribute
# where to find the plugin in its tree.

View File

@ -2,11 +2,13 @@ source $stdenv/setup
buildPhase=true
installCommand=myInstall
myInstall() {
mkdir -p $out/lib/mozilla/plugins
dontStrip=1
dontPatchELF=1
installPhase() {
ensureDir $out/lib/mozilla/plugins
cp -p libflashplayer.so $out/lib/mozilla/plugins
echo "$zlib/lib:$alsaLib/lib" > $out/lib/mozilla/plugins/extra-library-path
patchelf --set-rpath "$zlib/lib:$alsaLib/lib" $out/lib/mozilla/plugins/libflashplayer.so
}
genericBuild

View File

@ -16,5 +16,5 @@ makeWrapper "$out/real/realplay.bin" "$out/bin/realplay" \
--set HELIX_LIBS "$out/real" \
--suffix-each LD_LIBRARY_PATH ':' "$(addSuffix /lib $libPath)"
echo "$libstdcpp5/lib" > $out/real/mozilla/extra-library-path
#echo "$libstdcpp5/lib" > $out/real/mozilla/extra-library-path # !!! must be updated, use patchelf --rpath
echo "$out/bin" > $out/real/mozilla/extra-bin-path

View File

@ -3,7 +3,7 @@ args:
if args.stdenv.system == "i686-linux" || args.stdenv.system == "x86_64-linux" then
(import ./jdk6-linux.nix) args
else if args.stdenv.system == "powerpc-linux" then
(import ./jdk5-ibm-powerpc-linux.nix) (removeAttrs args ["libstdcpp5" "pluginSupport" "xlibs" "installjdk"])
(import ./jdk5-ibm-powerpc-linux.nix) (removeAttrs args ["pluginSupport" "xlibs" "installjdk"])
else
abort "the JDK is not supported on this platform"

View File

@ -44,20 +44,10 @@ find $out -type f -perm +100 \
-exec patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
--set-rpath "$rpath" {} \;
function mozillaExtraLibPath() {
p=$1
if test -e "$p"; then
echo "$libstdcpp5/lib" > $p/extra-library-path
fi
}
find $out -name "*.so" -exec patchelf --set-rpath "$rpath" {} \;
if test -z "$pluginSupport"; then
rm -f $out/bin/javaws
else
wrapProgram "$out/bin/javaws" \
--suffix-each LD_LIBRARY_PATH ':' "$(addSuffix /lib $libPath)"
mozillaExtraLibPath "$jrePath/plugin/i386/ns7"
fi
# Workaround for assertions in xlib, see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6532373.

View File

@ -6,14 +6,12 @@
, 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 ({
stdenv.mkDerivation ({
name =
if installjdk then "jdk-1.6.0_6" else "jre-1.6.0_6";
@ -61,22 +59,10 @@ assert pluginSupport -> libstdcpp5 != null;
[stdenv.gcc.libc] ++
(if swingSupport then [xlibs.libX11 xlibs.libXext xlibs.libXtst xlibs.libXi xlibs.libXp xlibs.libXt] else []);
inherit pluginSupport;
} // (
# necessary for javaws and mozilla plugin
if pluginSupport then
{
libPath = [libstdcpp5];
inherit libstdcpp5;
}
else
{}
))
//
{
inherit swingSupport pluginSupport;
}
//
inherit (xlibs) libX11;
} //
/**
* The mozilla plugin is not available in the amd64 distribution (?)
*/

View File

@ -1614,7 +1614,6 @@ let pkgs = rec {
assert supportsJDK;
(if pluginSupport then appendToName "plugin" else x: x) (import ../development/compilers/jdk {
inherit fetchurl stdenv unzip installjdk xlibs pluginSupport makeWrapper;
libstdcpp5 = gcc33.gcc;
});
jikes = import ../development/compilers/jikes {
@ -6544,7 +6543,7 @@ let pkgs = rec {
};
wrapFirefox = firefox: nameSuffix: import ../applications/networking/browsers/firefox-wrapper {
inherit stdenv firefox nameSuffix;
inherit stdenv firefox nameSuffix makeWrapper;
plugins =
let enableAdobeFlash = getConfig [ "firefox" "enableAdobeFlash" ] false
&& system == "i686-linux";