Build Firefox with patches and a custom pdf.js version on Linux and macOS. To
use your own patches, place them under ./patches before starting the build.
Configuration variables for the build are set in config.mk.
Linux targets can be built from both Linux and macOS via containers.
make $DISTROSupported DISTRO values:
ubuntuarchlinux
The TARGET= variable controls the target architecture, only
x86_64-linux-gnu is tested to work for Linux.
The macOS target can only be built from a macOS host. The default configuration in the repository compiles for arm64, cross-compiling from a x86_64 machine should work. You need at least 64 GB of disk. Setup from a fresh install:
- Setup Xcode, can be downloaded from here (Apple ID required)
xcode-select --install
(cd /Applications && xip --expand ~/Downloads/Xcode_*.xip)
sudo xcode-select --switch /Applications/Xcode.app
sudo xcodebuild -license- Install build dependencies
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew bundle install --file conf/Brewfile
./scripts/rustup.sh- Build
make macosThe builtin pdf.js viewer in Firefox can also be patched from a finished build, you do not need to build from source. NB This can break other extensions in unexpected ways, e.g. the autocompletion for the Vimium omnibar.
# Build pdf.js for Firefox
npx gulp mozcentral
# Patch the omni.ja of your existing installation with your build output
(cd build/mozcentral/browser &&
ln -fns extensions chrome &&
zip "/usr/lib/firefox/omni.ja" 'chrome/*')Useful commands for the mozilla-unified build system:
# (clean)
./mach clobber
# Generate compile_commands.json
./mach build-backend --backend=CompileDB
# Custom user.js can be put in ./my_profile
./mach run -n -- --profile ./my_profile
# Possible arguments for ac_add_options
./configure --helpTo reuse the same profile after downgrading Firefox, delete
~/.mozilla/firefox/$PROFILE/compatibility.ini.