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

From LibrePlanet
< Group:IceCat‎ | Compile and package
Revision as of 19:19, 21 August 2016 by Alexus (talk | contribs) (Removed WIP)
Jump to: navigation, search
  • The information contained in this page is current as of: 2016-08-21.
  • The text in this page was last modified on: 2016-08-21.

Introduction

This page contains a report, with comments and hints, on a successful build of Gnuzilla IceCat 38.8.0 on a updated Devuan GNU+Linux Jessie amd64 (64bit) machine.

Devuan GNU+Linux is a fork of Debian without systemd. Devuan Jessie provides continuity as a safe upgrade path from Wheezy and a flawless switch from 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.

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 (optional)

If you want to use ccache (reccommanded) to speed up the build process (see below), please install and configure it (this is required only once):

$ sudo apt-get install ccache
$ mkdir <ccache_basepath>/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

Prepare the requested libraries and dependencies

To successfully build IceCat 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.8 perl make libgtk2.0-dev libxt-dev libidl-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 binutils-avr

IMPORTANT NOTE: These versions are required: autoconf=2.13 (2.5x do not work), freetype >= 2.1.0, gcc >=4.7, libgtk-dev >= 2.10, libidl-dev >= 0.6.3, make >= 3.80, 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 38.8.0 sources)

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

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-38.8.0
$ cd icecat-38.8.0

where:

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

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

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

To prepare the sources tree in the <build_basepath>/icecat-38.8.0/src directory, please run:

$ tar -jxvf icecat-38.8.0-gnu1.tar.bz2
$ mv icecat-38.8.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 38.8.0 as suggested in this document.

Please note that:

  • this file has been successfully tested building IceCat 38.8.0 on a updated Devuan GNU+Linux Jessie amd64 (64bit) 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: 
### add the following lines to the VERY BOTTOM of 'src/mozconfig'


### WARNING: the following lines should NOT be changed
### (from:  . "$topsrcdir/build/mozconfig.common")
mk_add_options AUTOCLOBBER=1
ac_add_options --enable-release
#. "$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 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"
## elf-hack
ac_add_options --disable-elf-hack
## avoid dependency on libstdc++ 4.7
ac_add_options --enable-stdcxx-compat
## stripping
ac_add_options --enable-strip
ac_add_options --enable-install-strip
## build with gio & gtk+-2
ac_add_options --disable-gnomevfs 
ac_add_options --enable-gio 
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 safe browsing
ac_add_options --enable-safe-browsing 
## 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 geolocation services
ac_add_options --disable-necko-wifi
## disable unwanted options (not necessary and/or privacy related stuff)
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-update-channel
ac_add_options --disable-update-packaging
ac_add_options --disable-maintenance-service
ac_add_options --disable-parental-controls
ac_add_options --disable-webapp-runtime


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

## use alsa instead of pulseaudio (Alsa must be installed in your system!)
## WARNING: uncomment BOTH the following two lines to use pulseaudio
ac_add_options --enable-alsa  
ac_add_options --disable-pulseaudio 

## gstreamer support
ac_add_options --enable-gstreamer=0.10

## raw support
ac_add_options --enable-raw

## wave support
ac_add_options --enable-wave

## webm support (VP8 video and Vorbis audio must be installed in your system!)
ac_add_options --enable-webm 

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

## if libjpeg_turbo is installed you could uncomment the next line
ac_add_options --disable-libjpeg_turbo

## 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 --with-system-libevent
ac_add_options --with-system-libvpx
ac_add_options --with-system-nss
ac_add_options --with-system-icu
ac_add_options --with-system-bz2
ac_add_options --with-system-jpeg
ac_add_options --with-system-zlib


### OTHER (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 )!!!

## NSPR too old
## check if your version match the requirements
#ac_add_options --with-system-nspr 

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

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

Please note that:

  • this file has been successfully tested building IceCat 38.8.0 on a updated Devuan GNU+Linux Jessie amd64 (64bit) 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' file
### 

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

## IceCat settings
MOZ_APP_VENDOR=GNU
MOZ_APP_VERSION=38.8.0
MOZ_APP_PROFILE=mozilla/icecat
MOZ_BUNDLED_FONTS=1
MOZ_ANDROID_GOOGLE_PLAY_SERVICES=
MOZ_CRASHREPORTER_DISABLE=1
MOZ_CRASHREPORTER=
MOZ_DATA_REPORTING=
MOZ_DEVICES=
MOZ_SERVICES_FXACCOUNTS=
MOZ_SERVICES_HEALTHREPORT=
MOZ_SERVICES_HEALTHREPORTER=
MOZ_SERVICES_METRICS=
MOZ_SOCIAL=
MOZ_TELEMETRY_REPORTING=
MOZ_UPDATER=
#
## DONT WORK: BUILD OR INSTALL WILL FAIL!
#MOZ_PAY=
#MOZ_SERVICES_SYNC=
#MOZ_SERVICES_CLOUDSYNC=

Build IceCat 38.8.0

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-38.8.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-38.8.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-38.8.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 38.8.0 langpacks 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

Installation

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

Standalone installation

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

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

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

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

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

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


Enjoy Gnuzilla IceCat!


[ Document edited by: alexus ]