* Build Firefox 3 on top of xulrunner. This significantly reduces the

build time and makes Firefox itself only 3 megabytes or so large.
* Fixed building the mplayerplug-in on Firefox 3.  Since the latter
  now uses xulrunner, we no longer need the firefox3Xul hack.  TODO:
  do this for Icecat as well.

svn path=/nixpkgs/trunk/; revision=13160
This commit is contained in:
Eelco Dolstra 2008-10-30 13:00:50 +00:00
parent b5e0436e5c
commit afb0530e3d
5 changed files with 39 additions and 46 deletions

View file

@ -1,6 +1,6 @@
{ stdenv, fetchurl, pkgconfig, gtk, pango, perl, python, zip, libIDL { stdenv, fetchurl, pkgconfig, gtk, pango, perl, python, zip, libIDL
, libjpeg, libpng, zlib, cairo, dbus, dbus_glib, bzip2, xlibs , libjpeg, zlib, cairo, dbus, dbus_glib, bzip2
, freetype, fontconfig , freetype, fontconfig, xulrunner
, # If you want the resulting program to call itself "Firefox" instead , # If you want the resulting program to call itself "Firefox" instead
# of "Deer Park", enable this option. However, those binaries may # of "Deer Park", enable this option. However, those binaries may
@ -19,11 +19,12 @@ stdenv.mkDerivation {
}; };
buildInputs = [ buildInputs = [
pkgconfig gtk perl zip libIDL libjpeg libpng zlib cairo bzip2 pkgconfig gtk perl zip libIDL libjpeg zlib cairo bzip2
python dbus dbus_glib pango freetype fontconfig python dbus dbus_glib pango freetype fontconfig
xlibs.libXi xlibs.libX11 xlibs.libXrender xlibs.libXft xlibs.libXt
]; ];
propagatedBuildInputs = [xulrunner];
configureFlags = [ configureFlags = [
"--enable-application=browser" "--enable-application=browser"
"--enable-optimize" "--enable-optimize"
@ -36,35 +37,21 @@ stdenv.mkDerivation {
"--enable-system-cairo" "--enable-system-cairo"
#"--enable-system-sqlite" # <-- this seems to be discouraged #"--enable-system-sqlite" # <-- this seems to be discouraged
"--disable-crashreporter" "--disable-crashreporter"
"--with-libxul-sdk=${xulrunner}/lib/xulrunner-devel-${xulrunner.version}"
]; ];
postInstall = '' postInstall = ''
export dontPatchELF=1; # Strip some more stuff.
# Strip some more stuff
strip -S $out/lib/*/* || true strip -S $out/lib/*/* || true
# Fix some references to /bin paths in the Firefox shell script.
substituteInPlace $out/bin/firefox \
--replace /bin/pwd "$(type -tP pwd)" \
--replace /bin/ls "$(type -tP ls)"
# This fixes starting Firefox when there already is a running
# instance. The `firefox' wrapper script actually expects to be
# in the same directory as `run-mozilla.sh', apparently.
libDir=$(cd $out/lib && ls -d firefox-[0-9]*) libDir=$(cd $out/lib && ls -d firefox-[0-9]*)
test -n "$libDir" test -n "$libDir"
cd $out/bin
mv firefox ../lib/$libDir/ ln -s ${xulrunner}/lib/xulrunner-${xulrunner.version} $out/lib/$libDir/xulrunner
ln -s ../lib/$libDir/firefox .
# Register extensions etc. # Register extensions etc. !!! is this needed anymore?
echo "running firefox -register..." echo "running firefox -register..."
(cd $out/lib/$libDir && LD_LIBRARY_PATH=. ./firefox-bin -register) || false $out/bin/firefox -register
# Put the Firefox icon in the right place.
ensureDir $out/lib/$libDir/chrome/icons/default
ln -s ../../../icons/default.xpm $out/lib/$libDir/chrome/icons/default/
''; # */ ''; # */
meta = { meta = {
@ -72,7 +59,10 @@ stdenv.mkDerivation {
homepage = http://www.mozilla.com/en-US/firefox/; homepage = http://www.mozilla.com/en-US/firefox/;
}; };
passthru = {inherit gtk;}; passthru = {
inherit gtk;
isFirefox3Like = true;
};
} }

View file

@ -9,12 +9,18 @@
enableOfficialBranding ? false enableOfficialBranding ? false
}: }:
let
version = "1.9.0.3"; # this attribute is used by other packages
in
stdenv.mkDerivation { stdenv.mkDerivation {
name = "xulrunner-1.9.0.1"; name = "xulrunner-${version}";
src = fetchurl { src = fetchurl {
url = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.0.1/source/firefox-3.0.1-source.tar.bz2; url = http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.0.3/source/firefox-3.0.3-source.tar.bz2;
sha1 = "ba3bb0b02404cf1abfb6189b156b2f4eb02e8975"; sha1 = "089a41ff079cd37d39d19cf3a51daba07337db2c";
}; };
buildInputs = [ buildInputs = [
@ -75,7 +81,7 @@ stdenv.mkDerivation {
homepage = http://www.mozilla.com/en-US/firefox/; homepage = http://www.mozilla.com/en-US/firefox/;
}; };
passthru = {inherit gtk;}; passthru = { inherit gtk version; };
} }

View file

@ -103,7 +103,10 @@ stdenv.mkDerivation {
licenses = [ "GPLv2+" "LGPLv2+" "MPLv1+" ]; licenses = [ "GPLv2+" "LGPLv2+" "MPLv1+" ];
}; };
passthru = {inherit gtk;}; passthru = {
inherit gtk;
isFirefox3Like = true;
};
} }

View file

@ -1,4 +1,4 @@
{stdenv, fetchurl, pkgconfig, browser, browserName, libXpm, gettext}: {stdenv, fetchurl, pkgconfig, browser, libXpm, gettext}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "mplayerplug-in-3.55"; name = "mplayerplug-in-3.55";
@ -9,13 +9,10 @@ stdenv.mkDerivation rec {
}; };
patches = patches =
(if browserName == "icecat" # FIXME: Should match Firefox 3 as well. stdenv.lib.optional (browser ? isFirefox3Like) ./icecat3-idldir.patch;
then [ ./icecat3-idldir.patch ]
else []);
postConfigure = postConfigure =
(if browserName == "icecat" # FIXME: Should match Firefox 3 as well. (if browser ? isFirefox3Like then ''
then ''
# Cause a rebuild of these file from the IDL file, needed for GNU IceCat 3 # Cause a rebuild of these file from the IDL file, needed for GNU IceCat 3
# and Mozilla Firefox 3. # and Mozilla Firefox 3.
# See, e.g., http://article.gmane.org/gmane.comp.mozilla.mplayerplug-in/2104 . # See, e.g., http://article.gmane.org/gmane.comp.mozilla.mplayerplug-in/2104 .

View file

@ -7144,11 +7144,12 @@ let
firefoxWrapper = wrapFirefox firefox "firefox" ""; firefoxWrapper = wrapFirefox firefox "firefox" "";
firefox3 = lowPrio (import ../applications/networking/browsers/firefox-3 { firefox3 = lowPrio (import ../applications/networking/browsers/firefox-3 {
inherit fetchurl stdenv pkgconfig perl zip libjpeg libpng zlib cairo inherit fetchurl stdenv pkgconfig perl zip libjpeg zlib cairo
python dbus dbus_glib freetype fontconfig bzip2 xlibs; python dbus dbus_glib freetype fontconfig bzip2;
inherit (gtkLibs) gtk pango; inherit (gtkLibs) gtk pango;
inherit (gnome) libIDL; inherit (gnome) libIDL;
#enableOfficialBranding = true; #enableOfficialBranding = true;
xulrunner = xulrunner3;
}); });
xulrunner3 = lowPrio (import ../applications/networking/browsers/firefox-3/xulrunner.nix { xulrunner3 = lowPrio (import ../applications/networking/browsers/firefox-3/xulrunner.nix {
@ -7159,10 +7160,6 @@ let
#enableOfficialBranding = true; #enableOfficialBranding = true;
}); });
firefox3Xul = lowPrio ((symlinkJoin "firefox-3-with-xulrunner" [firefox3 xulrunner3]) // {
inherit (firefox) gtk;
});
firefox3b1Bin = lowPrio (import ../applications/networking/browsers/firefox-3/binary.nix { firefox3b1Bin = lowPrio (import ../applications/networking/browsers/firefox-3/binary.nix {
inherit fetchurl stdenv pkgconfig perl zip libjpeg libpng zlib cairo inherit fetchurl stdenv pkgconfig perl zip libjpeg libpng zlib cairo
python curl coreutils freetype fontconfig; python curl coreutils freetype fontconfig;
@ -7180,7 +7177,7 @@ let
flac = getVersion "flac" flacAlts; flac = getVersion "flac" flacAlts;
flashplayer = flashplayer9; flashplayer = flashplayer10;
flashplayer9 = import ../applications/networking/browsers/mozilla-plugins/flashplayer-9 { flashplayer9 = import ../applications/networking/browsers/mozilla-plugins/flashplayer-9 {
inherit fetchurl stdenv zlib alsaLib; inherit fetchurl stdenv zlib alsaLib;
@ -7519,9 +7516,9 @@ let
}; };
*/ */
MPlayerPlugin = browser: browserName: MPlayerPlugin = browser:
import ../applications/networking/browsers/mozilla-plugins/mplayerplug-in { import ../applications/networking/browsers/mozilla-plugins/mplayerplug-in {
inherit browser browserName; inherit browser;
inherit fetchurl stdenv pkgconfig gettext; inherit fetchurl stdenv pkgconfig gettext;
inherit (xlibs) libXpm; inherit (xlibs) libXpm;
# !!! should depend on MPlayer # !!! should depend on MPlayer
@ -7967,7 +7964,7 @@ let
++ lib.optional (enableAdobeFlash) flashplayer ++ lib.optional (enableAdobeFlash) flashplayer
# RealPlayer is disabled by default for legal reasons. # RealPlayer is disabled by default for legal reasons.
++ lib.optional (system != "i686-linux" && getConfig [browserName "enableRealPlayer"] false) RealPlayer ++ lib.optional (system != "i686-linux" && getConfig [browserName "enableRealPlayer"] false) RealPlayer
++ lib.optional (getConfig [browserName "enableMPlayer"] true) (MPlayerPlugin browser browserName) ++ lib.optional (getConfig [browserName "enableMPlayer"] true) (MPlayerPlugin browser)
++ lib.optional (supportsJDK && getConfig [browserName "jre"] false && jrePlugin ? mozillaPlugin) jrePlugin ++ lib.optional (supportsJDK && getConfig [browserName "jre"] false && jrePlugin ? mozillaPlugin) jrePlugin
); );
}; };