Build Pale Moon on Linux

Prerequisites

  • GCC - Minimum version required is 4.7. Version 4.9 is recommended, and versions 5.x and 6.x are still experimental.
  • Python 2.7.x
  • Exactly Autoconf 2.13
  • at least 4 GB Ram

Getting the source

Due to Linux's strict file permission model it is recommended that you obtain the source from the Official GitHub Repo directly either by cloning the repo or by downloading and extracting a tarball from the appropriate release tag.

If you chose to use the 7zip packed sources from the website you may encounter compilation issues due to file permissions (or lack thereof). A heavy-handed workaround is to chmod the entire source directory as executable, e.g.

$ chmod -R 744 pmsrc

Mozconfig Files

You will need to create a file called .mozconfig in the same folder you unpack the Pale Moon source to. Do not omit the . at the start. Make sure it is {dot}mozconfig and not .mozconfig.txt or similar.

Make sure it contains at least the following for a build that is similar to official builds:

# Please see https://www.palemoon.org/redist.shtml for restrictions when using the official branding.
ac_add_options --enable-official-branding
export MOZILLA_OFFICIAL=1
 
mk_add_options MOZ_CO_PROJECT=browser
ac_add_options --enable-application=browser
 
mk_add_options MOZ_OBJDIR=/home/$USER/pmbuild/
 
ac_add_options --enable-optimize="-O2 -msse2 -mfpmath=sse"
ac_add_options --with-pthreads
 
ac_add_options --disable-installer
ac_add_options --disable-updater
 
ac_add_options --enable-release
ac_add_options --enable-devtools
ac_add_options --enable-jemalloc
ac_add_options --enable-shared-js
 
ac_add_options --enable-strip
 
ac_add_options --x-libraries=/usr/lib

Test-running Newly-Built Pale Moon

Once "./mach build" and "./mach package" have run successfully, you can test-run Pale Moon, assuming that build is not for a different architecture or cpu, which won't run on your machine. From the parent directory of "pmbuild", the command to launch the profile manager is...

pmbuild/dist/palemoon/palemoon -no-remote -p

From there, you can select any profile that is not current being used. If all profiles are in use, you can create a new one.

Installing Pale Moon from a tarball

See the Linux_install_from_tarball page for instructions and examples.

CentOS 6

CentOS 6 Build Prerequisites

Enable the EPEL repository so that we can install all the required build dependencies:

yum install epel-release

Install the required development packages using the following commands:

yum install autoconf213 yasm mesa-libGL-devel alsa-lib-devel libXt-devel \ 
zlib-devel openssl-devel sqlite-devel bzip2-devel pulseaudio-libs-devel
yum groupinstall 'Development Tools' 'GNOME Software Development'

The versions of Python 2 and the development tools that ship with CentOS 6 are too old and will not build Pale Moon. You can install the Python 2.7 Software Collection and the Red Hat Developer Toolset v3 to get newer versions that are supported.

First, install the Software Collections repository with the following command:

yum install centos-release-scl-rh

Now install Python 2.7 Software Collection (which includes setuptools, pip, and virtualenv) and the Red Hat Developer Toolset v3 Software Collection (which includes GCC 4.9.2 and friends):

yum install python27 devtoolset-3-toolchain

Using a text editor, create a shell script (e.g. build.sh) with the following contents and save it in your home directory:

#!/bin/bash
 
if [ ! -d "pmsrc" ] || [ ! -d "pmbuild" ] ; then
  echo "Missing directories!"
  exit 1
fi
 
cd pmsrc/
 
echo "Build?"
read -n 1 ch
 
if [ "$ch" == "y" ] ; then
  make -f client.mk build &> /dev/stdout | tee buildlog.txt
  if [ ${PIPESTATUS[0]} == 0 ]; then
    cd "../pmbuild"
    make package
  fi
else
  echo "Compilation aborted."
fi

Extract the Pale Moon source code to /home/$USER/pmsrc/. After extracting, create a mozconfig file (see above). You will also need to create a /home/$USER/pmbuild/ directory (the build.sh script will fail without it). Then execute the following command from a terminal to start the build:

scl enable python27 devtoolset-3 ./build.sh

CentOS 7

The generic x86_64 Linux package that we distribute is built on CentOS 7 and at present is considered the official configuration and build environment.

CentOS 7 Build Prerequisites

Enable the EPEL repository so that we can install all the required build dependencies:

yum install epel-release

Install the required development packages using the following commands:

yum install gtk2-devel dbus-glib-devel autoconf213 yasm mesa-libGL-devel \ 
alsa-lib-devel libXt-devel zlib-devel openssl-devel sqlite-devel bzip2-devel pulseaudio-libs-devel
yum groupinstall 'Development Tools'

Extract the Pale Moon source code to /home/$USER/pmsrc/. Navigate to the pmsrc directory and create a mozconfig file (see above). Then execute the following command from a terminal to start the build:

./mach build

Once the build is complete, you'll get a reminder to package the build. To do that, execute the following:

./mach package

You should now have a shiny new tarball located in your /pmbuild/dist/ directory!

Fedora

XXX: TODO - Add instructions

Debian

XXX: TODO - Add instructions

Build dependencies:

apt-get install build-essential libgtk2.0-dev libdbus-glib-1-dev autoconf2.13 yasm \
libegl1-mesa-dev libasound2-dev libxt-dev zlib1g-dev libssl-dev \
libsqlite3-dev libbz2-dev libpulse-dev zip python2.7 python-dbus

Ubuntu

XXX: TODO - Add instructions

Manjaro

XXX: TODO - Add instructions

Arch

XXX: TODO - Port from Repo Wiki

Gentoo

Emerge compile-time dependencies:

# emerge -n1 sys-devel/gcc:4.9.3 =sys-devel/autoconf-2.13 \
dev-lang/python:2.7 dev-lang/perl dev-lang/yasm

Emerge run-time dependencies:

# emerge -n x11-libs/libXt app-arch/zip media-libs/freetype media-libs/fontconfig \
sys-libs/glibc virtual/libffi sys-apps/dbus dev-libs/dbus-glib x11-libs/gtk+:2 \
media-sound/pulseaudio net-wireless/wireless-tools

Set the "x264" USE flag for virtual/ffmpeg and emerge it:

# (mkdir /etc/portage/package.use; \
echo "virtual/ffmpeg x264" >> /etc/portage/package.use/ffmpeg) \
|| echo "virtual/ffmpeg x264" >> /etc/portage/package.use
# emerge -nN ffmpeg

Create a /home/$USER/pmsrc/ and a /home/$USER/pmbuild/ directory.
Extract the Pale Moon source code to /home/$USER/pmsrc/ and cd to it.

Copy the .mozconfig file above to the current directory and add the following to it to make sure that the build system will use the correct GCC, Python and Autoconf versions:

export CC=gcc-4.9.3
export CXX=g++-4.9.3
mk_add_options PYTHON=/usr/bin/python2
mk_add_options AUTOCONF=/usr/bin/autoconf-2.13

Execute the following to start the build:

$ ./mach build

Once the build is complete, execute the following to make the package:

$ ./mach package

If everything went well, you'll find the newly created package inside /home/$USER/pmbuild/dist/.

Firefox, Mozilla Firefox and Mozilla are registered trademarks of the Mozilla Corporation.
Site design and Branding © 2016 Moonchild Productions - All rights reserved
Any other content is copyright or trademark to their respective owners.
This site uses Cookies - Your usage indicates your consent to their use.

The Pale Moon Developer Wiki is powered by Enano