Skip to content

Kafva/firefox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

firefox

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

Linux targets can be built from both Linux and macOS via containers.

make $DISTRO

Supported DISTRO values:

  • ubuntu
  • archlinux

The TARGET= variable controls the target architecture, only x86_64-linux-gnu is tested to work for Linux.

macOS

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:

  1. 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
  1. 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
  1. Build
make macos

Tips

The 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 --help

To reuse the same profile after downgrading Firefox, delete ~/.mozilla/firefox/$PROFILE/compatibility.ini.

About

Build Firefox with patches and a custom pdf.js version on Linux and macOS

Resources

Stars

Watchers

Forks

Packages

No packages published