From d3884ed14ddcb33f2f1a74edf6a2fffbffbb85d8 Mon Sep 17 00:00:00 2001 From: "Yury G. Kudryashov" Date: Sat, 8 Dec 2007 01:06:33 +0000 Subject: [PATCH] Added Firefox 3 beta 1 (Minefield) svn path=/nixpkgs/branches/stdenv-updates/; revision=9878 --- .../networking/browsers/firefox3b1/builder.sh | 30 ++++++++++ .../browsers/firefox3b1/default.nix | 57 +++++++++++++++++++ .../browsers/firefox3b1/writable-copies.patch | 23 ++++++++ .../browsers/firefox3b1/xlibs.patch | 10 ++++ pkgs/top-level/all-packages.nix | 11 ++++ 5 files changed, 131 insertions(+) create mode 100644 pkgs/applications/networking/browsers/firefox3b1/builder.sh create mode 100644 pkgs/applications/networking/browsers/firefox3b1/default.nix create mode 100644 pkgs/applications/networking/browsers/firefox3b1/writable-copies.patch create mode 100644 pkgs/applications/networking/browsers/firefox3b1/xlibs.patch diff --git a/pkgs/applications/networking/browsers/firefox3b1/builder.sh b/pkgs/applications/networking/browsers/firefox3b1/builder.sh new file mode 100644 index 000000000000..66f1059d657f --- /dev/null +++ b/pkgs/applications/networking/browsers/firefox3b1/builder.sh @@ -0,0 +1,30 @@ +source $stdenv/setup + +postInstall=postInstall +postInstall() { + + # Strip some more stuff + strip -S $out/lib/*/* || true + + # 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-*) + test -n "$libDir" + cd $out/bin + mv firefox ../lib/$libDir/ + ln -s ../lib/$libDir/firefox . + + # Register extensions etc. + echo "running firefox -register..." + (cd $out/lib/$libDir && LD_LIBRARY_PATH=. ./firefox-bin -register) || false + + echo "running regxpcom..." + (cd $out/lib/$libDir && LD_LIBRARY_PATH=. ./regxpcom) || false + + # 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/ +} + +genericBuild diff --git a/pkgs/applications/networking/browsers/firefox3b1/default.nix b/pkgs/applications/networking/browsers/firefox3b1/default.nix new file mode 100644 index 000000000000..834376bb160c --- /dev/null +++ b/pkgs/applications/networking/browsers/firefox3b1/default.nix @@ -0,0 +1,57 @@ +args: with args; + +stdenv.mkDerivation { + name = "firefox-3b1"; + + src = + fetchurl { + url = ftp://ftp.mozilla.org/pub/firefox/releases/3.0b1/source/firefox-3.0b1-source.tar.bz2; + sha256 = "02mh87aidr33gp33fasq9xx23jqf7lm7yfsb2a36ijnd3bpnssn9"; + }; + + buildInputs = [ + pkgconfig gtk perl zip libIDL libXi libjpeg libpng zlib cairo + python curl coreutils + ]; + + configureFlags = [ + "--enable-application=browser" + "--enable-optimize" + "--disable-debug" + "--enable-xft" + "--disable-freetype2" + "--enable-svg" + "--enable-canvas" + "--enable-strip" + "--enable-default-toolkit=cairo-gtk2" + "--with-system-jpeg" + "--with-system-zlib" + /*"--enable-system-cairo"*/ + ] +; + + postConfigure = " + cp -r . /tmp/ff3b1-build + "; + + postInstall = " + 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/lib/*/* || true + + libDir=\$(cd \$out/lib && ls -d firefox-[0-9]*) + test -n \"\$libDir\" + + echo \"running firefox -register...\" + (cd \$out/lib/\$libDir && LD_LIBRARY_PATH=. ./firefox-bin -register) || false + "; + + meta = { + description = "Mozilla Firefox - the browser, reloaded"; + }; + + passthru = {inherit gtk;}; +} + diff --git a/pkgs/applications/networking/browsers/firefox3b1/writable-copies.patch b/pkgs/applications/networking/browsers/firefox3b1/writable-copies.patch new file mode 100644 index 000000000000..e3c7752c0310 --- /dev/null +++ b/pkgs/applications/networking/browsers/firefox3b1/writable-copies.patch @@ -0,0 +1,23 @@ +diff -rc mozilla-orig/xpcom/io/nsLocalFileUnix.cpp mozilla/xpcom/io/nsLocalFileUnix.cpp +*** mozilla-orig/xpcom/io/nsLocalFileUnix.cpp 2004-04-03 01:48:18.000000000 +0200 +--- mozilla/xpcom/io/nsLocalFileUnix.cpp 2004-10-05 19:48:04.000000000 +0200 +*************** +*** 634,639 **** +--- 634,640 ---- + // get the dirs old permissions + if (NS_FAILED(rv = GetPermissions(&oldPerms))) + return rv; ++ oldPerms |= 0200; + if (NS_FAILED(rv = newParent->Create(DIRECTORY_TYPE, oldPerms))) + return rv; + } else { // dir exists lets try to use leaf +*************** +*** 758,763 **** +--- 759,765 ---- + // get the old permissions + PRUint32 myPerms; + GetPermissions(&myPerms); ++ myPerms |= 0200; + + // Create the new file with the old file's permissions, even if write + // permission is missing. We can't create with write permission and diff --git a/pkgs/applications/networking/browsers/firefox3b1/xlibs.patch b/pkgs/applications/networking/browsers/firefox3b1/xlibs.patch new file mode 100644 index 000000000000..a656fbf9beb4 --- /dev/null +++ b/pkgs/applications/networking/browsers/firefox3b1/xlibs.patch @@ -0,0 +1,10 @@ +--- mozilla/layout/build/Makefile.in.orig 2007-01-13 14:23:19.000000000 -0200 ++++ mozilla/layout/build/Makefile.in 2007-01-13 14:24:55.000000000 -0200 +@@ -282,5 +282,6 @@ LDFLAGS += -Wl,-LD_LAYOUT:lgot_buffer=50 + endif + endif + ++LDFLAGS += -lX11 -lXrender + + export:: $(BUILD_DATE) + \ No newline at end of file diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1ef5b2ad6664..71317d25ed46 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3544,6 +3544,17 @@ rec { firefoxWrapper = wrapFirefox firefox; + firefox3b1 = lowPrio (import ../applications/networking/browsers/firefox3b1 { + inherit fetchurl stdenv pkgconfig perl zip libjpeg libpng zlib cairo + python curl coreutils; + inherit (gtkLibs) gtk; + inherit (gnome) libIDL; + inherit (xlibs) libXi; + #enableOfficialBranding = true; + }); + + firefox3b1Wrapper = wrapFirefox firefox3b1; + flac = import ../applications/audio/flac { inherit fetchurl stdenv libogg; };