Advertisement
access2godzilla

compiling pale moon on linux

May 21st, 2014
734
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.89 KB | None | 0 0
  1. # Compiling Pale Moon on Linux
  2.  
  3. 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:
  4.  
  5. ## Build prerequisites
  6.  
  7. (Original document: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Linux_Prerequisites)
  8.  
  9. ### Hardware
  10.  
  11. 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.
  12.  
  13. ### Build tools and dependencies
  14.  
  15. Note:
  16.  
  17. - 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.
  18. - The bootstrap.py script does not work on CentOS, because it references a few package groups that do not exist.
  19. - Updating things should not be done at all until absolutely necessary, for example, to satisfy dependencies.
  20.  
  21. 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.)
  22.  
  23. First of all, we need to install the necessary packages using the following commands:
  24.  
  25. yum install autoconf213 yasm mesa-libGL-devel alsa-lib-devel libXt-devel gstreamer-devel gstreamer-plugins-base-devel pulseaudio-libs-devel
  26. yum groupinstall 'Development Tools' 'GNOME Software Development'
  27.  
  28. 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.
  29.  
  30. 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:
  31.  
  32. yum install zlib-dev openssl-devel sqlite-devel bzip2-devel # dependencies
  33. wget http://www.python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz
  34. tar -xf Python-2.7.6.tar.xz cd Python-2.7.6
  35. ./configure --prefix=/usr/local
  36. make
  37. make altinstall # don't use make install, this will replace the system python!
  38.  
  39. Throw in setuptools, pip and virtualenv along with that:
  40.  
  41. wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
  42. python2.7 ez_setup.py
  43. easy_install-2.7 pip
  44. pip2.7 install virtualenv # not really sure if virtualenv is needed
  45.  
  46. The development tools on CentOS are old, so let's install newer ones:
  47.  
  48. cd /etc/yum.repos.d
  49. wget http://people.centos.org/tru/devtools-1.1/devtools-1.1.repo
  50. yum install devtoolset-1.1-{gcc,gcc-c++,binutils,elfutils}
  51.  
  52. ## Compiling Pale Moon from source
  53.  
  54. build.sh:
  55.  
  56. #!/bin/bash
  57.  
  58. if [ ! -d "pmsrc" ] || [ ! -d "pmbuild" ] || [ ! -f "mozconfig.txt" ] ; then
  59. echo "Check the directories and files!"
  60. exit 1
  61. fi
  62.  
  63. cp mozconfig.txt pmsrc/.mozconfig
  64. cd pmsrc/
  65.  
  66. echo "Build?"
  67. read -n 1 ch
  68.  
  69. if [ "$ch" == "y" ] ; then
  70. make -f client.mk build &> /dev/stdout | tee buildlog.txt
  71. if [ ${PIPESTATUS[0]} == 0 ]; then
  72. cd "../pmbuild"
  73. make package
  74. fi
  75. else
  76. echo "Compilation aborted."
  77. fi
  78.  
  79. mozconfig.txt (used in PM4Linux 24.*):
  80.  
  81. ac_add_options --enable-official-branding
  82. export MOZILLA_OFFICIAL=1
  83.  
  84. mk_add_options MOZ_CO_PROJECT=browser
  85. ac_add_options --enable-application=browser
  86.  
  87. mk_add_options MOZ_OBJDIR=/home/a2g/pmbuild/
  88.  
  89. ac_add_options --disable-crashreporter
  90. ac_add_options --disable-accessibility
  91. ac_add_options --disable-parental-controls
  92. ac_add_options --disable-webrtc
  93. ac_add_options --disable-logging
  94. ac_add_options --disable-necko-wifi
  95. ac_add_options --disable-installer
  96. ac_add_options --disable-updater
  97. ac_add_options --disable-websms-backend
  98.  
  99. ac_add_options --disable-tests
  100. ac_add_options --disable-mochitests
  101. ac_add_options --disable-debug
  102. ac_add_options --disable-debug-symbols
  103.  
  104. ac_add_options --enable-strip
  105. ac_add_options --enable-jemalloc
  106. ac_add_options --enable-optimize="-O3 -msse2 -mfpmath=sse"
  107.  
  108. ac_add_options --enable-safe-browsing
  109. ac_add_options --enable-url-classifier
  110. ac_add_options --enable-chrome-format=omni
  111.  
  112. ac_add_options --x-libraries=/usr/lib
  113.  
  114. - Download the latest version of Pale Moon and extract the source.
  115. - Set permissions by using `chmod -R 777 pmsrc/`.
  116. - Run `scl enable devtoolset-1.1 ./build.sh`.
  117.  
  118. A palemoon*.tar.bz2 will await you in the `pmbuild` folder after the compilation completes.
  119.  
  120. ## PM4Linux installer
  121.  
  122. Compiling and packaging the installer is covered in the README file. In short:
  123.  
  124. ./compile [address, default=pm4linux.sourceforge.net]
  125.  
  126. Short explanation of what each component does:
  127.  
  128. - `bin` - contains binaries that are not generally installed on a standard Linux install.
  129. - `<arch>/` - binaries specific to each architecture
  130. - `yad` - GUI dialog program
  131. - `tools/` - contains shell scripts required by the installer.
  132. - `gwget` - rudimentary graphical frontend for wget
  133. - `runasroot` - graphical frontend for sudo (will not use su if sudo is not found, user must manually use `su -c ./pminstaller.sh`).
  134. - `files/` - additional files not bundled in the `palemoon-*.tar.bz2` package
  135. - `palemoon.desktop` - menu entry
  136. - `palemoon` - shell script to launch palemoon; allows for user customisation (see plugin related threads on the forum)
  137. - `userdocs/` - contains README to be bundled in `pminstaller-*.tar.bz2`.
  138. - `compile` - shell script to generate the installer bundle.
  139. - `bash_obfus.plx` - shell script minifier.
  140. - `installer.sh` - handles installation, uninstallation and upgrades of Pale Moon
  141. - `sfx.sh` - shell script to handle extraction of compressed data.
  142.  
  143. pminstaller.sh:
  144. +--------------------------------------------+
  145. | <-----minified contents of sfx.sh-----> |
  146. | xz-compressed tar data: |
  147. | +----------------------------------------+ |
  148. | | installer.sh | |
  149. | | bin/ | |
  150. | | i686/ | |
  151. | | yad | |
  152. | | [...] | |
  153. | | tools/ | |
  154. | | gwget | |
  155. | | runasroot | |
  156. | | files/ | |
  157. | | palemoon.desktop | |
  158. | | palemoon | |
  159. | +----------------------------------------+ |
  160. +--------------------------------------------+
  161.  
  162. Additional notes:
  163. - If something is not working quite right, try doing a build without the minifier.
  164. - 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!
  165. - A one liner to disassemble the installer and to inspect its contents:
  166.  
  167. 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