Ludovic Courtès wrote:

>>> I'm 90% sure the attached patch fixes the problem (it just mimics what's
>>> done for GNU IceCat).  Can you confirm this?
>> This patch should work but it does double the size of the Firefox 
>> installation
>> (because it includes a separate xulrunner build).  As far as I can tell, the
>> only reason mplayerplug-in and friends fail to build is because Firefox 3
>> forgets to install some XUL/XPCOM-related stuff (which it does build).  
>> Firefox
>> 2 did install them.  Maybe we can manually install the missing files in the
>> postInstall hook.
> 
> Hmm, are you sure it builds everything that's needed?
> 
> Surely, a large part of the build is duplicated between both, but I was
> under the impression that only one "application" (i.e., `browser' or
> `xulrunner') could be built at a time (with `--enable-application' at
> configure-time).

I've finally fixed it :-)  Firefox 3 is now built on top of the Xulrunner
package, and it seems to run fine.  This has the advantages that it makes the
Firefox build very quickly (actually unpacking the sources takes the most time)
and it makes the Firefox installation much smaller.  We can do the same for
Thunderbird 3 once it's released.

I did the same for IceCat (i.e. running IceCat on top of Mozilla's xulrunner),
but I haven't committed this yet.  It might be that IceCat contains some changes
to the libxul code, which we would then miss out on.  Also, some of the
extensions that IceCat includes (like python/xpcom) don't build properly because
they refer to a non-existant libxpcom_core, so they're disabled.  Other than
that, it seems to run fine.

The patch is attached.

-- 
Eelco Dolstra | http://www.st.ewi.tudelft.nl/~dolstra/
Index: pkgs/top-level/all-packages.nix
===================================================================
--- pkgs/top-level/all-packages.nix     (revision 13165)
+++ pkgs/top-level/all-packages.nix     (working copy)
@@ -7304,21 +7304,11 @@
     inherit fetchurl stdenv lzma pkgconfig perl zip libjpeg libpng zlib cairo
       python dbus dbus_glib freetype fontconfig bzip2 xlibs;
     inherit (gnome) libIDL libgnomeui gnomevfs gtk pango;
+    xulrunner = xulrunner3;
   });
 
-  icecatXulrunner3 = lowPrio (import 
../applications/networking/browsers/icecat-3 {
-    application = "xulrunner";
-    inherit fetchurl stdenv lzma pkgconfig perl zip libjpeg libpng zlib cairo
-      python dbus dbus_glib freetype fontconfig bzip2 xlibs;
-    inherit (gnome) libIDL libgnomeui gnomevfs gtk pango;
-  });
+  icecatWrapper = wrapFirefox icecat3 "icecat" "";
 
-  icecat3Xul =
-    (symlinkJoin "icecat-3-with-xulrunner" [ icecat3 icecatXulrunner3 ])
-    // { inherit (icecat3) gtk meta; };
-
-  icecatWrapper = wrapFirefox icecat3Xul "icecat" "";
-
   icewm = import ../applications/window-managers/icewm {
     inherit fetchurl stdenv gettext libjpeg libtiff libungif libpng imlib;
     inherit (xlibs) libX11 libXft libXext libXinerama libXrandr;
Index: pkgs/applications/networking/browsers/icecat-3/default.nix
===================================================================
--- pkgs/applications/networking/browsers/icecat-3/default.nix  (revision 13165)
+++ pkgs/applications/networking/browsers/icecat-3/default.nix  (working copy)
@@ -2,9 +2,10 @@
 , libjpeg, libpng, zlib, cairo, dbus, dbus_glib, bzip2, xlibs
 , gnomevfs, libgnomeui
 , freetype, fontconfig
-, application ? "browser" }:
+, xulrunner }:
 
 let version = "3.0.3-g1"; in
+
 stdenv.mkDerivation {
   name = "icecat-${version}";
 
@@ -21,15 +22,15 @@
     xlibs.libXi xlibs.libX11 xlibs.libXrender xlibs.libXft xlibs.libXt
   ];
 
+  propagatedBuildInputs = [xulrunner];
+
   unpackCmd = "lzma -d < $src | tar xv";
 
-  patches = [ ./skip-gre-registration.patch ];
+  #patches = [ ./skip-gre-registration.patch ];
 
   configureFlags = [
-    "--enable-application=${application}"
-    "--enable-libxul"
+    "--enable-application=browser"
     "--disable-javaxpcom"
-
     "--enable-optimize"
     "--disable-debug"
     "--disable-static"  # needed for `libxul'
@@ -41,48 +42,41 @@
     "--enable-system-cairo"
     #"--enable-system-sqlite" # <-- this seems to be discouraged
     "--disable-crashreporter"
+    "--with-libxul-sdk=${xulrunner}/lib/xulrunner-devel-${xulrunner.version}"
+
+    # From the original .mozconfig (which we delete below because it 
interferes with our settings):
+    "--with-user-appdir=.gnuzilla"
+    "--with-distribution-id=org.gnu.gnuzilla"
+    "--with-branding=browser/branding/unofficial"
   ];
 
-  preConfigure = ''export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -fPIC"'';
+  preConfigure = ''
+    rm .mozconfig
+    
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -fPIC"
 
-  postInstall = ''
-    export dontPatchELF=1;
+    # Fix a broken hard-coded reference to "firefox".
+    substituteInPlace browser/app/Makefile.in --replace bin/firefox 
'bin/$(MOZ_APP_NAME)'
 
+    # Remove a file that should not have been included in the IceCat
+    # distribution and which causes an incorrect build.  (The files in
+    # default/preferences will be elided because the generated file
+    # contains references to default/pref).
+    rm -f browser/installer/packages-static
+  '';
+
+  postInstall = ''
     # Strip some more stuff
     strip -S $out/lib/*/* || true
     
-    # This fixes starting IceCat when there already is a running
-    # instance.  The `icecat' wrapper script actually expects to be
-    # in the same directory as `run-mozilla.sh', apparently.
     libDir=$(cd $out/lib && ls -d icecat-[0-9]*)
     test -n "$libDir"
 
-    if [ -f "$out/bin/icecat" ]
-    then
-        # Fix references to /bin paths in the IceCat shell script.
-        substituteInPlace $out/bin/icecat              \
-            --replace /bin/pwd "$(type -tP pwd)"       \
-            --replace /bin/ls "$(type -tP ls)"
+    ln -s ${xulrunner}/lib/xulrunner-${xulrunner.version} 
$out/lib/$libDir/xulrunner
 
-        cd $out/bin
-        mv icecat ../lib/$libDir/
-        ln -s ../lib/$libDir/icecat .
-
-        # Register extensions etc.
-        echo "running \`icecat -register'..."
-        (cd $out/lib/$libDir && LD_LIBRARY_PATH=. ./icecat-bin -register) || 
false
-    fi
-
-    if [ -f "$out/lib/$libDir/xpidl" ]
-    then
-        # XulRunner's IDL compiler.
-        echo "linking \`xpidl'..."
-        ln -s "$out/lib/$libDir/xpidl" "$out/bin"
-    fi
-
-    # Put the GNU IceCat icon in the right place.
-    ensureDir $out/lib/$libDir/chrome/icons/default
-    ln -s ../../../icons/default.xpm  $out/lib/$libDir/chrome/icons/default/
+    # Register extensions etc. !!! is this needed anymore?
+    echo "running icecat -register..."
+    $out/bin/icecat -register
   ''; # */
 
   meta = {
@@ -108,5 +102,3 @@
     isFirefox3Like = true;
   };
 }
-
-
_______________________________________________
nix-dev mailing list
[email protected]
https://mail.cs.uu.nl/mailman/listinfo/nix-dev

Reply via email to