Group: IceCat/Compile and package/build 52.6.0 on Devuan 2.0.0 ASCII 64bit

From LibrePlanet
Jump to: navigation, search
  • The information contained in this page is current as of: 2018-07-14.
  • The text in this page was last modified on: 2018-07-14.

Introduction

This page contains a report, with comments and hints, on a successful build of Gnuzilla IceCat 52.6.0 [1] (-gnu1) on a updated (2018-07-14) Devuan GNU+Linux 2.0.0 ASCII amd64 machine.

Devuan GNU+Linux is a fork of Debian without systemd. Devuan's stable release is now 2.0.0 ASCII which provides a flawless switch from Debian 9.0 (Stretch) 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 ASCII and Debian Stretch.

IMPORTANT NOTE: The reccomended way to run commands is from a Bash terminal. Avoid any graphical tool!

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.6.0 you need some libraries to be installed and some dependencies to be satisfied. Please install (this is required only once):

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

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

  • Linux environment files
$ sudo apt-get install gcc-4.9 perl make libgtk2.0-dev 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 libasound2-dev libnotify-dev yasm libpython2.7-dev python2.7 python2.7-dev autoconf2.13 m4 binutils-avr libgl1-mesa-dev

IMPORTANT NOTE: These versions are required: gcc >=4.9, perl >= 5.6, GNU make >= 3.80, gtk2 >= 2.10, gtk3 >= 3.4, libidl >= 0.6.3, zip >= 2.3, freetype >= 2.1.0, pkg-config >= 0.9.0, gstreamer >= 0.10, yasm >= 1.1.0, python >= 2.7.3 (python 3 will NOT work!), autoconf=2.13 (requires GNU m4) (Autoconf 2.5x will NOT work!)

(see: Linux_Prerequisites at the Mozilla Developer Network).

  • Other suggested libraries and dependencies
$ sudo apt-get install libatk libc6 libcairo2 libffi6 libffi-dev libfontconfig1 libfreetype6 libgcc1 libgtk-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.6.0
$ cd icecat-52.6.0

where:

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

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

$ curl -O -J -L 'https://ftp.gnu.org/gnu/gnuzilla/52.6.0/icecat-52.6.0-gnu1.tar.bz2' 
$ curl -O -J -L 'https://ftp.gnu.org/gnu/gnuzilla/52.6.0/icecat-52.6.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.6.0-gnu1.tar.bz2.sig 
  • Prepare the sources

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

$ tar -jxvf icecat-52.6.0-gnu1.tar.bz2
$ mv icecat-52.6.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.

For more detailed information, please see:

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.6.0 as suggested in this document.

Please note that:

  • this file has been successfully tested building IceCat 52.6.0 on a updated (2018-07-14) Devuan GNU+Linux 2.0.0 ASCII 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
#### 

## Linux_Prerequisites - see: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Linux_Prerequisites
## Build options - see: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Configuring_Build_Options
## Source documentation - see: https://firefox-source-docs.mozilla.org/

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

### WARNING: the following lines should NOT be changed
## Mozilla requires Python2 (python3 will NOT work - see: 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

### 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 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"
## default toolkit
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|portable 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

### RECOMMENDED: NOT NECESSARY AND/OR PRIVACY RELATED STUFF

## disable geolocation services
ac_add_options --disable-necko-wifi
ac_add_options --disable-gpsd

## disable unwanted options 
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 (Alsa must be installed in your system!)
## WARNING: commentout BOTH the following two lines to use pulseaudio
ac_add_options --enable-alsa  
ac_add_options --disable-pulseaudio 

## jack audio backend
ac_add_options --enable-jack 

## 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

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.6.0 as suggested in this document.

Please note that:

  • this file has been successfully tested building IceCat 52.6.0 on a updated (2018-07-14) Devuan GNU+Linux 2.0.0 ASCII 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.6.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 25 minutes.

  • Prepare the directory <build_basepath>/icecat-52.6.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.6.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.6.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.6.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.6.0/obj directory, please run:

$ make install DESTDIR=<build_basepath>/icecat-52.6.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.6.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.6.0/bin/usr/lib/icecat-52.6.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.6.0/obj directory, please run:

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

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


Enjoy Gnuzilla IceCat!


[ Document edited by: alexus ]