Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Firefox with gnome support-let's get this in portage
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
IWBCMAN
Guru
Guru


Joined: 25 Jun 2002
Posts: 474

PostPosted: Thu Apr 14, 2005 10:06 am    Post subject: Firefox with gnome support-let's get this in portage Reply with quote

Morning guys,


Ok. I just noticed that the folks from Ubuntu managed to do something I have been longing for in Gentoo. So what better oppurtunity to play pirate and enrich Gentoo in the process...

The version of firefox I am talking about has full support for the gtk+ file selector(as in GTk 2.4/2.6). This presents us with a firefox which doesnt confuse new users due to differing file dialogs. What is not addressed in this version is an integrated print dialog using gnome-print...we still have to wait for this....


I managed to compile firefox-1.0.2 with the patches from the .deb for Ubuntu hoary. My problem is, and the reason I am posting here instaead of straight to bugzilla is that I have no knowledge of how to make my own patches or modify existing ones...So for those of you who know how to do such your help would be greatly appreciated...

I used the gentoo firefox-1.0.2-r1 ebuild as the basis for this new gnome-enabled version of firefox. I took this ebuild and commented out the patches in it trying each gentoo patch with and without the Ubunut patch to see if they work together, and if so which ones.

the diff of the sources for the Ubuntu gnome-support firefox version is to be found here:
******************************************CORRECTED****************************************************
http://archive.ubuntu.com/ubuntu/pool/main/m/mozilla-firefox/mozilla-firefox_1.0.2-0ubuntu5.diff.gz

this patch is the diff between the original firefox 1.0.2 source and the version used in Ubuntu Hoary.

I also used one patch included in the gentoo ebuild itself:
/usr/portage/www-client/mozilla-firefox/files/mozilla-firefox-1.0-4ft2.patch

this patch refers to mozilla bug # 234035 -it is a small modification and re-ordering of the original '--enable-freetype2'(id=162262) patch referenced on the mozilla bugzilla bug.

After multiple failed attempts to build firefox with these two patches I figured out that I also needed to apply the other patch listed on that bugzilla bug- 'gtk2-xft-only' (id=162261)

The problem is that the second patch in unmodified form does not successfully apply. ie. it fails. But it only fails because it cannot find where in the source file the patches should be applied. I know this because I broke down the emerge process into ebuild unpack/compile/install/qmerge and found that if I first applied the included gentoo patch (mozilla-firefox-1.0-4ft2.patch based on 162262) followed by the mozilla-firefox_1.0.2-0ubuntu5.diff.gz (from Ubunut Hoary) and then manually ie. with copy and paste, apply the 'gtk2-xft-only' (id=162261) patch, that firefox successfully builds and even more it works!

My test for this was:

comment all patches out in mozilla-firefox-1.0.2-r1.ebuild
ebuild .... unpack
cd /var/tmp/portage/mozilla-firefox-1.0.2-r1/work/mozilla
patch -p0 < ....mozilla-firefox-1.0-4ft2.patch
patch -p0 < ....mozilla-firefox_1.0.2-0ubuntu5.diff
and then manually modified 2 files according to 'gtk2-xft-only' (id=162261)
ebuild .... compile
ebuild .... install
ebuild .... qmerge

et voila! IT WORKS!

..........................................................................

ok I have managed to produce a patch...

I did the following:
comment all patches out of the ebuild except-in this order:

mozilla-firefox-1.0-4ft2.patch
mozilla-firefox_1.0.2-0ubuntu5.diff

then
ebuild .... unpack

and I copied the two files address by the third, as yet unapplied patch, to the /tmp/ directory:
/tmp/nsFontMetricsPS.cpp
/tmp/nsFontMetricsPS.h


then I cleaned up the portage tree (rm -rf /var/tmp/portage/*)
and proceeded to produce the original unpatched firefox source....

comment all patches out in mozilla-firefox-1.0.2-r1.ebuild
then
ebuild .... unpack
cd /var/tmp/portage/mozilla-firefox-1.0.2-r1/work/mozilla
diff -U 3 gfx/src/ps/nsFontMetricsPS.h /tmp/nsFontMetricsPS.h >> /tmp/mozilla-firefox-1.0.2-gtk-xft-only.diff
diff -U 3 gfx/src/ps/nsFontMetricsPS.cpp /tmp/nsFontMetricsPS.cpp >> /tmp/mozilla-firefox-1.0.2-gtk-xft-only.diff

then I copied :
/tmp/mozilla-firefox-1.0.2-gtk-xft-only.diff
to
/usr/portage/www-client/mozilla-firefox/files

something is still not quite right with the patch -pX option-ie. the patch I produced is only correctly applied by epatch if it starts in the right directory...

so I added:

cd ${S}/gfx && epatch ${FILESDIR}/mozilla-firefox-1.0.2-gtk-xft-only.diff && cd ${S}

AND IT WORKS!
.......................................................................

Now this will go down in the anals of the most horrible ebuilds history.....but here it goes

Code:

# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/www-client/mozilla-firefox/mozilla-firefox-1.0.2-r1.ebuild,v 1.4 2005/03/26 07:08:32 brad Exp $

inherit makeedit flag-o-matic gcc nsplugins eutils mozconfig mozilla-launcher multilib

S=${WORKDIR}/mozilla

DESCRIPTION="The Mozilla Firefox Web Browser"
HOMEPAGE="http://www.mozilla.org/projects/firefox/"
MY_PV=${PV/_rc/rc}
SRC_URI="http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${MY_PV}/source/firefox-${MY_PV}-source.tar.bz2"

LICENSE="MPL-1.1 NPL-1.1"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~sparc ~x86"
IUSE="java mozsvg file-picker"

# xrender.pc appeared for the first time in xorg-x11-6.7.0-r2
# and is required to build with support for cairo.  #71504
RDEPEND="java? ( virtual/jre )
        >=media-libs/libmng-1.0.0
        mozsvg? (
                >=x11-base/xorg-x11-6.7.0-r2
                x11-libs/cairo
        )
        >=www-client/mozilla-launcher-1.28"

DEPEND="${RDEPEND}
        java? ( >=dev-java/java-config-0.2.0 )"

# Needed by src_compile() and src_install().
# Would do in pkg_setup but that loses the export attribute, they
# become pure shell variables.
export MOZ_PHOENIX=1

src_unpack() {
        unpack firefox-${MY_PV}-source.tar.bz2 || die "unpack failed"
        cd ${S} || die "cd failed"

        # patch out ft caching code since the API changed between releases of
        # freetype; this enables freetype-2.1.8+ compat.
        # https://bugzilla.mozilla.org/show_bug.cgi?id=234035#c65
        epatch ${FILESDIR}/mozilla-firefox-1.0-4ft2.patch

        # this patch is already included in the debian patch listed below
        # patch to fix separate character on euro keyboards, bug 68995
        #epatch ${FILESDIR}/mozilla-firefox-1.0-kp_separator.patch

        # use Ubuntu patches for gnome integration-inlcudes kp_seperator patch bug 68995
        use file-picker && epatch ${FILESDIR}/mozilla-firefox_1.0.2-0ubuntu5.diff

        # my verown patch! based on 'gtk2-xft-only' (id=162261) from mozilla bugzilla bug id=234035
        cd ${S}/gfx && epatch ${FILESDIR}/mozilla-firefox-1.0.2-gtk-xft-only.diff && cd ${S}

        # alpha stubs patch from lfs project.
        # <taviso@gentoo.org> (26 Jun 2003)
#       use alpha && epatch ${FILESDIR}/mozilla-1.3-alpha-stubs.patch

        # hppa patches from Ivar <orskaug@stud.ntnu.no>
        # <gmsoft@gentoo.org> (22 Dec 2004)
#       use hppa && epatch ${FILESDIR}/mozilla-hppa.patch


       if has_version '>=x11-libs/cairo-0.3.0'; then
               epatch ${FILESDIR}/svg-cairo-0.3.0-fix.patch
       fi
}

src_compile() {
        ####################################
        #
        # mozconfig, CFLAGS and CXXFLAGS setup
        #
        ####################################

        mozconfig_init

        # Bug 60668: Galeon doesn't build without oji enabled, so enable it
        # regardless of java setting.
        mozconfig_annotate '' --enable-oji --enable-mathml

        # Other ff-specific settings
        mozconfig_use_enable mozdevelop jsd
        mozconfig_use_enable mozdevelop xpctools
        mozconfig_use_extension mozdevelop venkman
        mozconfig_use_enable gnome gnomevfs
        mozconfig_use_extension gnome gnomevfs
        mozconfig_use_enable mozsvg svg
        mozconfig_use_enable mozsvg svg-renderer-cairo
        mozconfig_annotate '' --with-default-mozilla-five-home=/usr/$(get_libdir)/MozillaFirefox
        mozconfig_annotate '' --prefix=/usr/$(get_libdir)/MozillaFirefox

        # Finalize and report settings
        mozconfig_final

        # hardened GCC uses -fstack-protector-all by default, and this breaks
        # firefox.
        has_hardened && append-flags -fno-stack-protector-all
        replace-flags -fstack-protector-all -fstack-protector

        ####################################
        #
        #  Configure and build Firefox
        #
        ####################################

        # ./configure picks up the mozconfig stuff
        export LD="$(tc-getLD)"
        export CC="$(tc-getCC)"
        export CXX="$(tc-getCXX)"
        econf

        # This removes extraneous CFLAGS from the Makefiles to reduce RAM
        # requirements while compiling
        edit_makefiles

        emake MOZ_PHOENIX=1 CXX="$(tc-getCXX)" CC="$(tc-getCC)" LD="$(tc-getLD)" || die
}

src_install() {
        # Plugin path creation
        PLUGIN_DIR="/usr/$(get_libdir)/nsbrowser/plugins"
        dodir ${PLUGIN_DIR}

        dodir /usr/$(get_libdir)/MozillaFirefox
        cp -RL --no-preserve=links ${S}/dist/bin/* ${D}/usr/$(get_libdir)/MozillaFirefox

        einfo "Installing includes and idl files..."
        # Copy the include and idl files
        dodir /usr/$(get_libdir)/MozillaFirefox/include/idl /usr/include
        cd ${S}/dist
        cp -LfR include/* ${D}/usr/$(get_libdir)/MozillaFirefox/include
        cp -LfR idl/* ${D}/usr/$(get_libdir)/MozillaFirefox/include/idl
        dosym /usr/$(get_libdir)/MozillaFirefox/include /usr/include/MozillaFirefox

        # Dirty hack to get some applications using this header running
        dosym /usr/$(get_libdir)/MozillaFirefox/include/necko/nsIURI.h /usr/lib/MozillaFirefox/include/nsIURI.h

        cd ${S}/build/unix
        # Fix firefox-config and install it
        sed -i -e "s:/lib/firefox-${MY_PV}:/$(get_libdir)/MozillaFirefox:g" firefox-config
        sed -i -e "s:/firefox-${MY_PV}:/MozillaFirefox:g" firefox-config
        exeinto /usr/$(get_libdir)/MozillaFirefox
        doexe firefox-config
        # Fix pkgconfig files and install them
        insinto /usr/$(get_libdir)/pkgconfig
        for x in *.pc; do
                        if [[ -f ${x} ]]; then
                                        sed -i -e
                                        "s:/lib/firefox-${MY_PV}:/$(get_libdir)/MozillaFirefox:g" ${x}
                                        sed -i -e "s:/firefox-${MY_PV}:/MozillaFirefox:g" ${x}
                                        doins ${x}
                        fi
        done
        cd ${S}


        #fix permissions
        chown -R root:root ${D}/usr/$(get_libdir)/MozillaFirefox

        # Plugin path setup (rescuing the existent plugins)
        src_mv_plugins /usr/$(get_libdir)/MozillaFirefox/plugins

        dodir /usr/bin
        cat <<EOF >${D}/usr/bin/firefox
#!/bin/sh
#
# Stub script to run mozilla-launcher.  We used to use a symlink here but
# OOo brokenness makes it necessary to use a stub instead:
# http://bugs.gentoo.org/show_bug.cgi?id=78890

export MOZILLA_LAUNCHER=firefox
exec /usr/libexec/mozilla-launcher "\$@"
EOF
chmod 0755 ${D}/usr/bin/firefox
        insinto /etc/env.d
        doins ${FILESDIR}/10MozillaFirefox

        # Fix icons to look the same everywhere
        insinto /usr/$(get_libdir)/MozillaFirefox/icons
        doins ${S}/build/package/rpm/SOURCES/mozicon16.xpm
        doins ${S}/build/package/rpm/SOURCES/mozicon50.xpm

        # Install icon and .desktop for menu entry
        insinto /usr/share/pixmaps
        doins ${FILESDIR}/icon/firefox-icon.png
        # Fix bug 54179: Install .desktop file into /usr/share/applications
        # instead of /usr/share/gnome/apps/Internet (18 Jun 2004 agriffis)
        insinto /usr/share/applications
        doins ${FILESDIR}/icon/mozillafirefox.desktop

        # Normally firefox-0.9 must be run as root once before it can be
        # run as a normal user.  Drop in some initialized files to avoid
        # this.
        einfo "Extracting firefox-${PV} initialization files"
        tar xjpf ${FILESDIR}/firefox-0.9-init.tar.bz2 -C ${D}/usr/$(get_libdir)/MozillaFirefox
}

pkg_preinst() {
        export MOZILLA_FIVE_HOME=${ROOT}/usr/$(get_libdir)/MozillaFirefox

        # Remove the old plugins dir
        pkg_mv_plugins /usr/$(get_libdir)/MozillaFirefox/plugins

        # Remove entire installed instance to prevent all kinds of
        # problems... see bug 44772 for example
        rm -rf "${MOZILLA_FIVE_HOME}"
}

pkg_postinst() {
        export MOZILLA_FIVE_HOME="${ROOT}/usr/$(get_libdir)/MozillaFirefox"

        # Needed to update the run time bindings for REGXPCOM
        # (do not remove next line!)
        env-update

        # Register Components and Chrome
        #
        # Bug 67031: Set HOME=~root in case this is being emerged via sudo.
        # Otherwise the following commands will create ~/.mozilla owned by root
        # and 700 perms, which makes subsequent execution of firefox by user
        # impossible.
        einfo "Registering Components and Chrome..."
        HOME=~root LD_LIBRARY_PATH=/usr/$(get_libdir)/MozillaFirefox ${MOZILLA_FIVE_HOME}/regxpcom
        HOME=~root LD_LIBRARY_PATH=/usr/$(get_libdir)/MozillaFirefox ${MOZILLA_FIVE_HOME}/regchrome

        # Fix permissions of component registry
        chmod 0644 ${MOZILLA_FIVE_HOME}/components/compreg.dat

        # Fix directory permissions
        find ${MOZILLA_FIVE_HOME}/ -type d -perm 0700 -exec chmod 0755 {} \; || :

        # Fix permissions on chrome files
        find ${MOZILLA_FIVE_HOME}/chrome/ -name '*.rdf' -exec chmod 0644 {} \; || :

        # This should be called in the postinst and postrm of all the
        # mozilla, mozilla-bin, firefox, firefox-bin, thunderbird and
        # thunderbird-bin ebuilds.
        update_mozilla_launcher_symlinks
}

pkg_postrm() {
        update_mozilla_launcher_symlinks
}





Ok... this post may have been somewhat confusing as I figured out how to do what I wanted to do as I was writing this....However some work probably still has to be done to get this into the gentoo bugzilla. I'll recap this little adventure for those who got confused along the way:

try this in your local portage overlay....

download the following patch:
http://ftp.debian.org/debian/pool/main/m/mozilla-firefox/mozilla-firefox_1.0.2-3.diff.gz

gunzip this patch and place it in $PORTDIR_OVERLY/www-client/mozilla-firefox/files

now copy and paste the following patch, named :mozilla-firefox-1.0.2-gtk-xft-only.diff
Code:

--- gfx/src/ps/nsFontMetricsPS.h        2005-04-14 11:01:14.481521848 +0200
+++ /tmp/nsFontMetricsPS.h.fixed        2005-04-14 10:49:59.852081112 +0200
@@ -342,10 +342,7 @@

 protected:
   PRUint16        mPixelSize;
-  FTC_Image_Desc  mImageDesc;
   FT_Library      mFreeTypeLibrary;
-  FTC_Manager     mFTCacheManager;
-  FTC_Image_Cache mImageCache;

   int     ascent();
   int     descent();
@@ -480,9 +477,7 @@

 protected:
   nsXftEntry *mEntry;
-  FTC_Image_Desc  mImageDesc;
   FT_Library      mFreeTypeLibrary;
-  FTC_Manager     mFTCacheManager;
 };
 #else
 #ifdef MOZ_ENABLE_FREETYPE2
--- gfx/src/ps/nsFontMetricsPS.cpp      2005-04-14 11:01:14.478522304 +0200
+++ /tmp/nsFontMetricsPS.cpp.fixed      2005-04-14 10:55:53.227359904 +0200
@@ -1029,20 +1029,6 @@
   return nsnull;
 }

-/*FT_CALLBACK_DEF*/
-FT_Error
-nsXftFaceRequester(FTC_FaceID face_id, FT_Library lib,
-                  FT_Pointer request_data, FT_Face* aFace)
-{
-  nsXftEntry *faceID = (nsXftEntry *)face_id;
-
-  FT_Error fterror = FT_New_Face(lib, faceID->mFontFileName.get(),
-                                 faceID->mFaceIndex, aFace);
-  if (fterror)
-    *aFace = nsnull;
-  return 0;
-}
-
 nsFontPSXft::nsFontPSXft(const nsFont& aFont,
                                    nsFontMetricsPS* aFontMetrics)
   :nsFontPS(aFont, aFontMetrics)
@@ -1064,35 +1050,20 @@

   mPixelSize = NSToIntRound(app2dev * mFont->size);

-  mImageDesc.font.face_id    = (void*)mEntry;
-  mImageDesc.font.pix_width  = mPixelSize;
-  mImageDesc.font.pix_height = mPixelSize;
-  mImageDesc.image_type = 0;
-
   FT_Error fterror;
   fterror = FT_Init_FreeType(&mFreeTypeLibrary);
   if (fterror) {
-    NS_ASSERTION(!fterror, "failed to initialize FreeType library");
+    NS_ERROR("failed to initialize FreeType library");
     mFreeTypeLibrary = nsnull;
     return NS_ERROR_FAILURE;
   }
-  fterror = FTC_Manager_New(mFreeTypeLibrary, 0, 0, 0, nsXftFaceRequester,
-                  NULL, &mFTCacheManager);
-  NS_ASSERTION(!fterror, "failed to create FreeType Cache manager");
-  if (fterror)
-    return NS_ERROR_FAILURE;
-
-  fterror = FTC_Image_Cache_New(mFTCacheManager, &mImageCache);
-  NS_ASSERTION(!fterror, "failed to create FreeType image cache");
-  if (fterror)
-    return NS_ERROR_FAILURE;
-
   return NS_OK;
 }

 nsFontPSXft::~nsFontPSXft()
 {
-  FTC_Manager_Done(mFTCacheManager);
+  if (mEntry->mFace)
+    FT_Done_Face(mEntry->mFace);

   if (FT_Done_FreeType(mFreeTypeLibrary))
     return;
@@ -1103,16 +1074,14 @@
 FT_Face
 nsFontPSXft::getFTFace()
 {
-  FT_Error error;
   FT_Face face = mEntry->mFace;

   if (face)
     return (face);

-  error = FTC_Manager_Lookup_Size(mFTCacheManager, &mImageDesc.font,
-                                  &face, nsnull);
-  NS_ASSERTION(error == 0, "failed to get face/size");
-  if (error)
+  if (FT_New_Face(mFreeTypeLibrary, mEntry->mFontFileName.get(),
+                  mEntry->mFaceIndex, &face) ||
+      FT_Set_Pixel_Sizes(face, mPixelSize, 0))
     return nsnull;

   mEntry->mFace = face;
@@ -1152,13 +1121,13 @@

   for (PRUint32 i=0; i<aLength; i++) {
     glyph_index = FT_Get_Char_Index((FT_Face)face, aString[i]);
-    FT_Error error = FTC_Image_Cache_Lookup(mImageCache, &mImageDesc,
-                                            glyph_index, &glyph);
-    if (error) {
+    if (FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT) ||
+        FT_Get_Glyph(face->glyph, &glyph)) {
       origin_x += FT_REG_TO_16_16(face->size->metrics.x_ppem/2 + 2);
       continue;
     }
     origin_x += glyph->advance.x;
+    FT_Done_Glyph(glyph);
   }

   NS_ENSURE_TRUE(mFontMetrics, 0);
@@ -2416,19 +2385,14 @@
     mFreeTypeLibrary = nsnull;
     return NS_ERROR_FAILURE;
   }
-  error = FTC_Manager_New(mFreeTypeLibrary, 0, 0, 0, nsXftFaceRequester,
-                          NULL, &mFTCacheManager);
-  NS_ASSERTION(!error, "failed to create FreeType Cache manager");
-  if (error)
-    return NS_ERROR_FAILURE;

   return NS_OK;
 }

 nsXftType8Generator::~nsXftType8Generator()
 {
-  FTC_Manager_Done(mFTCacheManager);
-
+  if (mEntry->mFace)
+    FT_Done_Face(mEntry->mFace);
   if (FT_Done_FreeType(mFreeTypeLibrary))
     return;

@@ -2437,23 +2401,15 @@

 void nsXftType8Generator::GeneratePSFont(FILE* aFile)
 {
-  FT_Error error;
   FT_Face face = mEntry->mFace;

   if (face == nsnull) {
-    mImageDesc.font.face_id    = (void*)mEntry;
-    mImageDesc.font.pix_width  = 16;
-    mImageDesc.font.pix_height = 16;
-    mImageDesc.image_type = 0;
-    error = FTC_Manager_Lookup_Size(mFTCacheManager, &mImageDesc.font,
-                                    &face, nsnull);
-    if (error)
-      return;
+    if (FT_New_Face(mFreeTypeLibrary, mEntry->mFontFileName.get(), mEntry->mFaceIndex, &face) ||
+        face == nsnull /* || FT_Set_Pixel_Sizes(face, 16, 0) */)
+       return;
+     mEntry->mFace = face;
   }

-  if (face == nsnull)
-    return;
-
   int wmode = 0;
   if (!mSubset.IsEmpty())
     FT2SubsetToType8(face, mSubset.get(), mSubset.Length(), wmode, aFile);



and save this in $PORTDIR_OVERLY/www-client/mozilla-firefox/files

Now take the ebuild given above and save it in $PORTDIR_OVERLY/www-client/mozilla-firefox

then do a:

ebuild $PORTDIR_OVERLY/www-client/mozilla-firefox/mozilla-firefox-1.0.2-r1.ebuild digest

and then

emerge -av mozilla-firefox

Note: you may first need to do a:
echo "=www-client/mozilla-firefox-1.0.2-r1 ~x86" >> /etc/portage/package.keywords

Now you should be asked whether or not you wish to emerge the new firefox

If you pay attention you will notice a new USE flag

this USE flag is called 'file-picker'

The patch from Ubuntu and the patch I listed above will only be applied if you put 'file-picker' in your /etc/make.conf USE flags or use the command line option:

USE="file-picker" emerge -av mozilla-firefox


Note I commented out the alpha and hppa patches---they are probably unaffected by the patches I have give here---but I can't test them...so YMMV.

any suggestions or tips for helping me get this into proper form for gentoo bugzilla would be greatly appreciated.......


Please excuse the length of this post but I am sure a few others may appreciate actually having
a firefox which properly integrates with gnome......

so what can be improved ?
what should be changed ?
what is obvious that I am overlooking ?

thanks for the help......

+++++edit++++++
replace mozilla-firefox_1.0.2-3.diff with correct ubuntu patch ...
http://archive.ubuntu.com/ubuntu/pool/main/m/mozilla-firefox/mozilla-firefox_1.0.2-0ubuntu5.diff.gz


Last edited by IWBCMAN on Fri Apr 15, 2005 11:05 am; edited 1 time in total
Back to top
View user's profile Send private message
allex87
Apprentice
Apprentice


Joined: 02 Aug 2003
Posts: 154
Location: Ontario, Canada

PostPosted: Thu Apr 14, 2005 10:44 am    Post subject: Reply with quote

Looks good! I'm emerging it right now :) I'll post back the results when I have them!

Alex.
Back to top
View user's profile Send private message
buchan
n00b
n00b


Joined: 14 Aug 2003
Posts: 25
Location: Ottawa, Ontario

PostPosted: Thu Apr 14, 2005 4:31 pm    Post subject: Reply with quote

Ah so Ubuntu's Firefox was different! I always noticed something weird about FF while using a Ubuntu box.

Great work. Will give it a shot later today.
Back to top
View user's profile Send private message
wilburpan
l33t
l33t


Joined: 21 Jan 2003
Posts: 977

PostPosted: Thu Apr 14, 2005 4:35 pm    Post subject: Reply with quote

This is very cool! But what is the difference between a Gnome-ified Firefox and Epiphany built against Firefox headers, which can be done since mozilla-firefox-1.0.2-r1?
_________________
I'm only hanging out in OTW until I get rid of this stupid l33t ranking.....Crap. That didn't work.
Back to top
View user's profile Send private message
IWBCMAN
Guru
Guru


Joined: 25 Jun 2002
Posts: 474

PostPosted: Thu Apr 14, 2005 5:41 pm    Post subject: Reply with quote

well of course galeon/epiphany offer the most in terms of gnome integration-they are both gnome applications. But the gnome-ified firefox is a) firefox and NOT epiphany b) now almost completely integrated into gnome(with the exception of the print dialog).

Firefox has better and more extensions, has a pull down URL with history and type ahead find, and is generally much, much more feature rich than epiphany.

Actually my question is why do we need epiphany with firefox being seemlessly integrated into the gnome desktop ?
Back to top
View user's profile Send private message
Lokheed
Veteran
Veteran


Joined: 12 Jul 2004
Posts: 1295
Location: /usr/src/linux

PostPosted: Thu Apr 14, 2005 5:42 pm    Post subject: Reply with quote

Lets clear the air. Ubuntu has done NOTHING here. This Firefox is the trunk build. The branches fork from her and get released as milestones. This trunk build is a strictly development build and has encorporated the new GTK file browser, a new Preferences UI and a few other changes.

Ubuntu didnt hack a thing and deserves no credit here. If you want to try them, go to the mozilla forums and download the latest nightly to play with. It should also be made aware that Thunderbird also has a trunk build. You dont need patches, just install the trunk builds...

These have been out for months now and are far from new...

Firefox: http://forums.mozillazine.org/viewtopic.php?t=249998

Thunderbird: http://forums.mozillazine.org/viewtopic.php?t=250076

NOTE: The new trunk build of Thunderbird no longer works with Enigmail so GPG is not available. The creator of Enignmail is working on a trunk version but it still crashes Thunderbird at the moment.
_________________
You're not afraid of the dark are you?


Last edited by Lokheed on Thu Apr 14, 2005 5:44 pm; edited 1 time in total
Back to top
View user's profile Send private message
Lokheed
Veteran
Veteran


Joined: 12 Jul 2004
Posts: 1295
Location: /usr/src/linux

PostPosted: Thu Apr 14, 2005 5:43 pm    Post subject: Reply with quote

IWBCMAN wrote:
Actually my question is why do we need epiphany with firefox being seemlessly integrated into the gnome desktop ?


Because its not integrated into the Gnome desktop. Its a fully compliant GTK app (trunk build) and thats all. It doesnt have any relation to Gnome...its just coded to make proper use of GTK now.
_________________
You're not afraid of the dark are you?
Back to top
View user's profile Send private message
IWBCMAN
Guru
Guru


Joined: 25 Jun 2002
Posts: 474

PostPosted: Thu Apr 14, 2005 5:57 pm    Post subject: Reply with quote

Lokheed,

thanks for the info-was unaware of this. However Ubuntu is the only distribution I am aware of which actually has chose the gnome-ified Firefox as their standard browser-neither, SUSE, Fedora Core or Mandrake offer it. In my opinion Ubuntu deserves some credit for actually pushing this development by setting it as their default browser. Also the ebuild and patches I posted provide a number of bug fixes and changes not in the trunk source.
Back to top
View user's profile Send private message
IWBCMAN
Guru
Guru


Joined: 25 Jun 2002
Posts: 474

PostPosted: Thu Apr 14, 2005 6:02 pm    Post subject: Reply with quote

Lokheed,

This version of Firefox fits very smoothely into the gnome desktop. It works with gnome-vfs, the mime-type settings you use in your gnome desktop and now the file open/save dialogs are native-ie. the same ones in use in gnome. With the exception of print dialog and possibly epiphany's bookmark system epiphany offers no integration benefits over this version of Firefox excepting of course the HIG-which in epiphany's case has lead to such a spartan selection of options and control that the functionality is actually delimited.

Once the print dialog is changed to use of gnome-print I think the utility of epiphany becomes questionable....
Back to top
View user's profile Send private message
IWBCMAN
Guru
Guru


Joined: 25 Jun 2002
Posts: 474

PostPosted: Thu Apr 14, 2005 6:04 pm    Post subject: Reply with quote

aside from the fact that Firefox actually has a wealth of good quality and usefull extensions which will probably never exist for epiphany.....


and.....


This ebuild for Firefox, gnome-ified Firefox, is new to portage. And if it were not for having seen this in Ubuntu I would not have know that this work had already been done....So yes it is new for all those who have not had access to it, ie. through lack of knowledge, lack of know how....Anyway I didn't do all of this work just to start a pissing contest about the relative merits of Firefox....
Back to top
View user's profile Send private message
Lokheed
Veteran
Veteran


Joined: 12 Jul 2004
Posts: 1295
Location: /usr/src/linux

PostPosted: Thu Apr 14, 2005 6:14 pm    Post subject: Reply with quote

IWBCMAN wrote:
Also the ebuild and patches I posted provide a number of bug fixes and changes not in the trunk source.


If thats true, please submit them upstream to Mozilla. Ubuntu impresses me more and more about how bleeding edge it has become. The newest hoary boasts the latest Xorg, the latest Gnome, etc. They are certainly the binary distro I would go to if I ever had to use one. Looks like Debian is not too happy about this fact though as they say Ubuntu programs wont install on Sarge anymore...cant make everyone happy but Ubuntu is just huge now. I think the majority are running it and its converted a lot of people...

Anyhoo, since the trunk is under heavy development, everyday you fall behind, you lose a good 5 to 8 fixes...daily.
_________________
You're not afraid of the dark are you?
Back to top
View user's profile Send private message
allex87
Apprentice
Apprentice


Joined: 02 Aug 2003
Posts: 154
Location: Ontario, Canada

PostPosted: Thu Apr 14, 2005 11:40 pm    Post subject: Reply with quote

ICBWMAN,

You don't post a link to the patch file: mozilla-firefox_1.0.2-0ubuntu5.diff that you included in your ebuild. I just got home and saw that firefox didn't build.. lol stopped at:

Code:

idaho mozilla-firefox # emerge mozilla-firefox -av

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild   R   ] www-client/mozilla-firefox-1.0.2-r1  -debug +file-picker* +gnome +java +ldap +mozdevelop -moznoxft +mozsvg -mozxmlterm -xinerama +xprint 0 kB [1]

Total size of downloads: 0 kB
Portage overlays:
 [1] /usr/local/portage

Do you want me to merge these packages? [Yes/No] y
>>> emerge (1 of 1) www-client/mozilla-firefox-1.0.2-r1 to /
>>> md5 src_uri ;-) firefox-1.0.2-source.tar.bz2
>>> Unpacking source...
>>> Unpacking firefox-1.0.2-source.tar.bz2 to /var/tmp/portage/mozilla-firefox-1.0.2-r1/work
 * Applying mozilla-firefox-1.0-4ft2.patch ...                                                                          [ ok ]

 * Cannot find $EPATCH_SOURCE!  Value for $EPATCH_SOURCE is:
 *
 *   /usr/local/portage/www-client/mozilla-firefox/files/mozilla-firefox_1.0.2-0ubuntu5.diff
 *   ( mozilla-firefox_1.0.2-0ubuntu5.diff )


!!! ERROR: www-client/mozilla-firefox-1.0.2-r1 failed.
!!! Function epatch, Line 215, Exitcode 0
!!! Cannot find $EPATCH_SOURCE!
!!! If you need support, post the topmost build error, NOT this status message.


Great progress :P


And Yes, Ubuntu is what I would use for a binary distro. My parents' computer is running ubuntu right now :) too slow to compile :P
Back to top
View user's profile Send private message
IWBCMAN
Guru
Guru


Joined: 25 Jun 2002
Posts: 474

PostPosted: Fri Apr 15, 2005 12:04 am    Post subject: Reply with quote

sorry for the misunderstanding....


the ubuntu patch is in gzippe'ed form and is available at
******************************CORRECTED***************************************************
http://archive.ubuntu.com/ubuntu/pool/main/m/mozilla-firefox/mozilla-firefox_1.0.2-0ubuntu5.diff.gz

*************************************************************************************************
which of course I could have just built into the ebuild......;)


does epatch deal with gzipp'ed files?

if so the following may work:


Code:

# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/www-client/mozilla-firefox/mozilla-firefox-1.0.2-r1.ebuild,v 1.4 2005/03/26 07:08:32 brad Exp $

inherit makeedit flag-o-matic gcc nsplugins eutils mozconfig mozilla-launcher multilib

S=${WORKDIR}/mozilla

DESCRIPTION="The Mozilla Firefox Web Browser"
HOMEPAGE="http://www.mozilla.org/projects/firefox/"
MY_PV=${PV/_rc/rc}
SRC_URI="http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${MY_PV}/source/firefox-${MY_PV}-source.tar.bz2
                  http://ftp.debian.org/debian/pool/main/m/mozilla-firefox/mozilla-firefox_1.0.2-3.diff.gz"

LICENSE="MPL-1.1 NPL-1.1"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~sparc ~x86"
IUSE="java mozsvg file-picker"

# xrender.pc appeared for the first time in xorg-x11-6.7.0-r2
# and is required to build with support for cairo.  #71504
RDEPEND="java? ( virtual/jre )
        >=media-libs/libmng-1.0.0
        mozsvg? (
                >=x11-base/xorg-x11-6.7.0-r2
                x11-libs/cairo
        )
        >=www-client/mozilla-launcher-1.28"

DEPEND="${RDEPEND}
        java? ( >=dev-java/java-config-0.2.0 )"

# Needed by src_compile() and src_install().
# Would do in pkg_setup but that loses the export attribute, they
# become pure shell variables.
export MOZ_PHOENIX=1

src_unpack() {
        unpack firefox-${MY_PV}-source.tar.bz2 || die "unpack failed"
        cd ${S} || die "cd failed"

        # patch out ft caching code since the API changed between releases of
        # freetype; this enables freetype-2.1.8+ compat.
        # https://bugzilla.mozilla.org/show_bug.cgi?id=234035#c65
        epatch ${FILESDIR}/mozilla-firefox-1.0-4ft2.patch

        # this patch is already included in the debian patch listed below
        # patch to fix separate character on euro keyboards, bug 68995
        #epatch ${FILESDIR}/mozilla-firefox-1.0-kp_separator.patch

        # use Ubuntu patches for gnome integration-inlcudes kp_seperator patch bug 68995
        use file-picker && epatch ${FILESDIR}/mozilla-firefox_1.0.2-0ubuntu5.diff

        # my verown patch! based on 'gtk2-xft-only' (id=162261) from mozilla bugzilla bug id=234035
        cd ${S}/gfx && epatch ${FILESDIR}/mozilla-firefox-1.0.2-gtk-xft-only.diff && cd ${S}

        # alpha stubs patch from lfs project.
        # <taviso@gentoo.org> (26 Jun 2003)
#       use alpha && epatch ${FILESDIR}/mozilla-1.3-alpha-stubs.patch

        # hppa patches from Ivar <orskaug@stud.ntnu.no>
        # <gmsoft@gentoo.org> (22 Dec 2004)
#       use hppa && epatch ${FILESDIR}/mozilla-hppa.patch


       if has_version '>=x11-libs/cairo-0.3.0'; then
               epatch ${FILESDIR}/svg-cairo-0.3.0-fix.patch
       fi
}

src_compile() {
        ####################################
        #
        # mozconfig, CFLAGS and CXXFLAGS setup
        #
        ####################################

        mozconfig_init

        # Bug 60668: Galeon doesn't build without oji enabled, so enable it
        # regardless of java setting.
        mozconfig_annotate '' --enable-oji --enable-mathml

        # Other ff-specific settings
        mozconfig_use_enable mozdevelop jsd
        mozconfig_use_enable mozdevelop xpctools
        mozconfig_use_extension mozdevelop venkman
        mozconfig_use_enable gnome gnomevfs
        mozconfig_use_extension gnome gnomevfs
        mozconfig_use_enable mozsvg svg
        mozconfig_use_enable mozsvg svg-renderer-cairo
        mozconfig_annotate '' --with-default-mozilla-five-home=/usr/$(get_libdir)/MozillaFirefox
        mozconfig_annotate '' --prefix=/usr/$(get_libdir)/MozillaFirefox

        # Finalize and report settings
        mozconfig_final

        # hardened GCC uses -fstack-protector-all by default, and this breaks
        # firefox.
        has_hardened && append-flags -fno-stack-protector-all
        replace-flags -fstack-protector-all -fstack-protector

        ####################################
        #
        #  Configure and build Firefox
        #
        ####################################

        # ./configure picks up the mozconfig stuff
        export LD="$(tc-getLD)"
        export CC="$(tc-getCC)"
        export CXX="$(tc-getCXX)"
        econf

        # This removes extraneous CFLAGS from the Makefiles to reduce RAM
        # requirements while compiling
        edit_makefiles

        emake MOZ_PHOENIX=1 CXX="$(tc-getCXX)" CC="$(tc-getCC)" LD="$(tc-getLD)" || die
}

src_install() {
        # Plugin path creation
        PLUGIN_DIR="/usr/$(get_libdir)/nsbrowser/plugins"
        dodir ${PLUGIN_DIR}

        dodir /usr/$(get_libdir)/MozillaFirefox
        cp -RL --no-preserve=links ${S}/dist/bin/* ${D}/usr/$(get_libdir)/MozillaFirefox

        einfo "Installing includes and idl files..."
        # Copy the include and idl files
        dodir /usr/$(get_libdir)/MozillaFirefox/include/idl /usr/include
        cd ${S}/dist
        cp -LfR include/* ${D}/usr/$(get_libdir)/MozillaFirefox/include
        cp -LfR idl/* ${D}/usr/$(get_libdir)/MozillaFirefox/include/idl
        dosym /usr/$(get_libdir)/MozillaFirefox/include /usr/include/MozillaFirefox

        # Dirty hack to get some applications using this header running
        dosym /usr/$(get_libdir)/MozillaFirefox/include/necko/nsIURI.h /usr/lib/MozillaFirefox/include/nsIURI.h

        cd ${S}/build/unix
        # Fix firefox-config and install it
        sed -i -e "s:/lib/firefox-${MY_PV}:/$(get_libdir)/MozillaFirefox:g" firefox-config
        sed -i -e "s:/firefox-${MY_PV}:/MozillaFirefox:g" firefox-config
        exeinto /usr/$(get_libdir)/MozillaFirefox
        doexe firefox-config
        # Fix pkgconfig files and install them
        insinto /usr/$(get_libdir)/pkgconfig
        for x in *.pc; do
                        if [[ -f ${x} ]]; then
                                        sed -i -e
                                        "s:/lib/firefox-${MY_PV}:/$(get_libdir)/MozillaFirefox:g" ${x}
                                        sed -i -e "s:/firefox-${MY_PV}:/MozillaFirefox:g" ${x}
                                        doins ${x}
                        fi
        done
        cd ${S}


        #fix permissions
        chown -R root:root ${D}/usr/$(get_libdir)/MozillaFirefox

        # Plugin path setup (rescuing the existent plugins)
        src_mv_plugins /usr/$(get_libdir)/MozillaFirefox/plugins

        dodir /usr/bin
        cat <<EOF >${D}/usr/bin/firefox
#!/bin/sh
#
# Stub script to run mozilla-launcher.  We used to use a symlink here but
# OOo brokenness makes it necessary to use a stub instead:
# http://bugs.gentoo.org/show_bug.cgi?id=78890

export MOZILLA_LAUNCHER=firefox
exec /usr/libexec/mozilla-launcher "\$@"
EOF
chmod 0755 ${D}/usr/bin/firefox
        insinto /etc/env.d
        doins ${FILESDIR}/10MozillaFirefox

        # Fix icons to look the same everywhere
        insinto /usr/$(get_libdir)/MozillaFirefox/icons
        doins ${S}/build/package/rpm/SOURCES/mozicon16.xpm
        doins ${S}/build/package/rpm/SOURCES/mozicon50.xpm

        # Install icon and .desktop for menu entry
        insinto /usr/share/pixmaps
        doins ${FILESDIR}/icon/firefox-icon.png
        # Fix bug 54179: Install .desktop file into /usr/share/applications
        # instead of /usr/share/gnome/apps/Internet (18 Jun 2004 agriffis)
        insinto /usr/share/applications
        doins ${FILESDIR}/icon/mozillafirefox.desktop

        # Normally firefox-0.9 must be run as root once before it can be
        # run as a normal user.  Drop in some initialized files to avoid
        # this.
        einfo "Extracting firefox-${PV} initialization files"
        tar xjpf ${FILESDIR}/firefox-0.9-init.tar.bz2 -C ${D}/usr/$(get_libdir)/MozillaFirefox
}

pkg_preinst() {
        export MOZILLA_FIVE_HOME=${ROOT}/usr/$(get_libdir)/MozillaFirefox

        # Remove the old plugins dir
        pkg_mv_plugins /usr/$(get_libdir)/MozillaFirefox/plugins

        # Remove entire installed instance to prevent all kinds of
        # problems... see bug 44772 for example
        rm -rf "${MOZILLA_FIVE_HOME}"
}

pkg_postinst() {
        export MOZILLA_FIVE_HOME="${ROOT}/usr/$(get_libdir)/MozillaFirefox"

        # Needed to update the run time bindings for REGXPCOM
        # (do not remove next line!)
        env-update

        # Register Components and Chrome
        #
        # Bug 67031: Set HOME=~root in case this is being emerged via sudo.
        # Otherwise the following commands will create ~/.mozilla owned by root
        # and 700 perms, which makes subsequent execution of firefox by user
        # impossible.
        einfo "Registering Components and Chrome..."
        HOME=~root LD_LIBRARY_PATH=/usr/$(get_libdir)/MozillaFirefox ${MOZILLA_FIVE_HOME}/regxpcom
        HOME=~root LD_LIBRARY_PATH=/usr/$(get_libdir)/MozillaFirefox ${MOZILLA_FIVE_HOME}/regchrome

        # Fix permissions of component registry
        chmod 0644 ${MOZILLA_FIVE_HOME}/components/compreg.dat

        # Fix directory permissions
        find ${MOZILLA_FIVE_HOME}/ -type d -perm 0700 -exec chmod 0755 {} \; || :

        # Fix permissions on chrome files
        find ${MOZILLA_FIVE_HOME}/chrome/ -name '*.rdf' -exec chmod 0644 {} \; || :

        # This should be called in the postinst and postrm of all the
        # mozilla, mozilla-bin, firefox, firefox-bin, thunderbird and
        # thunderbird-bin ebuilds.
        update_mozilla_launcher_symlinks
}

pkg_postrm() {
        update_mozilla_launcher_symlinks
}





+++++++++++++edit+++++++++++++
removed refernece to debian patch and replaced with correct ubuntu patch


Last edited by IWBCMAN on Fri Apr 15, 2005 11:07 am; edited 1 time in total
Back to top
View user's profile Send private message
allex87
Apprentice
Apprentice


Joined: 02 Aug 2003
Posts: 154
Location: Ontario, Canada

PostPosted: Fri Apr 15, 2005 1:12 am    Post subject: Reply with quote

Nope... :(

Look, when you gunzip http://ftp.debian.org/debian/pool/main/m/mozilla-firefox/mozilla-firefox_1.0.2-3.diff.gz, the extracted file has the name mozilla-firefox_1.0.2-3.diff, not the -ubuntusomething file name. I changed the file names in the ebuild... But that still fails cuz of failed HUNKS... I'm guessing the same problem you had before?

Here's the EBUILD:
Code:

# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/www-client/mozilla-firefox/mozilla-firefox-1.0.2-r1.ebuild,v 1.4 2005/03/26 07:08:32 brad Exp $

inherit makeedit flag-o-matic gcc nsplugins eutils mozconfig mozilla-launcher multilib

S=${WORKDIR}/mozilla

DESCRIPTION="The Mozilla Firefox Web Browser"
HOMEPAGE="http://www.mozilla.org/projects/firefox/"
MY_PV=${PV/_rc/rc}
SRC_URI="http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${MY_PV}/source/firefox-${MY_PV}-source.tar.bz2
                  http://ftp.debian.org/debian/pool/main/m/mozilla-firefox/mozilla-firefox_1.0.2-3.diff.gz"

LICENSE="MPL-1.1 NPL-1.1"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~sparc ~x86"
IUSE="java mozsvg file-picker"

# xrender.pc appeared for the first time in xorg-x11-6.7.0-r2
# and is required to build with support for cairo.  #71504
RDEPEND="java? ( virtual/jre )
        >=media-libs/libmng-1.0.0
        mozsvg? (
                >=x11-base/xorg-x11-6.7.0-r2
                x11-libs/cairo
        )
        >=www-client/mozilla-launcher-1.28"

DEPEND="${RDEPEND}
        java? ( >=dev-java/java-config-0.2.0 )"

# Needed by src_compile() and src_install().
# Would do in pkg_setup but that loses the export attribute, they
# become pure shell variables.
export MOZ_PHOENIX=1

src_unpack() {
   unpack firefox-${MY_PV}-source.tar.bz2 || die "unpack failed"
   cd ${S} || die "cd failed"

   # patch out ft caching code since the API changed between releases of
   # freetype; this enables freetype-2.1.8+ compat.
   # https://bugzilla.mozilla.org/show_bug.cgi?id=234035#c65
   epatch ${FILESDIR}/mozilla-firefox-1.0-4ft2.patch

   # this patch is already included in the debian patch listed below
   # patch to fix separate character on euro keyboards, bug 68995
   #epatch ${FILESDIR}/mozilla-firefox-1.0-kp_separator.patch

   # use Ubuntu patches for gnome integration-inlcudes kp_seperator patch bug 68995
   use file-picker && epatch ${FILESDIR}/mozilla-firefox_1.0.2-3.diff
      
   # my verown patch! based on 'gtk2-xft-only' (id=162261) from mozilla bugzilla bug id=234035
   cd ${S}/gfx && epatch ${FILESDIR}/mozilla-firefox-1.0.2-gtk-xft-only.diff && cd ${S}

   # alpha stubs patch from lfs project.
   # <taviso@gentoo.org> (26 Jun 2003)
   #       use alpha && epatch ${FILESDIR}/mozilla-1.3-alpha-stubs.patch

   # hppa patches from Ivar <orskaug@stud.ntnu.no>
   # <gmsoft@gentoo.org> (22 Dec 2004)
   #       use hppa && epatch ${FILESDIR}/mozilla-hppa.patch


   if has_version '>=x11-libs/cairo-0.3.0'; then
      epatch ${FILESDIR}/svg-cairo-0.3.0-fix.patch
   fi
}

src_compile() {
        ####################################
        #
        # mozconfig, CFLAGS and CXXFLAGS setup
        #
        ####################################

        mozconfig_init

        # Bug 60668: Galeon doesn't build without oji enabled, so enable it
        # regardless of java setting.
        mozconfig_annotate '' --enable-oji --enable-mathml

        # Other ff-specific settings
        mozconfig_use_enable mozdevelop jsd
        mozconfig_use_enable mozdevelop xpctools
        mozconfig_use_extension mozdevelop venkman
        mozconfig_use_enable gnome gnomevfs
        mozconfig_use_extension gnome gnomevfs
        mozconfig_use_enable mozsvg svg
        mozconfig_use_enable mozsvg svg-renderer-cairo
        mozconfig_annotate '' --with-default-mozilla-five-home=/usr/$(get_libdir)/MozillaFirefox
        mozconfig_annotate '' --prefix=/usr/$(get_libdir)/MozillaFirefox

        # Finalize and report settings
        mozconfig_final

        # hardened GCC uses -fstack-protector-all by default, and this breaks
        # firefox.
        has_hardened && append-flags -fno-stack-protector-all
        replace-flags -fstack-protector-all -fstack-protector

        ####################################
        #
        #  Configure and build Firefox
        #
        ####################################

        # ./configure picks up the mozconfig stuff
        export LD="$(tc-getLD)"
        export CC="$(tc-getCC)"
        export CXX="$(tc-getCXX)"
        econf

        # This removes extraneous CFLAGS from the Makefiles to reduce RAM
        # requirements while compiling
        edit_makefiles

        emake MOZ_PHOENIX=1 CXX="$(tc-getCXX)" CC="$(tc-getCC)" LD="$(tc-getLD)" || die
}

src_install() {
        # Plugin path creation
        PLUGIN_DIR="/usr/$(get_libdir)/nsbrowser/plugins"
        dodir ${PLUGIN_DIR}

        dodir /usr/$(get_libdir)/MozillaFirefox
        cp -RL --no-preserve=links ${S}/dist/bin/* ${D}/usr/$(get_libdir)/MozillaFirefox

        einfo "Installing includes and idl files..."
        # Copy the include and idl files
        dodir /usr/$(get_libdir)/MozillaFirefox/include/idl /usr/include
        cd ${S}/dist
        cp -LfR include/* ${D}/usr/$(get_libdir)/MozillaFirefox/include
        cp -LfR idl/* ${D}/usr/$(get_libdir)/MozillaFirefox/include/idl
        dosym /usr/$(get_libdir)/MozillaFirefox/include /usr/include/MozillaFirefox

        # Dirty hack to get some applications using this header running
        dosym /usr/$(get_libdir)/MozillaFirefox/include/necko/nsIURI.h /usr/lib/MozillaFirefox/include/nsIURI.h

        cd ${S}/build/unix
        # Fix firefox-config and install it
        sed -i -e "s:/lib/firefox-${MY_PV}:/$(get_libdir)/MozillaFirefox:g" firefox-config
        sed -i -e "s:/firefox-${MY_PV}:/MozillaFirefox:g" firefox-config
        exeinto /usr/$(get_libdir)/MozillaFirefox
        doexe firefox-config
        # Fix pkgconfig files and install them
        insinto /usr/$(get_libdir)/pkgconfig
        for x in *.pc; do
                        if [[ -f ${x} ]]; then
                                        sed -i -e
                                        "s:/lib/firefox-${MY_PV}:/$(get_libdir)/MozillaFirefox:g" ${x}
                                        sed -i -e "s:/firefox-${MY_PV}:/MozillaFirefox:g" ${x}
                                        doins ${x}
                        fi
        done
        cd ${S}


        #fix permissions
        chown -R root:root ${D}/usr/$(get_libdir)/MozillaFirefox

        # Plugin path setup (rescuing the existent plugins)
        src_mv_plugins /usr/$(get_libdir)/MozillaFirefox/plugins

        dodir /usr/bin
        cat <<EOF >${D}/usr/bin/firefox
#!/bin/sh
#
# Stub script to run mozilla-launcher.  We used to use a symlink here but
# OOo brokenness makes it necessary to use a stub instead:
# http://bugs.gentoo.org/show_bug.cgi?id=78890

export MOZILLA_LAUNCHER=firefox
exec /usr/libexec/mozilla-launcher "\$@"
EOF
chmod 0755 ${D}/usr/bin/firefox
        insinto /etc/env.d
        doins ${FILESDIR}/10MozillaFirefox

        # Fix icons to look the same everywhere
        insinto /usr/$(get_libdir)/MozillaFirefox/icons
        doins ${S}/build/package/rpm/SOURCES/mozicon16.xpm
        doins ${S}/build/package/rpm/SOURCES/mozicon50.xpm

        # Install icon and .desktop for menu entry
        insinto /usr/share/pixmaps
        doins ${FILESDIR}/icon/firefox-icon.png
        # Fix bug 54179: Install .desktop file into /usr/share/applications
        # instead of /usr/share/gnome/apps/Internet (18 Jun 2004 agriffis)
        insinto /usr/share/applications
        doins ${FILESDIR}/icon/mozillafirefox.desktop

        # Normally firefox-0.9 must be run as root once before it can be
        # run as a normal user.  Drop in some initialized files to avoid
        # this.
        einfo "Extracting firefox-${PV} initialization files"
        tar xjpf ${FILESDIR}/firefox-0.9-init.tar.bz2 -C ${D}/usr/$(get_libdir)/MozillaFirefox
}

pkg_preinst() {
        export MOZILLA_FIVE_HOME=${ROOT}/usr/$(get_libdir)/MozillaFirefox

        # Remove the old plugins dir
        pkg_mv_plugins /usr/$(get_libdir)/MozillaFirefox/plugins

        # Remove entire installed instance to prevent all kinds of
        # problems... see bug 44772 for example
        rm -rf "${MOZILLA_FIVE_HOME}"
}

pkg_postinst() {
        export MOZILLA_FIVE_HOME="${ROOT}/usr/$(get_libdir)/MozillaFirefox"

        # Needed to update the run time bindings for REGXPCOM
        # (do not remove next line!)
        env-update

        # Register Components and Chrome
        #
        # Bug 67031: Set HOME=~root in case this is being emerged via sudo.
        # Otherwise the following commands will create ~/.mozilla owned by root
        # and 700 perms, which makes subsequent execution of firefox by user
        # impossible.
        einfo "Registering Components and Chrome..."
        HOME=~root LD_LIBRARY_PATH=/usr/$(get_libdir)/MozillaFirefox ${MOZILLA_FIVE_HOME}/regxpcom
        HOME=~root LD_LIBRARY_PATH=/usr/$(get_libdir)/MozillaFirefox ${MOZILLA_FIVE_HOME}/regchrome

        # Fix permissions of component registry
        chmod 0644 ${MOZILLA_FIVE_HOME}/components/compreg.dat

        # Fix directory permissions
        find ${MOZILLA_FIVE_HOME}/ -type d -perm 0700 -exec chmod 0755 {} \; || :

        # Fix permissions on chrome files
        find ${MOZILLA_FIVE_HOME}/chrome/ -name '*.rdf' -exec chmod 0644 {} \; || :

        # This should be called in the postinst and postrm of all the
        # mozilla, mozilla-bin, firefox, firefox-bin, thunderbird and
        # thunderbird-bin ebuilds.
        update_mozilla_launcher_symlinks
}

pkg_postrm() {
        update_mozilla_launcher_symlinks
}


Here's the output of ebuild:
Code:

idaho mozilla-firefox # ebuild mozilla-firefox-1.0.2-r1.ebuild unpack
>>> md5 src_uri ;-) firefox-1.0.2-source.tar.bz2
>>> md5 src_uri ;-) mozilla-firefox_1.0.2-3.diff.gz
>>> Checking firefox-1.0.2-source.tar.bz2's mtime...
>>> Checking mozilla-firefox_1.0.2-3.diff.gz's mtime...
>>> /usr/local/portage/www-client/mozilla-firefox/mozilla-firefox-1.0.2-r1.ebuild has been updated; recreating WORKDIR...
>>> Unpacking source...
>>> Unpacking firefox-1.0.2-source.tar.bz2 to /var/tmp/portage/mozilla-firefox-1.0.2-r1/work
 * Applying mozilla-firefox-1.0-4ft2.patch ...                                                                          [ ok ]
 * Applying mozilla-firefox_1.0.2-3.diff ...                                                                            [ ok ]
 * Applying mozilla-firefox-1.0.2-gtk-xft-only.diff ...

 * Failed Patch: mozilla-firefox-1.0.2-gtk-xft-only.diff !
 *  ( /usr/local/portage/www-client/mozilla-firefox/files/mozilla-firefox-1.0.2-gtk-xft-only.diff )
 *
 * Include in your bugreport the contents of:
 *
 *   /var/tmp/portage/mozilla-firefox-1.0.2-r1/temp/mozilla-firefox-1.0.2-gtk-xft-only.diff-14334.out


!!! ERROR: www-client/mozilla-firefox-1.0.2-r1 failed.
!!! Function epatch, Line 357, Exitcode 0
!!! Failed Patch: mozilla-firefox-1.0.2-gtk-xft-only.diff!
!!! If you need support, post the topmost build error, NOT this status message.


Now, the contents of /var/tmp/portage/mozilla-firefox-1.0.2-r1/temp/mozilla-firefox-1.0.2-gtk-xft-only.diff-14334.out:

Code:

***** mozilla-firefox-1.0.2-gtk-xft-only.diff *****

===================================================

PATCH COMMAND:  patch -p0 -g0 < /usr/local/portage/www-client/mozilla-firefox/files/mozilla-firefox-1.0.2-gtk-xft-only.diff

===================================================
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- gfx/src/ps/nsFontMetricsPS.h        2005-04-14 11:01:14.481521848 +0200
|+++ /tmp/nsFontMetricsPS.h.fixed        2005-04-14 10:49:59.852081112 +0200
--------------------------
No file to patch.  Skipping patch.
2 out of 2 hunks ignored
can't find file to patch at input line 26
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- gfx/src/ps/nsFontMetricsPS.cpp      2005-04-14 11:01:14.478522304 +0200
|+++ /tmp/nsFontMetricsPS.cpp.fixed      2005-04-14 10:55:53.227359904 +0200
--------------------------
No file to patch.  Skipping patch.
6 out of 6 hunks ignored
===================================================

PATCH COMMAND:  patch -p1 -g0 < /usr/local/portage/www-client/mozilla-firefox/files/mozilla-firefox-1.0.2-gtk-xft-only.diff

===================================================
patching file src/ps/nsFontMetricsPS.h
Hunk #1 FAILED at 342.
Hunk #2 FAILED at 477.
2 out of 2 hunks FAILED -- saving rejects to file src/ps/nsFontMetricsPS.h.rej
patching file src/ps/nsFontMetricsPS.cpp
Hunk #1 FAILED at 1029.
Hunk #2 FAILED at 1050.
Hunk #3 FAILED at 1074.
Hunk #4 FAILED at 1121.
Hunk #5 FAILED at 2385.
Hunk #6 FAILED at 2401.
6 out of 6 hunks FAILED -- saving rejects to file src/ps/nsFontMetricsPS.cpp.rej
===================================================

PATCH COMMAND:  patch -p2 -g0 < /usr/local/portage/www-client/mozilla-firefox/files/mozilla-firefox-1.0.2-gtk-xft-only.diff

===================================================
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- gfx/src/ps/nsFontMetricsPS.h        2005-04-14 11:01:14.481521848 +0200
|+++ /tmp/nsFontMetricsPS.h.fixed        2005-04-14 10:49:59.852081112 +0200
--------------------------
No file to patch.  Skipping patch.
2 out of 2 hunks ignored
can't find file to patch at input line 26
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- gfx/src/ps/nsFontMetricsPS.cpp      2005-04-14 11:01:14.478522304 +0200
|+++ /tmp/nsFontMetricsPS.cpp.fixed      2005-04-14 10:55:53.227359904 +0200
--------------------------
No file to patch.  Skipping patch.
6 out of 6 hunks ignored
===================================================

PATCH COMMAND:  patch -p3 -g0 < /usr/local/portage/www-client/mozilla-firefox/files/mozilla-firefox-1.0.2-gtk-xft-only.diff

===================================================
missing header for unified diff at line 3 of patch
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- gfx/src/ps/nsFontMetricsPS.h        2005-04-14 11:01:14.481521848 +0200
|+++ /tmp/nsFontMetricsPS.h.fixed        2005-04-14 10:49:59.852081112 +0200
--------------------------
No file to patch.  Skipping patch.
2 out of 2 hunks ignored
missing header for unified diff at line 26 of patch
can't find file to patch at input line 26
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- gfx/src/ps/nsFontMetricsPS.cpp      2005-04-14 11:01:14.478522304 +0200
|+++ /tmp/nsFontMetricsPS.cpp.fixed      2005-04-14 10:55:53.227359904 +0200
--------------------------
No file to patch.  Skipping patch.
6 out of 6 hunks ignored
===================================================

PATCH COMMAND:  patch -p4 -g0 < /usr/local/portage/www-client/mozilla-firefox/files/mozilla-firefox-1.0.2-gtk-xft-only.diff

===================================================
missing header for unified diff at line 3 of patch
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- gfx/src/ps/nsFontMetricsPS.h        2005-04-14 11:01:14.481521848 +0200
|+++ /tmp/nsFontMetricsPS.h.fixed        2005-04-14 10:49:59.852081112 +0200
--------------------------
No file to patch.  Skipping patch.
2 out of 2 hunks ignored
missing header for unified diff at line 26 of patch
can't find file to patch at input line 26
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- gfx/src/ps/nsFontMetricsPS.cpp      2005-04-14 11:01:14.478522304 +0200
|+++ /tmp/nsFontMetricsPS.cpp.fixed      2005-04-14 10:55:53.227359904 +0200
--------------------------
No file to patch.  Skipping patch.
6 out of 6 hunks ignored


Hope this helps... This sounds like a cool ebuild and I hope we can get it working! :)


Alex.
Back to top
View user's profile Send private message
Maedhros
Bodhisattva
Bodhisattva


Joined: 14 Apr 2004
Posts: 5511
Location: Durham, UK

PostPosted: Fri Apr 15, 2005 10:48 am    Post subject: Reply with quote

Moved from Desktop Environments.
_________________
No-one's more important than the earthworm.
Back to top
View user's profile Send private message
IWBCMAN
Guru
Guru


Joined: 25 Jun 2002
Posts: 474

PostPosted: Fri Apr 15, 2005 10:57 am    Post subject: Reply with quote

Alex,


I goofed-big time. Prior to finding the ubuntu patch I had been looking through debian for similiar patches....So what I posted previously referenced the debian patch instead of the ubuntu patch....Sorry I wasted your time.....here is the link to the correct patch and I am now going to edit and correct everything else I posted...

http://archive.ubuntu.com/ubuntu/pool/main/m/mozilla-firefox/mozilla-firefox_1.0.2-0ubuntu5.diff.gz
Back to top
View user's profile Send private message
Gentree
Watchman
Watchman


Joined: 01 Jul 2003
Posts: 5350
Location: France, Old Europe

PostPosted: Fri Apr 15, 2005 11:16 am    Post subject: Reply with quote

Quote:
Now this will go down in the anals of the most horrible ebuilds history.


I think you meant "annals" , but on second thoughts maybe you were right. :lol:
_________________
Linux, because I'd rather own a free OS than steal one that's not worth paying for.
Gentoo because I'm a masochist
AthlonXP-M on A7N8X. Portage ~x86
Back to top
View user's profile Send private message
IWBCMAN
Guru
Guru


Joined: 25 Jun 2002
Posts: 474

PostPosted: Fri Apr 15, 2005 11:30 am    Post subject: Reply with quote

lmao....


oh man


I can't even remeber how to spell english anymore....it's been 12 years since I lived in the states and it shows!

and to make it even worse being shown up by someone from france....what'll come next ieeeeeahhh.... ;)
Back to top
View user's profile Send private message
Gentree
Watchman
Watchman


Joined: 01 Jul 2003
Posts: 5350
Location: France, Old Europe

PostPosted: Fri Apr 15, 2005 12:22 pm    Post subject: Reply with quote

OK , so I wont even start pointing out all the other faults :wink:

So you've been living in some impoverished non-english speaking country where they dont know the difference between their annals and thier anals , eh?

Sounds tough.

Lucky you have the forums to stop you sliding further.

8)
_________________
Linux, because I'd rather own a free OS than steal one that's not worth paying for.
Gentoo because I'm a masochist
AthlonXP-M on A7N8X. Portage ~x86
Back to top
View user's profile Send private message
IWBCMAN
Guru
Guru


Joined: 25 Jun 2002
Posts: 474

PostPosted: Fri Apr 15, 2005 12:53 pm    Post subject: Reply with quote

I'm right next door to you in Old Europe...if I throw a baseball really, really hard I would probably hit the rhine.....


My problem with spelling english is easy to explain..

I use to spell english perfectly...well pretty damned close

Then I learned german where what you write(ie.spelling) is what you hear/speak/pronounce...for the most part

Then I *tried* to learn french where what you write has no obvious, comprehensible, predictable, graspable relationship to what you hear/speak/pronounce

Then I learned a bit of latin further confusing everything


Now I find myself just outright confused....
;)
Back to top
View user's profile Send private message
Gentree
Watchman
Watchman


Joined: 01 Jul 2003
Posts: 5350
Location: France, Old Europe

PostPosted: Fri Apr 15, 2005 1:51 pm    Post subject: Reply with quote

well I fully agree with what you say about french spelling but that's not good enough to get you off the hook.

Annales exists in French and German and probably even comes from Latin!

I'm sure the same could be said for the word anal .

So your knowlege of serveral european languages triples you blunder .


Sorry for being a bit "annal" about this , just a joke. :wink:
_________________
Linux, because I'd rather own a free OS than steal one that's not worth paying for.
Gentoo because I'm a masochist
AthlonXP-M on A7N8X. Portage ~x86
Back to top
View user's profile Send private message
IWBCMAN
Guru
Guru


Joined: 25 Jun 2002
Posts: 474

PostPosted: Fri Apr 15, 2005 2:34 pm    Post subject: Reply with quote

oh just quit being so damned annal-y retentive ;)
Back to top
View user's profile Send private message
IWBCMAN
Guru
Guru


Joined: 25 Jun 2002
Posts: 474

PostPosted: Fri Apr 15, 2005 2:37 pm    Post subject: Reply with quote

Alex,


Have you had a chnace to try it again with the *correct* patch ?

I would understand if you were somewhat peaved about all of the goof-ups I made in my origianl and subsequent posts .....

But still curious if this works for you.....
Back to top
View user's profile Send private message
allex87
Apprentice
Apprentice


Joined: 02 Aug 2003
Posts: 154
Location: Ontario, Canada

PostPosted: Fri Apr 15, 2005 7:31 pm    Post subject: Reply with quote

No problem...

The patch mozilla-firefox-1.0.2-gtk-xft-only.diff still fails :( I've tried cleaning /var/tmp/portage and still I got the same thing :( I'll try to figure out why the heck it isn't working...

Could you put up somewhere on a website a /usr/local/portage/www-client/mozilla-firefox directory gzipped or something so I can compare with mine?


Thanks,
Alex.
Back to top
View user's profile Send private message
allex87
Apprentice
Apprentice


Joined: 02 Aug 2003
Posts: 154
Location: Ontario, Canada

PostPosted: Fri Apr 15, 2005 8:29 pm    Post subject: Reply with quote

Okay,

I manually patched everything as you did...

I had to edit the ubuntu patches to change the source directories for the files to patch... using good'ol sed ;-)

Then I went to https://bugzilla.mozilla.org/attachment.cgi?id=162261 and MANUALLY patched everything from there. I think you created the patch reversed or something weird... :S Dunno, everything matched up (except the line numbers... lol). So now I am compiling. If it works, then I will make a patch and post it.


Alex.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum