summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2008-07-28 15:55:11 +0000
committerLudovic Courtès <ludo@gnu.org>2008-07-28 15:55:11 +0000
commita898666dc497df6152c0c3b067b6fc0d88d85b01 (patch)
tree266d61592c1716d9ff5ce258024df4a9f6ac1f53
parentb0fb32ef3ca3c464a2ff21957e9e2a7c37d1d8df (diff)
Add GNU IceCat 3, GNU's free variant of Mozilla Firefox 3.
Currently, MPlayerPlugin can't be built with IceCat 3.

svn path=/nixpkgs/trunk/; revision=12437
-rw-r--r--pkgs/applications/networking/browsers/icecat-3/binary.nix55
-rw-r--r--pkgs/applications/networking/browsers/icecat-3/default.nix87
-rw-r--r--pkgs/top-level/all-packages.nix28
3 files changed, 162 insertions, 8 deletions
diff --git a/pkgs/applications/networking/browsers/icecat-3/binary.nix b/pkgs/applications/networking/browsers/icecat-3/binary.nix
new file mode 100644
index 0000000000000..73e002435b889
--- /dev/null
+++ b/pkgs/applications/networking/browsers/icecat-3/binary.nix
@@ -0,0 +1,55 @@
+args: with args;
+
+assert stdenv.system == "i686-linux";
+
+stdenv.mkDerivation {
+  name = "firefox-3b1";
+
+  src = 
+	fetchurl {
+		url = ftp://ftp.mozilla.org/pub/firefox/releases/3.0b1/linux-i686/en-US/firefox-3.0b1.tar.bz2;
+		sha256 = "1cpcc5b07zdqyd5kiwhb4dqhy2mzbf97plsglcp6bc9054cmsylk";
+	};
+  buildInputs = [
+    pkgconfig gtk perl zip libIDL libXi libjpeg libpng zlib cairo
+    python curl coreutils atk pango glib libX11 libXrender 
+    freetype fontconfig libXft libXt
+  ];
+
+  buildPhase = "
+    additionalRpath='';
+    for i in \$buildInputs ${stdenv.glibc} ${stdenv.gcc.gcc}; do 
+      additionalRpath=\$additionalRpath:\$i/lib;  
+    done
+    for i in firefox-bin ; do
+      oldrpath=$(patchelf --print-rpath \$i)
+      patchelf --set-rpath \$oldrpath\$additionalRpath \$i
+      patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux.so.2 \$i
+    done
+  ";
+
+  installPhase = "
+    export dontPatchELF=1;
+    mkdir -p \$out
+    cp -r . \$out/firefox
+    mkdir -p \$out/bin
+    ln -s \$out/firefox/firefox \$out/bin/firefox
+
+    sed -e 's@moz_libdir=.*@moz_libdir='\$out'/firefox/@' -i \$out/bin/firefox 
+    sed -e 's@moz_libdir=.*@&\\nexport PATH=\$PATH:${coreutils}/bin@' -i \$out/bin/firefox 
+    sed -e 's@`/bin/pwd@`${coreutils}/bin/pwd@' -i \$out/bin/firefox 
+    sed -e 's@`/bin/ls@`${coreutils}/bin/ls@' -i \$out/bin/firefox 
+
+    strip -S \$out/firefox/*.so || true
+
+    echo \"running firefox -register...\"
+    \$out/firefox/firefox-bin -register || false
+  ";
+
+  meta = {
+    description = "Mozilla Firefox - the browser, reloaded";
+  };
+
+  passthru = {inherit gtk;};
+}
+
diff --git a/pkgs/applications/networking/browsers/icecat-3/default.nix b/pkgs/applications/networking/browsers/icecat-3/default.nix
new file mode 100644
index 0000000000000..b377e41ef94ad
--- /dev/null
+++ b/pkgs/applications/networking/browsers/icecat-3/default.nix
@@ -0,0 +1,87 @@
+{ stdenv, fetchurl, lzma, pkgconfig, gtk, pango, perl, python, zip, libIDL
+, libjpeg, libpng, zlib, cairo, dbus, dbus_glib, bzip2, xlibs
+, freetype, fontconfig }:
+
+let version = "3.0.1-g1"; in
+stdenv.mkDerivation {
+  name = "icecat-${version}";
+
+  src = fetchurl {
+    url = "mirror://gnu/gnuzilla/${version}/icecat-${version}.tar.lzma";
+    sha256 = "042znp8zi5m6ihvm8lz4f07x27yjjqbs20sgzb114wrh0xa2mwd0";
+  };
+
+  buildInputs = [
+    lzma
+    pkgconfig gtk perl zip libIDL libjpeg libpng zlib cairo bzip2
+    python dbus dbus_glib pango freetype fontconfig
+    xlibs.libXi xlibs.libX11 xlibs.libXrender xlibs.libXft xlibs.libXt
+  ];
+
+  unpackCmd = "lzma -d < $src | tar xv";
+
+  configureFlags = [
+    "--enable-application=browser"
+    "--enable-optimize"
+    "--disable-debug"
+    "--enable-strip"
+    "--with-system-jpeg"
+    "--with-system-zlib"
+    "--with-system-bz2"
+    # "--with-system-png" # <-- "--with-system-png won't work because the system's libpng doesn't have APNG support"
+    "--enable-system-cairo" # <-- disabled for now because IceCat needs a alpha version of Cairo
+    #"--enable-system-sqlite" # <-- this seems to be discouraged
+    "--disable-crashreporter"
+  ];
+
+  postInstall = ''
+    export dontPatchELF=1;
+
+    # Strip some more stuff
+    strip -S $out/lib/*/* || true
+
+    # Fix some 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)"
+    
+    # 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"
+    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
+
+    # 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/
+  ''; # */
+
+  meta = {
+    description = "GNU IceCat, a free web browser based on Mozilla Firefox";
+
+    longDescription = ''
+      Gnuzilla is the GNU version of the Mozilla suite, and GNU IceCat
+      is the GNU version of the Firefox browser.  Its main advantage
+      is an ethical one: it is entirely free software.  While the
+      source code from the Mozilla project is free software, the
+      binaries that they release include additional non-free software.
+      Also, they distribute and recommend non-free software as
+      plug-ins.  In addition, GNU IceCat includes some privacy
+      protection features.
+    '';
+
+    homepage = http://www.gnu.org/software/gnuzilla/;
+    licenses = [ "GPLv2+" "LGPLv2+" "MPLv1+" ];
+  };
+
+  passthru = {inherit gtk;};
+}
+
+
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 9d4059b3776f0..18b07a41f3bdd 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -6126,6 +6126,15 @@ let pkgs = rec {
     inherit fetchurl stdenv pciutils;
   };
 
+  icecat3 = lowPrio (import ../applications/networking/browsers/icecat-3 {
+    inherit fetchurl stdenv lzma pkgconfig perl zip libjpeg libpng zlib cairo
+      python dbus dbus_glib freetype fontconfig bzip2 xlibs;
+    inherit (gtkLibs) gtk pango;
+    inherit (gnome) libIDL;
+  });
+
+  icecatWrapper = wrapFirefox icecat3 "";
+
   icewm = import ../applications/window-managers/icewm {
     inherit fetchurl stdenv gettext libjpeg libtiff libungif libpng imlib;
     inherit (xlibs) libX11 libXft libXext libXinerama libXrandr;
@@ -6321,11 +6330,13 @@ let pkgs = rec {
   };
   */
 
-  MPlayerPlugin = import ../applications/networking/browsers/mozilla-plugins/mplayerplug-in {
-    inherit fetchurl stdenv pkgconfig firefox gettext;
-    inherit (xlibs) libXpm;
-    # !!! should depend on MPlayer
-  };
+  MPlayerPlugin = browser:
+    import ../applications/networking/browsers/mozilla-plugins/mplayerplug-in {
+      firefox = browser;
+      inherit fetchurl stdenv pkgconfig gettext;
+      inherit (xlibs) libXpm;
+      # !!! should depend on MPlayer
+    };
 
   # commented out because it's using the new configuration style proposal which is unstable
   /*
@@ -6740,8 +6751,9 @@ let pkgs = rec {
     inherit stdenv fetchurl tcl tk x11 makeWrapper;
   };
 
-  wrapFirefox = firefox: nameSuffix: import ../applications/networking/browsers/firefox-wrapper {
-    inherit stdenv firefox nameSuffix makeWrapper;
+  wrapFirefox = browser: nameSuffix: import ../applications/networking/browsers/firefox-wrapper {
+    inherit stdenv nameSuffix makeWrapper;
+    firefox = browser;
     plugins =
       let enableAdobeFlash = getConfig [ "firefox" "enableAdobeFlash" ] true
             && system == "i686-linux";
@@ -6751,7 +6763,7 @@ let pkgs = rec {
         ++ lib.optional (enableAdobeFlash)  flashplayer
         # RealPlayer is disabled by default for legal reasons.
         ++ lib.optional (system != "i686-linux" && getConfig ["firefox" "enableRealPlayer"] false) RealPlayer
-        ++ lib.optional (getConfig ["firefox" "enableMPlayer"] true) MPlayerPlugin
+        ++ lib.optional (getConfig ["firefox" "enableMPlayer"] true) (MPlayerPlugin browser)
         ++ lib.optional (supportsJDK && getConfig ["firefox" "jre"] false && jrePlugin ? mozillaPlugin) jrePlugin
        );
   };