Mozillacompile

From LocalizationWiki

You can read the mozilla build docs here :

 http://developer.mozilla.org/en/docs/Build_Documentation

Mozilla uses Gecko for rendering scripts by default, however Gecko layout engine does not support most of the complex text like devanagari, khmer, Dzongkha etc. Now the immediate question is how to make mozilla support all these complex scripts.The common solution to this issue is to apply a patch to the mozilla source to allow it to use pango layout engine for rendering the complex texts.The following process describes the process of applying patch and compiling the Mozilla source.

1. Download Mozilla source from the following URL

http://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/mozilla1.7.3/src
 The source file is usually available in tarred form like mozilla-source-1.7.tar.bz2

2. Download the patch from the following location http://bugzilla.mozilla.org/attachment.cgi?id=152102

This patch is applicable for mozilla verssion 1.7.x. 

3. Apply the patch to the source tar jxvf mozilla-source-1.7.tar.bz2 //It usually extracts into a folder called mozilla. cd mozilla //Rename the patch to ctl.patch and copy it into the mozilla folder. patch –dry-run -Np0 -i ctl.patch //Test the patch without actual patching.Apply the patch if it does not show any errors. patch -Np0 -i ctl.patch It patches two files.

mozilla/configure.in

       mozilla/gfx/src/gtk/nsFontMatricsXft.cpp

4. Following packages are needed for compiling mozilla

libidl-dev
gcc
g++
xlibs-dev
libfreetype6-dev
liborbit-dev
libgtk2.0-dev
libxt-dev


5. Prepare for the compilation

export MOZILLA_OFFICIAL=1

export BUILD_OFFICIAL=1

export MOZ_INTERNAL_LIBART_LGPL=1

./configure --enable-mathml --enable-crypto --enable-xft --enable-default-toolkit=gtk2 --disable-ctl --enable-optimize=-O2 --disable-debug --disable-tests --without-system-nspr --without-system-zlib --without-system-jpeg --without-system-png –without-system-mng

Typing all these on the command prompt is tedious. You can creat a file named ".mozconfig" in the source directory containing the following lines:

 ac_add_options --enable-mathml
 ac_add_options --enable-crypto
 ac_add_options --enable-xft
 ac_add_options --enable-default-toolkit=gtk2
 ac_add_options --disable-ctl
 ac_add_options --enable-optimize=-O2
 ac_add_options --disable-debug
 ac_add_options --disable-tests
 ac_add_options --without-system-nspr
 ac_add_options --without-system-zlib
 ac_add_options --without-system-jpeg
 ac_add_options --without-system-png
 ac_add_options --without-system-mng

Now run ./configure without any parameters, these are read in from the file .mozconfig. (You can test in advance if your settings would be read correctly with

./configure --help

You should see them on top of the noisy output.)

NOTE: For any version of installed mozilla, you can check the options that were used to compile that mozilla by typing following in the address bar of mozilla

about:buildconfig

If it detects the necessary build environment correctly, run the make command.

6. Checking the build

cd dist/bin
./mozilla

If you have XPI for mozilla 1.7, then, check the rendering of User Interface in one's language.


7 Installing Mozilla into the system


Two ways to install Mozilla


7.1 Copy the binaries to a new folder and running mozilla from there

mkdir /opt/mozilla
cd /mozilla/dist/bin/
cp -aL * /opt/mozilla/
//Now the mozilla is installed in /opt/mozilla folder.

7.2 running make install from the mozilla directory ( typical way)

make install 
install -d /usr/include/mozilla-1.8a1/nss
cp -Lf dist/private/nss/*.h  /usr/include/mozilla-1.8a1/nss 
ln -nsf mozilla-1.8a1 /usr/include/mozilla
ln -nsf mozilla-1.8a1 /usr/lib/mozilla 

Now, we need to do the final configuration of the browser:

cd /usr/lib/mozilla-1.8a1
export LD_LIBRARY_PATH="/usr/lib/mozilla-1.8a1" 
export MOZILLA_FIVE_HOME="/usr/lib/mozilla-1.8a1" 
./regxpcom 
./regchrome 
touch `find /usr/lib/mozilla-1.8a1 -name *.rdf` 
ln -sf mozilla /usr/bin/netscape 

8. Installing java Plugins

download j2re-1.3.1-FCS-linux-i386.tar.bz2

cp j2re-1.3.1-FCS-linux-i386.tar.bz2 /opt
cd /opt

tar jxvf  j2re-1.3.1-FCS-linux-i386.tar.bz2

cd /usr/lib/mozilla/plugins

ln -s /opt/j2re1.3.1/plugin/i386/mozilla/javaplugin_oji.so

9. Creating mozilla-installer

cd mozilla/xpinstall/packager/unix
perl deliver.pl

you will get error complaining about not finding the mozilla-installer.bin file.

For this download a mozilla-installer form the mozilla.com, unzip it and copy this particualr file “mozilla-installer.bin” to the follwing folder mozilla/xpinstall/wizard/unix/src2/

[ I didn't find mozilla-installer-1.7.tar.gz so I downloaded the installer for 1.7.3 and copied the mozilla-installer-bin, it worked . I don't know if the difference in version is always ok ]

Then run the perl script again. The mozilla-installer.tar.gz will be availabele in the following location: mozilla/installer/sea/

10. Creating your own tar.gz package

cd mozilla/xpinstall/packager
make

this will create mozilla-i686-pc-linux-gnu.tar.gz in the dist directory. You can use this package as you own mozilla distribution. Take this package in other system, simply unzip it and run mozilla from path/to/mozilla/dist/bin/./mozilla

11. To create the Mozilla debian package

Untar the mozilla-i686-pc-linux-gnu.tar.gz file created in step 10 and rename the folder to mozilla-dz.

mkdir /makedeb

mkdir /makedeb/usr/

mkdir /makedeb/usr/local

cp -Rp mozilla-dz /makedeb/usr/local/

mkdir /makedeb/DEBIAN/

cp control /makedeb/DEBIAN/

change the control file as necessary

dpkg -b /makedeb/ mozilla-1.7.dz-BT.linux-1386-gnu-gtk2-xft-pango.deb

12. Localized mozilla debian file with Dzongkha support

cd /usr/local/mozilla/chrome

copy all the DZ*.jar file inside the chrome folder

vi installed-chrome.txt

Make the necessary changes

Mozilla Compilation ERROR

This page keeps track of the errors encountered during mozilla compilation and their solutions

 http://www.dit.gov.bt/admin/index.php/Main_Page:mozilla_error

mozilla_error