Group:IceCat/Compile and package/build 52.3.0 on Devuan Jessie 1.0

From LibrePlanet
Jump to: navigation, search

build_52.3.0_on_devuan_(debian)_jessie_1.0 en en

  • The information contained in this page is current as of: 2017-10-28.
  • The text in this page was last modified on: 2018-02-27.

Introduction

This page contains a report, with comments and hints, on a successful build of Gnuzilla IceCat 52.3.0 (-gnu1) on a updated (2017-10-28) Devuan GNU+Linux Jessie 1.0 amd64 machine.

Devuan GNU+Linux is a fork of Debian without systemd. Devuan Jessie provides continuity as a safe upgrade path from Debian 7 (Wheezy) and a flawless switch from Debian 8 (Jessie) that ensures the right to Init Freedom and avoids entanglement.

The procedure below should also apply, eventually with some differences, to other distributions based on Devuan GNU+Linux Jessie and Debian Jessie.

Some problems and workarounds when compiling IceCat on Devuan Jessie for i386 are on the discussion page.

Prepare the developing environment

  • System update

First of all, it is highly reccomended having an updated system:

 $ sudo apt-get update
 $ sudo apt-get upgrade
  • Install common development tools

The most common development tools should be installed on your system. Please install (this is required only once):

$ sudo apt-get install gcc g++ make patch perl python unzip zip
$ sudo apt-get install autoconf automake build-essential checkinstall debhelper devscripts dpkg-dev fakeroot gdb-minimal libc6 libc6-dev libtool intltool pbuilder pkg-config 
  • Install and configure ccache

To speed up the build process (see below), install ccache:

$ sudo apt-get install ccache

You should create a directory where storing cccache files:

$ mkdir <ccache_basepath>/ccache

where:

<ccache_basepath>: is the full path of a directory you should choose as base where storing cccache files

And when opening a shell you should configure ccache:

$ export CCACHE_DIR=<ccache_basepath>/ccache
$ ccache --max-size <N>G
$ export CCACHE_COMPRESS=""

where:

<ccache_basepath>: is the full path of a directory you should choose as base where storing cccache files
<N>: is the maximum size (in GB) of the cache

To avoid configuring cccache everytime, you could append the configuration to your ~/.bashrc.

Prepare the requested libraries and dependencies

To successfully build Icecat 52.3.0 you need some libraries to be installed and some dependencies to be satisfied. Please install (this is required only once):

  • Linux environment files
$ sudo apt-get install gcc-4.9 perl make libgtk-3-dev libxt-dev libidl-dev libx11-xcb-dev zip libfreetype6-dev fontconfig libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev pkg-config libdbus-glib-1-dev libasound2-dev libpulse-dev libnotify-dev yasm libpython2.7-dev python2.7 python2.7-dev autoconf2.13 m4 binutils-avr

IMPORTANT NOTE: These versions are required: autoconf=2.13 (requires GNU m4; autoconf 2.5x do NOT work!), freetype >= 2.1.0, gcc >=4.9, (GNU) make >= 3.80, libgtk-3-dev >= 3.4, libidl-dev >= 0.6.3, perl >= 5.6, pkg-config >= 0.9.0, python >= 2.7.3, yasm >= 1.1.0, zip >= 2.3 (see: Linux_Prerequisites at the Mozilla Developer Network).

  • Default IceCat libraries
$ sudo apt-get install libpango libpangoxft libpangoft2 libfreetype libxft libgtk2 libx11

(see: 'README.IceCat' file contained in the IceCat 52.3.0-gnu1 sources)

  • Other suggested libraries and dependencies
$ sudo apt-get install libatk libc6 libcairo2 libffi6 libffi-dev libfontconfig1 libfreetype6 libgcc1 libgdk-pixbuf2 libglib2.0 libgtk2 libhunspell-dev libstdc libx11 libx11-xcb-dev libcomposite1 libxdamage1 libxext6 libfixes3 libxrender1 libxt6 zlib1g procps debianutils libsqlite3 libsqlite3-dev libxml2-dev libglib2.0-dev libevent-dev libnss3-dev libiw-dev libglu1-mesa-dev xulrunner-dev python-virtualenv python-pip lbzip2 libicu-dev

To install all system prerequisites you can try to run the following:

$ sudo apt-get install build-dep firefox-esr
$ wget -O bootstrap.py https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py && python bootstrap.py

Other packages and libraries could be necessary depending on the build options you choose (see below).

Prepare the building environment

IMPORTANT NOTE: Every time the build process fails, it is highly recommended to repeat all the entire process, starting again from a completely clean building environment (see here below): cleaned and cleared ccache, empty src and obj directories etc. A system reboot is also suggested.

The building environment should be set up before to start the building process. Please do the following:

  • Clean and check ccache

If ccache is in use, it should be clear and clean:

$ ccache --clear --cleanup
$ ccache -s
  • Set the building base directory

You should have a directory to use as base for all the building process:

$ cd <build_basepath>
$ mkdir icecat-52.3.0
$ cd icecat-52.3.0

where:

<build_basepath>: is the path of a directory you should choose as base for all the building process
icecat-52.3.0: is the sub-directory of <build_basepath> where to work
  • Download the sources

To download the sources into the <build_basepath>/icecat-52.3.0 directory, please run:

$ curl -O -J -L 'https://ftp.gnu.org/gnu/gnuzilla/52.3.0/icecat-52.3.0-gnu1.tar.bz2' 
$ curl -O -J -L 'https://ftp.gnu.org/gnu/gnuzilla/52.3.0/icecat-52.3.0-gnu1.tar.bz2.sig' 
  • Verify the downloaded sources

The Gnuzilla IceCat releases are signed with a gpg key. The new gpg key has ID: D7E04784. Please download the key and check its fingerprint:

$ gpg --keyserver keys.gnupg.net --recv-keys D7E04784
$ gpg --fingerprint D7E04784

The fingerprint of the gpg key used to sing the Gnuzilla IceCat releases should be:

A573 69A8 BABC 2542 B5A0  368C 3C76 EED7 D7E0 4784

Then verify the downloaded sources:

$ gpg --verify icecat-52.3.0-gnu1.tar.bz2.sig 
  • Prepare the sources

To prepare the sources tree in the <build_basepath>/icecat-52.3.0/src directory, please run (please, avoid using any graphical tool when decompressing surces!):

$ tar -jxvf icecat-52.3.0-gnu1.tar.bz2
$ mv icecat-52.3.0  src

Configure the build

Configuration of the build process could be obtained through:

- configuration parameters
which can be passed to the command script configure as command-line parameters (discouraged) or, better, through a configuration file named src/mozconfig which should be created into the source directory (reccomended)
- configuration variables
which can be set via the src/browser/confvars.sh file

The configuration parameters are used by the command script configure to set the corresponding configuration variables.

Please note that *not* all the configuration variables can be set through the command script configure: these variables can be set only directly in the src/browser/confvars.sh file.

Set the configuration parameters (file: src/mozconfig)

A complete list of the available parameters can be obtained running (from the source tree base directory):

$ ./configure --help

The reccomended way to set any of the configuration parameters is through a configuration file src/mozconfig which should be created into the source directory. Calling configure with command-line options is discouraged.

Use your favourite text editor to create this src/mozconfig file and modify it if necessary.

Here below is listed the content of the src/mozconfig file which is needed building IceCat 52.3.0 as suggested in this document.

Please note that:

  • this file has been successfully tested building IceCat 52.3.0 on a updated (2017-10-28) Devuan GNU+Linux Jessie 1.0 amd64 machine
  • before to start the build process is *highly reccomended* to check carefully all the content of this file, in order to comment/uncomment the options accordingly with your system and your preferences
#### 
####  icecat 'src/mozconfig' file
#### 

### IMPORTANT NOTICE: 
### append the following lines to the VERY BOTTOM of 'src/mozconfig'

### WARNING: the following lines should NOT be changed
## Mozilla requires Python2 (see: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Linux_Prerequisites)
mk_add_options PYTHON=/usr/bin/python2

### WARNING: the following lines should NOT be changed
### (from:  . "$topsrcdir/build/mozconfig.common")
mk_add_options AUTOCLOBBER=1
ac_add_options --enable-release
ac_add_options --enable-js-shell
ac_add_options --disable-eme
#. "$topsrcdir/build/mozconfig.automation"

### WARNING: the following lines should NOT be changed
### (from:  . "$topsrcdir/src/browser/config/mozconfig")
## application to build
ac_add_options --enable-application=browser

### WARNING: the following one should be comment out only if not using ccache
## build using ccache
ac_add_options --with-ccache

### WARNING: the following lines should NOT be changed
## build using an objdir (to keep sources clean)
mk_add_options MOZ_OBJDIR=$topsrcdir/../obj
## path: sources for locales
ac_add_options --with-l10n-base=$topsrcdir/l10n
## path: system install dir
ac_add_options --prefix=/usr

### WARNING: the following lines should NOT be changed
## build with optimization
ac_add_options --enable-optimize="-pipe -O2"
## build with cairo-gtk2
ac_add_options --enable-default-toolkit=cairo-gtk2

### WARNING: the following lines should NOT be changed
## branding
ac_add_options --enable-official-branding
ac_add_options --with-distribution-id=org.gnu 
## enable support for user/portablr fonts on desktop platforms (put your fonts 
## to dir browser/fonts, then you can select them in the font preferences)
ac_add_options --enable-bundled-fonts

### DISABLE UNWANTED OPTIONS (not necessary and/or privacy related stuff)

## disable geolocation services
ac_add_options --disable-necko-wifi
## other unwanted options below
ac_add_options --disable-debug
ac_add_options --disable-debug-symbols
ac_add_options --disable-tests 
ac_add_options --disable-crashreporter 
ac_add_options --disable-updater 
ac_add_options --disable-maintenance-service
ac_add_options --disable-parental-controls

### OTHER RECOMMENDED OPTIONS (uncomment/comment what you want/unwant)

## use alsa instead of pulseaudio
## WARNING: comment out BOTH the following two lines to use pulseaudio
ac_add_options --enable-alsa  
ac_add_options --disable-pulseaudio 
## raw support
ac_add_options --enable-raw
## if dbus-glib is installed you could uncomment the next line
ac_add_options --disable-dbus
## if gconf is installed you could uncomment the next line
ac_add_options --disable-gconf

### OLD AND/OR PROBLEMATIC OPTIONS - DONT USE!!!

## WARNING: the next lines should be kept commented (otherwise probably the 
## build will fail and/or tha software might not work properly )!!!

## maybe the following lines could be uncommented if the related optional 
## dependencies are installed
#ac_add_options --enable-system-hunspell
#ac_add_options --enable-system-ffi
#ac_add_options --enable-system-pixman
#ac_add_options --enable-system-sqlite 
#ac_add_options --with-system-libevent
#ac_add_options --with-system-libvpx
#ac_add_options --with-system-icu
#ac_add_options --with-system-bz2
#ac_add_options --with-system-jpeg
#ac_add_options --with-system-zlib
#ac_add_options --with-system-nss
#ac_add_options --with-system-nspr 

## NSPR too old (required version >=4.13.1)
## check if your version match the requirements
#ac_add_options --with-system-nspr 

## NSS too old (required version >= 3.28.5
## check if your version match the requirements
#ac_add_options --with-system-nss

## system's libpng doesn't have APNG support 
## check if your version match the requirements
#ac_add_options --with-system-png 

## SQLITE too old (should be sqlite3 >= 3.8.9)
## check if your version match the requirements
#ac_add_options --enable-system-sqlite 

## system cairo might cause application crashes
#ac_add_options --enable-system-cairo

Set the configuration variables (file: src/browser/confvars.sh)

Some configuration variables can only be set directly, editing the src/browser/confvars.sh file provided with the sources.

Use your favourite text editor to modify the src/browser/confvars.sh file if necessary.

Please note that:

  • a deep knowledge and comprehension of the source code and the build process is needed to safely modify this file
  • the documentation about these variables is often poor and/or unclear
  • is *highly reccomended* to avoid unnecessary changes in this file if in dubt

Here below are listed some variables settings which can be safely add (trying to increase privacy) at the VERY BOTTOM of the src/browser/confvars.sh file in order to build IceCat 52.3.0 as suggested in this document.

Please note that:

  • this file has been successfully tested building IceCat 52.3.0 on a updated (2017-10-28) Devuan GNU+Linux Jessie 1.0 amd64 machine
  • before to start the build process is *highly reccomended* to check carefully all the content of this file, in order to set/unset variables accordingly with your preferences
### 
###  icecat 'src/browser/confvars.sh' APPEND file
### 

## IMPORTANT NOTICE:
## append the following lines to the VERY BOTTOM of 'src/browser/confvars.sh'

## Extra IceCat settings
MOZ_APP_VENDOR=GNU
MOZ_APP_VERSION=52.3.0
MOZ_APP_PROFILE=mozilla/icecat
MOZ_ANDROID_GOOGLE_PLAY_SERVICES=
MOZ_BUNDLED_FONTS=1
MOZ_CRASHREPORTER=
MOZ_CRASHREPORTER_DISABLE=1
MOZ_DATA_REPORTING=
MOZ_DEVICES=
MOZ_SERVICES_FXACCOUNTS=
MOZ_SERVICES_HEALTHREPORT=
MOZ_SERVICES_HEALTHREPORTER=
MOZ_SERVICES_METRICS=
MOZ_SERVICES_SYNC=
MOZ_SOCIAL=
MOZ_TELEMETRY_REPORTING=
MOZ_UPDATER=
MOZ_ADDON_SIGNING=
MOZ_PAY=
MOZ_SERVICES_BLOCKLISTS=
MOZ_SERVICES_CLOUDSYNC=

Build

Building the binaries means run configure and make. It 'a heavy task, requiring significant system resources and can last for a very long time. Building as suggested in this document, on a machine with a 64bit CPU 4-core 3.8GHz, 16GB RAM and using ccache, takes about 20-25 minutes.

  • Prepare the directory <build_basepath>/icecat-52.3.0/obj where to build

The build will take place in a separate so-called objdir sub-directory (whose path has been previously set in the src/mozconfig file), in order to leave clean the sources tree.:

$ mkdir obj
$ cd obj
  • Run configure

Staying in the <build_basepath>/icecat-52.3.0/obj directory, please run:

$ ../src/configure

or, if you want to capture and save the output of the command to the terminal:

$ ../src/configure  2>&1 | tee config.txtout

If saved as above (using tee), the command script output to the terminal will be in the config.txtfile file.

The command script log will be in the config.log file.

  • Run make

Staying in the <build_basepath>/icecat-52.3.0/obj directory, please run:

$ make -j<N> -f ../src/client.mk

or, if you want to capture and save the output of the command to the terminal:

$ make -j<N> -f ../src/client.mk  2>&1 | tee make.txtout

where:

<N>: is the number of the CPU cores/threads you want to be used during the compilation

If saved as above (using tee), the command script output to the terminal will be in the make.txtfile file.

  • Langpack (optional)

You can simply download the pre-built IceCat 52.3.0 langpacks which you need.

Otherwise, if you prefer to build yourself a langpack, please run:

$ cd browser/locales
$ make langpack-$LANG LOCALE_MERGEDIR=.
$ cd ../..

where:

$LANG: is the locale of the langpack to build

Install

After the building process has been successfully completed, you might want to install Gnuzilla IceCat on your system.

Standalone installation

To install the binaries as a "standalone" program, staying in the <build_basepath>/icecat-52.3.0/obj directory, please run:

$ make install DESTDIR=<build_basepath>/icecat-52.3.0/bin

or, if you want to capture and save the output of the command to the terminal:

$ make install DESTDIR=<build_basepath>/icecat-52.3.0/bin  2>&1 | tee install.txtout

where:

<build_basepath>: is the *absolute* path of a directory you should choose as base for all the building process

If saved as above (using tee), the command script output to the terminal will be in the install.txtfile file.

The "standalone" binaries will be generated into the <build_basepath>/icecat-52.3.0/bin/usr/lib/icecat-52.3.0 directory.

To install, just copy the directory with the "standalone" binaries in an appropriate place to be used in your system. A common suggested place is /opt/icecat.

Tarball package creation

To create a binary tarball, staying in the <build_basepath>/icecat-52.3.0/obj directory, please run:

$ cd browser/installer
$ make
$ cd ../..

The tarball package will be generated into the <build_basepath>/icecat-52.3.0/obj/dist directory.


Enjoy Gnuzilla IceCat!


[ Document edited by: alexus ]