TIP Getting the "standard" Firefox logo

From Gentoo Linux Wiki

Jump to: navigation, search
This article is part of the Tips & Tricks series.
Terminals / Shells Network X Window System Portage System Filesystems Kernel Other

[edit] Problem

Note: As of Firefox 1.5.0.1, the default gentoo ebuild uses the original Firefox logo.
Note: As of Firefox 2.0.0.1, the default gentoo ebuild has a useflag 'mozbranding' to enable the "standard' logo.

You're searching for the familiar orange-blue firefox icon far too long, because you simply don't get used to it being black/blue on Linux.

[edit] Fix

Both Mozilla Firefox and Mozilla Thunderbird have a configure flag, --enable-official-branding, that we are going to add to their ebuild's to be used as a USE flag. We will do this in a portage overlay, which will prevent our ebuild being overwritten when portage is sync'd. This tweak is as per the patch attached to bug 89945.

[edit] Creating and merging the portage overlays

As has already been noted, it generally isn't good practice to edit anything in /usr/portage since it gets overwritten every time you sync portage, so here we are going to create portage overlays and edit the ebulids from the main tree to include our tweak.

1. Set your overlay directory in make.conf if you havn't already:

echo "PORTDIR_OVERLAY=\"/usr/local/portage\"" >> /etc/make.conf

2. Create the directory for your overlays (and the sub-directories for Firefox, which are used in the same way as those in the main portage tree, with a category and package name):

mkdir -p /usr/local/portage/www-client/mozilla-firefox

and to make Thunderbird's directories:

mkdir -p /usr/local/portage/mail-client/mozilla-thunderbird

3. Copy the appropriate ebuild for Firefox and Thunderbird from the main portage tree to your overlays:

cp /usr/portage/www-client/mozilla-firefox/mozilla-firefox-1.0.x.ebuild /usr/local/portage/www-client/mozilla-firefox
cp /usr/portage/mail-client/mozilla-thunderbird/mozilla-thunderbird-1.0.x.ebuild /usr/local/portage/mail-client/mozilla-thunderbird

Replace 'x' with the version of the program that you wish to merge. Run the following command for 'mozilla-firefox' or 'mozilla-thunderbird' to find out which version would be merged if you were to use the ebuild from the main tree:

emerge -pv package-name

4. Copy all the patches to the overlays to make the ebuild happy:

cp -R /usr/portage/www-client/mozilla-firefox/files /usr/local/portage/www-client/mozilla-firefox
cp -R /usr/portage/mail-client/mozilla-thunderbird/files /usr/local/portage/mail-client/mozilla-thunderbird

5. Now we need to edit the ebuilds to include our tweak:

File: mozilla-firefox-1.0.x.ebuild

Near the top of the file, you will something that looks like the following line, to which you need to add the 'branding' flag:

IUSE="branding gnome java mozdevelop mozsvg mozcalendar"

Near the middle of the file, you will find a section that looks like the following, to which you need to add the line 'mozconfig_use_enable branding official-branding':

# Other ff-specific settings
mozconfig_use_enable branding official-branding
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 mozcalendar calendar
...

6. Repeat step 5 for the Thunderbird ebuild, in which you will find the appropriate sections in similar places.
7. Create digests for both ebuilds, otherwise portage will complain that the ebuild file is the wrong size, and ask you to resync:

ebuild /usr/local/portage/www-client/mozilla-firefox/mozilla-firefox-1.0.x.ebuild digest
ebuild /usr/local/portage/mail-client/mozilla-thunderbird/mozilla-thunderbird-1.0.x.ebuild digest

8. Add the appropriate line out of the following to your /etc/portage/package.use (make it if you don't have it):

www-client/mozilla-firefox branding
mail-client/mozilla-thunderbird branding

9. Now emerge them!

That's it - now you'll be able to instantly recognize your favorite browser in the task bar again and Thunderbird will have all that nice new artwork.

Maybe at some point this will be added to the ebuild in portage, but until then, you will have to repeat these steps for each new version of Firefox or Thunderbird that is added to the main portage tree if you want to keep the offical branding.

Personal tools