Pages

Showing posts with label Swiftfox. Show all posts
Showing posts with label Swiftfox. Show all posts

July 14, 2010

"Installing" handmade Firefox 3.6 in Debian Squeeze

[Update 2011-06-25: You should consider this post obsolete. See this post for more info.]

Yesterday we saw how to build Firefox 3.6 from sources. This post shows you how to "install" it.

The reason I put "install" in quotes is because it's arguable that what we're going to do is a real installation. In a real Linux installation, you splay the various bits and pieces of your app into /usr/local/bin, /usr/local/share, /usr/local/lib, and various other places (or /usr/bin, /usr/share, /usr/lib if it's an official distribution package). What we are going to do here is take the easy way out--but a way that lots of "packages" take. We're going to dump stuff into /opt.

If you open up {whatever}/firefox-mercurial/192src/objdir-ff-release/dist/bin/ (or wherever you built your sources), you'll see that quite a few of the items in the bin directory are relative links to resources outside bin. If we try a conventional copy of the bin directory to /opt, what we get won't work because the targets of those links won't be copied. You could copy the whole objdir-ff-release to /opt, which will copy the needed link targets, but this will produce something many MB more than we need. The solution is to convert the links into targets themselves when you copy the file. This is actually pretty easy to do using the command line.

Copy the bin
Open a terminal in {whatever}/firefox-mercurial/192src/objdir-ff-release/dist. From there, become root (using su) and then:

# cp -R -L bin /opt/ff-from-src
# chown root:root -R /opt/ff-from-src


You should now have a new directory in /opt called ff-from-src. Inside it will be an executable file called firefox, and what used to be links will now be actual files. If all went well, executing this file (NOT as root) will launch the browser.

Making commands
We will next do a couple things to let you launch your new Firefox as a command and add an item to your menu.

1. Using whatever mechanism you are most comfortable with, make a softlink called firefox in /usr/local/bin to /opt/ff-from-src/firefox. You'll need to do this as root.

2. Add a png icon called firefox-namoroka.png to /usr/local/share/pixmaps/mozilla. You'll probably need to add the pixmaps and mozilla directories. Again you'll have to be root to do this. The icon can be whatever you want the icon to be in your menu. I used this one, even though it's the same one that Swiftfox uses. I wanted an icon that said "Firefox" but that differentiated itself from the stock FF icon. I scaled the icon to 128x128. Another nice icon is this one, but in spite of the attribution given on the page, I'm not sure it's actually GPL or where it originally came from.

3. Create a file called firefox-namoroka.desktop in /usr/local/share/applications again adding any directories you need and again as root. Copy/paste the following into firefox-namoroka.desktop:

[Desktop Entry]
Encoding=UTF-8
Name=Firefox Namoroka
Comment=Browse the World Wide Web
GenericName=Web Browser
X-GNOME-FullName=Firefox Web Browser
Exec=firefox %u
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=/usr/local/share/pixmaps/mozilla/firefox-namoroka.png
Categories=Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;
StartupWMClass=Firefox-bin
StartupNotify=true
Name[en_US]=Firefox Namoroka

You should now have an entry in your desktop menu and other desktop integration niceness.

July 13, 2010

Firefox 3.6 with pretty fonts in Debian Squeeze

[Update 2011-06-25: You should consider this post obsolete. See this post for more info.] 

Iceweasel 3.6 has yet to trickle down to Debian Testing and very well may not make it before the freeze. However, some of us would like to have some 3.6iness in spite of this. If you've tried downloading SwiftFox, IceCat or the Firefox 3.6 binaries, you know that you get a 3.6, but the font rendering looks poopy.

Here's what I did to compile FF 3.6 from sources and get the same smooth font rendering that you get with Iceweasel 3.5 from the Squeeze repo. I'm not an expert, but this seems to have worked.

The following is based mostly on Mozilla's documentation on a Simple Firefox Build and Linux Prerequisites.

Preproduction
First, create a working directory. I called mine firefox-mercurial. The reason for the name will become obvious shortly.

Next, get the tools you need to build stuff. Since there's no firefox package in the Debian repos, I used (as root):

# apt-get build-dep iceweasel

Then install a bunch of other stuff that is supposedly needed:

# apt-get install mercurial libasound2-dev libcurl4-openssl-dev libnotify-dev libxt-dev libiw-dev mesa-common-dev autoconf2.13 yasm

You will also have to add:

# apt-get install libidl-dev

This isn't documented anywhere that I know of. I found this out the hard way after my first attempts to compile failed.

Get sources
With a regular user terminal open in firefox-mercurial, use mercurial to get the sources:

hg clone http://hg.mozilla.org/releases/mozilla-1.9.2/ 192src

This will get you the latest, most update, bleeding edge version of 3.6--which may or may not be the same as the release version. For example, at the time of this writing, the latest version is 3.6.8pre and the latest release is 3.6.6. To specify the exact version you want, use #{tag}, where {tag} is  one of tags listed at http://hg.mozilla.org/releases/mozilla-1.9.2/. For example, to get and build FF 3.6.6:

hg clone http://hg.mozilla.org/releases/mozilla-1.9.2/#FIREFOX_3_6_6_RELEASE 192src

Getting the sources will take a long time, but not nearly as long as compiling will later on.

Next we need to move into the 192src directory and set up the mozconfig file that tells the system how to build firefox:

cd 192src
echo '. $topsrcdir/browser/config/mozconfig' > mozconfig
echo 'mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-ff-release' >> mozconfig
echo 'mk_add_options MOZ_MAKE_FLAGS="-j4"' >> mozconfig
echo 'ac_add_options --disable-debug' >> mozconfig
echo 'ac_add_options --disable-tests' >> mozconfig
echo 'ac_add_options --enable-optimize' >> mozconfig
echo 'ac_add_options --enable-system-cairo' >> mozconfig


The objdir-ff-release is the name of the directory that built stuff will end up in. You can change this name if you want. The line with --enable-optimize is optional. The last option above, --enable-system-cairo, I found looking through the list of available options, and I'm pretty sure it's what gives you nice font rendering in GTK+ environments.

Build the beast with

make -f client.mk

The build will take forever. Once the compile is done, the binaries will be in
{whatever}/firefox-mercurial/192src/objdir-ff-release/dist/bin/.
Execute the file firefox to make it go.

When you make it go, you'll notice that the app is identified by its code name, Namoroka.

Updating
I have not yet tried this, but according to Mozilla's documentation, to build a new version you'll need to update the sources with

hg pull -r default
hg update


I suspect you do this in the 192src directory and I suspect you'll need to rebuild as above afterward. Also, I suspect that in place of default above you'll want to use a valid tag (as when you first cloned the sources), but until I actually update I won't be able to say for sure.

Extra credit
Once I've done some more testing, I will be move the built files to /opt/firefox and add a *.desktop entry for it. The big question is whether I should call it 'Firefox' or 'Namoroka'.

March 28, 2010

GNU IceCat and file managers


There's no shortage of essentially identical Mozilla-derived browsers in Linuxspace now. Firefox is the official Mozilla product. Two better known variations are Iceweasel--a Debian project that replaces the not-really-covered-by-a-free-license Mozilla branding stuff in Firefox with really-covered-by-a-free-license branding, and Swiftfox--which offers processor-specific optimized compiles of the Mozilla code.

Perhaps a lesser-known variant (as of this writing) is GNU IceCat. IceCat is very similar to Iceweasel in that its main purpose for being is to remove the non-libre Mozilla bits from Firefox. It goes one step further than Iceweasel in its pursuit of libreness in that it redirects its add-ons explorer to a GNU-maintained list of add-ons that are fully-libre. Don't worry--you can still install any add-on that you can in normal Firefox by visiting Mozilla's add-on site. Seems like a winner: promoting libre software without limiting the use of proprietary software.

However, more interesting than the above for me is something I've found to be case with the latest version of IceCat that is not the case with the other three. In any of the other three (or four if you count hand-installing the official Mozilla binaries rather than the Ubuntu and Debian packages), no matter what I've tried, I have not been able to tell the browser in the downloads dialog to "open containing folder" using the file manager of my choice. Whatever I've tried, they all insist on opening folders in Nautilus. However, IceCat has a file: application type with which you can set the desired file manager just as you might with any other type. And there was much rejoicing.

The weird thing is that I seem to recall that the file: application type was present in older versions of Firefox--e.g. as included in Jaunty. So I don't know if the current lack of the file: type is a temporary abnormality or the sign of things to come on all fronts. Whatever the case, IceCat is my default browser on my Debian machines because I tend to use a custom Openbox/Thunar environment most of the time. It not my default on Ubuntu because it--along with Swiftfox and the binaries directly download-able from Mozilla--does not respect your system font rendering settings. (It's always something, isn't it?)

There's a PPA for Ubuntu users and deb packages for 32-bit Debian users if you wanna give it a go.