Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Compiling Pale Moon on Linux
- Though the process of compiling Pale Moon on Linux is the same as Firefox, the documentation on MDN is lacking. This post will just clarify a few points:
- ## Build prerequisites
- (Original document: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Linux_Prerequisites)
- ### Hardware
- At least 4GB RAM, and more swap area the better. It is possible to compile even with 1.5GB of RAM, and ~3GB of swap area, but this significantly slows down the compilation process.
- ### Build tools and dependencies
- Note:
- - Some Mozilla docs mention that CentOS 5 is used; but for some reason I doubt this -- if it were truly so then Firefox would run on a greater number of platforms. Or perhaps I'm wrong. Personally, I use a CentOS 6.5 VM.
- - The bootstrap.py script does not work on CentOS, because it references a few package groups that do not exist.
- - Updating things should not be done at all until absolutely necessary, for example, to satisfy dependencies.
- For future versions of Pale Moon, please have a look over about:buildconfig of the corresponding version of FF; it contains important hints (versions of compilers, switches etc.)
- First of all, we need to install the necessary packages using the following commands:
- yum install autoconf213 yasm mesa-libGL-devel alsa-lib-devel libXt-devel gstreamer-devel gstreamer-plugins-base-devel pulseaudio-libs-devel
- yum groupinstall 'Development Tools' 'GNOME Software Development'
- However, if you want to save on data, you can correspond the list of packages with the list provided for Debian/Ubuntu. I did this to some extent, but it is simply not worth the time.
- The Mozilla build process also requires Python 2.7, which you can install using the instructions [here](http://toomuchdata.com/2014/02/16/how-to-install-python-on-centos/). In short:
- yum install zlib-dev openssl-devel sqlite-devel bzip2-devel # dependencies
- wget http://www.python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz
- tar -xf Python-2.7.6.tar.xz cd Python-2.7.6
- ./configure --prefix=/usr/local
- make
- make altinstall # don't use make install, this will replace the system python!
- Throw in setuptools, pip and virtualenv along with that:
- wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
- python2.7 ez_setup.py
- easy_install-2.7 pip
- pip2.7 install virtualenv # not really sure if virtualenv is needed
- The development tools on CentOS are old, so let's install newer ones:
- cd /etc/yum.repos.d
- wget http://people.centos.org/tru/devtools-1.1/devtools-1.1.repo
- yum install devtoolset-1.1-{gcc,gcc-c++,binutils,elfutils}
- ## Compiling Pale Moon from source
- build.sh:
- #!/bin/bash
- if [ ! -d "pmsrc" ] || [ ! -d "pmbuild" ] || [ ! -f "mozconfig.txt" ] ; then
- echo "Check the directories and files!"
- exit 1
- fi
- cp mozconfig.txt pmsrc/.mozconfig
- 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
- mozconfig.txt (used in PM4Linux 24.*):
- 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/a2g/pmbuild/
- ac_add_options --disable-crashreporter
- ac_add_options --disable-accessibility
- ac_add_options --disable-parental-controls
- ac_add_options --disable-webrtc
- ac_add_options --disable-logging
- ac_add_options --disable-necko-wifi
- ac_add_options --disable-installer
- ac_add_options --disable-updater
- ac_add_options --disable-websms-backend
- ac_add_options --disable-tests
- ac_add_options --disable-mochitests
- ac_add_options --disable-debug
- ac_add_options --disable-debug-symbols
- ac_add_options --enable-strip
- ac_add_options --enable-jemalloc
- ac_add_options --enable-optimize="-O3 -msse2 -mfpmath=sse"
- ac_add_options --enable-safe-browsing
- ac_add_options --enable-url-classifier
- ac_add_options --enable-chrome-format=omni
- ac_add_options --x-libraries=/usr/lib
- - Download the latest version of Pale Moon and extract the source.
- - Set permissions by using `chmod -R 777 pmsrc/`.
- - Run `scl enable devtoolset-1.1 ./build.sh`.
- A palemoon*.tar.bz2 will await you in the `pmbuild` folder after the compilation completes.
- ## PM4Linux installer
- Compiling and packaging the installer is covered in the README file. In short:
- ./compile [address, default=pm4linux.sourceforge.net]
- Short explanation of what each component does:
- - `bin` - contains binaries that are not generally installed on a standard Linux install.
- - `<arch>/` - binaries specific to each architecture
- - `yad` - GUI dialog program
- - `tools/` - contains shell scripts required by the installer.
- - `gwget` - rudimentary graphical frontend for wget
- - `runasroot` - graphical frontend for sudo (will not use su if sudo is not found, user must manually use `su -c ./pminstaller.sh`).
- - `files/` - additional files not bundled in the `palemoon-*.tar.bz2` package
- - `palemoon.desktop` - menu entry
- - `palemoon` - shell script to launch palemoon; allows for user customisation (see plugin related threads on the forum)
- - `userdocs/` - contains README to be bundled in `pminstaller-*.tar.bz2`.
- - `compile` - shell script to generate the installer bundle.
- - `bash_obfus.plx` - shell script minifier.
- - `installer.sh` - handles installation, uninstallation and upgrades of Pale Moon
- - `sfx.sh` - shell script to handle extraction of compressed data.
- pminstaller.sh:
- +--------------------------------------------+
- | <-----minified contents of sfx.sh-----> |
- | xz-compressed tar data: |
- | +----------------------------------------+ |
- | | installer.sh | |
- | | bin/ | |
- | | i686/ | |
- | | yad | |
- | | [...] | |
- | | tools/ | |
- | | gwget | |
- | | runasroot | |
- | | files/ | |
- | | palemoon.desktop | |
- | | palemoon | |
- | +----------------------------------------+ |
- +--------------------------------------------+
- Additional notes:
- - If something is not working quite right, try doing a build without the minifier.
- - You'd probably never want to retain ownership data in the tar archives; please use `tar --numeric-owner --group=0 --owner=0` unless you know what you're doing!
- - A one liner to disassemble the installer and to inspect its contents:
- tail -n +$(grep 7zXZ pminstaller.sh --binary-files=text -n | grep --binary-files=text -Eo '^[0-9]+') pminstaller.sh | tar -xJf - -C contents/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement