DVOI.COM

Building Mozilla® Firefox® 4 with "ja" locale

A Memo w/rant

I need a Japanese-savvy web browser capable of rendering text, graphics, and audio/video data under X11. Unfortunately one of the POSIX®-compliant operating systemsRoar that I use daily no longer provides recent releases in a ready-to-install package, and I can't always afford to upgrade the operating system and software package management system or whatever — keeping software up-to-date is a neverending story. I just ended up rolling my own anyway.

A minimalist approach

Note: There may be cases where a new build is unable to load the plugins that used to work with previous builds — depending on the operating system that you use, the default plugin search path may or may not work. If it doesn't, you'll have to check the source files. You can also set the MOZ_PLUGIN_PATH environment variable at runtime to override the default value, e.g., MOZ_PLUGIN_PATH=/usr/lib64/mozilla/plugins if running Bourne Shell.

For starters, download the source code and a matching L10N package for Japanese:


(hoge)% wget ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/4.0.1/source/\
firefox-4.0.1.source.tar.bz2

(hoge)% tar xf firefox-4.0.1.source.tar.bz2

Note that I don't use hg or sudo.


(hoge)% wget http://hg.mozilla.org/l10n-central/ja/archive/\
4d62a59c5127.tar.bz2

Set up the source and optionally download a fix:


(hoge)% tar xf 4d62a59c5127.tar.bz2

(hoge)% ln -s ja-4d62a59c5127 ja

(hoge)% wget \
  http://dvoi.com/hhasebe/mozilla/firefox/4.0/build/ja/ja-browser.properties.diff

Again, the fix is optional.


(hoge)$ patch -p0 < ja-browser.properties.diff

It just changes the message in the "Bookmark This Page" dialog. With versions up to 4.0, past tense is used in ja which may give you an impression that a new entry has just been added, but in fact it won't happen until you explicitly press the "Done" button in the dialog (or the Enter or Return key).


(hoge)% setenv MOZCONFIG `pwd`/mozconfig

(hoge)% vi mozconfig

Note: This procedure should work with x86_64 systems[1] as well — check to see if your mozconfig file has to include something like:

ac_add_options --enable-64bit
ac_add_options --libdir=/usr/lib64

For further details, see the Configuring Build Options document. Be sure to adjust build arguments and shell command lines to match your system and preference. You might want to try profile guided optimization.[2]


(hoge)% grep -i 'prefix\|locale\|l10n\|browser' mozconfig
mk_add_options MOZ_CO_PROJECT=browser
mk_add_options MOZ_CO_LOCALES=ja
ac_add_options --prefix=/opt/local
ac_add_options --enable-application=browser
ac_add_options --with-l10n-base=..
ac_add_options --enable-ui-locale=ja

(hoge)% cd mozilla-2.0

(hoge)% make -j 2 -f client.mk build

Be patient until everything complies ok...

Firefox - 100% organic software, yummy

If you're safely returned to the command prompt, install the lot:


(hoge)% su root
Password:

# setenv MOZCONFIG `pwd`/mozconfig

# make -f client.mk install

Save your keystrokes & time. Have lots of RAM & enjoy.

Notes

  1. ^ As of version 4.0, the following files contain hardcoded 64-bit library paths only for certain systems. You may need to edit them manually to match the system that you use, especially the system-wide plugin path.
    mozilla-2.0/modules/plugin/base/src/nsPluginsDirUnix.cpp
    mozilla-2.0/toolkit/xre/nsXREDirProvider.cpp
    mozilla-2.0/xpcom/io/nsAppFileLocationProvider.cpp
  2. ^ For automated optimization, add the following lines to your mozconfig:
    mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) $(MOZ_OBJDIR)/_profile/pgo/profileserver.py'
    ac_add_options --enable-profile-guided-optimization
    Start the build process by issuing:
    make -f client.mk profiledbuild
    Be sure to consult the Mozilla Developer Center documentation for further details.
  3. To remove the close button from the add-on bar, add the following to your chrome/userChrome.css file:
    #addonbar-closebutton { display: none !important; }

See also: Building Mozilla Thunderbird 3.1.x with "ja" Locale.

Copyleft 2012 !© DVOI.COM. Some rights reserved.
POSIX is a registered trademark of the IEEE. Mozilla and Firefox are registered trademarks of the Mozilla Foundation.

⇑ Top of page