Firefox 3.5 on Debian Lenny AMD64
Now that Firefox 3.5 is out, I wanted to get it running on my 64-bit Debian 5.0 laptop—but there’s no 3.5 package in Sid yet, as of July 2, and mozilla.com only carries 32-bit binary tarballs for Linux. So I had to build Firefox 3.5 from source. Fortunately this turned out to be a lot less painful than I had imagined; this post will show you how I did it, in case you’re in a similar spot.
Build dependencies
The first thing to do is to make sure you’ve installed everything for the build process. Since you’re on a nice, civilized operating system like Debian, the following commands should have you covered:
$ sudo apt-get install build-essential libidl-dev autoconf2.13
$ sudo apt-get build-dep iceweasel
Obtaining the Mozilla source code
Mozilla’s official developer guide recommends downloading individual source archives for those who simply want to build a Firefox release, but I decided to get the source via Mercurial checkout, since this way there will be less to download and re-compile each time a security update comes along. The downside to this is that the initial download takes longer, and the full Mozilla source repository takes up about 686 MB on my hard drive.
First you’ll need to have the Mercurial source control manager installed on your computer, of course. If you don’t have it already, just type the following…
$ sudo apt-get install mercurial
Now change to whichever directory you want to keep the repository in, and run
$ hg clone http://hg.mozilla.org/releases/mozilla-1.9.1 \
mozilla-1.9.1
This will copy the full Firefox 3.5 / Mozilla 1.9.1 development branch to your computer. If you’re on a slow U.S. residential Internet connection like I am, this might be a good time to go do something else.
Once this is done, check out the particular Firefox 3.5 release that you’d like to build. Since there have not yet been any dot releases at the time of this writing, I just did:
$ cd mozilla-1.9.1
$ hg checkout -r FIREFOX_3_5_RELEASE
Configuring, building, and installing
The Mozilla build is controlled by a file called .mozconfig, which can live in your home directory, outside of the source tree. This makes it easy to “set” a particular Firefox build configuration, then reuse it repeatedly in the future without having to dig through old configure.log files or take notes elsewhere.
Create ~/.mozconfig with the following contents:
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-firefox
ac_add_options --prefix=/opt/firefox
ac_add_options --enable-application=browser
ac_add_options --with-system-zlib
ac_add_options --with-system-jpeg
ac_add_options --enable-optimize
ac_add_options --enable-official-branding
ac_add_options --enable-canvas
ac_add_options --enable-strip
ac_add_options --disable-tests
ac_add_options --disable-installer
ac_add_options --disable-accessibility
ac_add_options --enable-xinerama
ac_add_options --with-default-mozilla-five-home=/usr/lib/firefox-3.5
Edit: Some problems have been reported with these particular configuration options; see below if this doesn’t work for you…
Now you’re ready to actually build Firefox—another good opportunity to go find something else to do for a little while:
$ make -f client.mk build
When the build is done, install it with
$ sudo make -f client.mk install
Close any running instances of Iceweasel, then try starting up your new browser:
$ /opt/firefox/bin/firefox
Later on: getting Firefox updates
Suppose that two weeks from now there is a security update release, Firefox 3.5.1. Since you already have a copy of the Mozilla source repository on your computer and you’ve already completed a full build, downloading and building any patch releases will take significantly less time. For a hypothetical Firefox 3.5.1 build, you would do:
$ hg pull
$ hg checkout -r FIREFOX_3_5_1_RELEASE
$ make -f client.mk build
$ sudo make -f client.mk install
And then restart your web browser.
8 Comments
You can leave a comment of your own with the form below.
Hi,
thanks for the instructions.
I did try to compile FF3.5 yesterday (July 1) on my Debian, but i could not download iceweasel deps. (network restrictions on my work)
Really it was easier than I thought yesterday.
Thanks again
::: Andrés
-----------
Type 'cat vmlinuz > /dev/audio' to hear the Voice of God.
Thanks, this was a big help but I did have a couple problems. The install failed until I commented out:
ac_add_options --disable-installer
Now your instructions for installing worked! However, when I ran firefox, it immediately segfaulted. I decided to get conservative (inspired by the recommendations on the developer site) and commented out the following:
ac_add_options --with-system-zlib
ac_add_options --with-system-jpeg
ac_add_options --enable-canvas
ac_add_options --enable-strip
ac_add_options --enable-xinerama
Now it works. I haven't had time yet to see which of the above fixed the problem.
Thanks again for the inspiration to get this working.
John
Great guide thanks very much.
I had some build-deps missing though, added xorg-dev and then it went smooth.
Thanks, great guide. Got Fx up and running in no time. It's nice to have the actual Firefox as opposed to Iceweasel for a change.
I had to make a copy of the .mozconfig file from my home directory to mozilla-1.9.1 in order for the istallation to work. Worked great, thank for such a great post.
This worked great, thanks! the only problem is, i no longer get gnome-support with this custom compiled version, so clicking items in the little download window does nothing anymore, Does anyone know how to fix this? =/
Sorry for my bad English.
Thanks for instructions. But I have some problem. I can't install any addon :(
After click install FF say "Restart for apply changes". I click restart and nothing :(
FF started only from command
Any ideas?
thankyou