This repository contains files to build Debian packages of ungoogled-chromium.
This branch contains the code to build packages for: Debian 10 (buster)
Binaries (i.e. .deb
packages): Get them from the Contributor Binaries website.
If your distro is not listed, you may have a look at the community-maintained list of packages compatible on other distros. However, please note that this compatibility is not guarenteed; it may break at any time.
Source Code: Use the tags labeled with buster
via git checkout
(see building instructions). The branches are for development and may not be stable.
NOTE: The packages are essentially identical in structure to Debian's chromium
packages. As a result, they cannot be installed simultaneously with the distro-provided Chromium package.
At minimum, you will need to install the ungoogled-chromium
and ungoogled-chromium-common
packages. For example:
# dpkg -i ungoogled-chromium_*.deb ungoogled-chromium-common_*.deb
The other packages are as follows:
*-driver
: ChomeDriver*-l10n
: Localization package for the browser UI.*-sandbox
:SUID
Sandbox. This is only necessary if you do not have user namespaces enabled (i.e. kernel parameterkernel.unprivileged_userns_clone
)*-shell
: Containscontent_shell
. Mainly for browser development/testing; search the Chromium docs for more details.*-dbgsym*
: Debug symbols for the associated package.
# Install essential requirements
sudo apt install git python3 packaging-dev
# Setup build tree under build/
mkdir -p build/src
git clone --recurse-submodules https://github.com/ungoogled-software/ungoogled-chromium-debian.git
# Replace TAG_OR_BRANCH_HERE with the tag or branch you want to build
git checkout --recurse-submodules TAG_OR_BRANCH_HERE
# NOTE: If you are reading this on GitHub, make sure to read the version corresponding
# to your checkout of this repo (replace TAG_OR_BRANCH_HERE with the tag or branch you want to build):
# https://github.com/ungoogled-software/ungoogled-chromium-debian/blob/TAG_OR_BRANCH_HERE/README.md
#
# Or, just read the README in your local repo.
cp -r ungoogled-chromium-debian/debian build/src/
cd build/src
# Final setup steps for debian/ directory
./debian/rules setup-debian
# Add packages for LLVM 8
# One way to do this is to install from buster-backports:
# 1. Add this line to your /etc/apt/sources.list: deb http://deb.debian.org/debian/ buster-backports main
# 2. Run "apt update"
#
# Another way is to use the APT repo from apt.llvm.org
# 1. Add this line to your /etc/apt/sources.list: deb http://apt.llvm.org/buster/ llvm-toolchain-buster-8 main
# 2. Follow the instructions on https://apt.llvm.org for adding the signing key
# 3. Run "apt update"
#
# You do not need to install LLVM packages yourself, since the next step will do it for you.
# Install remaining requirements to build Chromium
sudo mk-build-deps -i debian/control
rm ungoogled-chromium-build-deps_*.deb
# Download and unpack Chromium sources (this will take some time)
./debian/rules setup-local-src
# Start building
dpkg-buildpackage -b -uc
If the build aborts during the last command, it can be restarted with this command:
dpkg-buildpackage -b -uc -nc
If it still fails, then try this command (this will clear any intermediate build outputs):
dpkg-buildpackage -b -uc
If all else fails, delete the entire build tree and start again.
Build via a Debian source package (i.e. .dsc
, .orig.tar.xz
, and .debian.tar.xz
). This is useful for online build services like Launchpad and openSUSE Build Service.
First, install base requirements: # apt install packaging-dev python3
Then, run the following as a regular user:
# TODO: Re-use instructions from above
debian/rules get-orig-source
debuild -S -sa
(PACKAGE_TYPE_HERE
is the same as above)
Source package files will appear under build/
This section contains information for those contributing to ungoogled-chromium-debian.
- Clone this repo
- Add the remote for Debian as
upstream
:
git remote add upstream https://salsa.debian.org/chromium-team/chromium.git
These instructions will pull in changes from Debian's chromium
package into debian_buster
:
git checkout --recurse-submodules debian_buster
git pull upstream master
# Complete the git merge
# Update patches via instructions below
There are two options, which depend on the use case.
- Update to tag (where
TAG_HERE
is the tag name):
pushd debian/ungoogled-upstream/ungoogled-chromium/
git fetch
git checkout TAG_HERE
popd
# Commit the submodule changes
# Update patches via instructions below
- Update to HEAD of
master
branch:
git submodule update --remote
# Commit the submodule changes
# Update patches via instructions below
./debian/devutils/update_patches.sh merge
source debian/devutils/set_quilt_vars.sh
# Setup Chromium source
mkdir -p build/{src,download_cache}
./debian/ungoogled-upstream/ungoogled-chromium/utils/downloads.py retrieve -i debian/ungoogled-upstream/ungoogled-chromium/downloads.ini -c build/download_cache
./debian/ungoogled-upstream/ungoogled-chromium/utils/downloads.py unpack -i debian/ungoogled-upstream/ungoogled-chromium/downloads.ini -c build/download_cache build/src
cd build/src
# Use quilt to refresh patches. See ungoogled-chromium's docs/developing.md section "Updating patches" for more details
quilt pop -a
# Remove all patches introduced by ungoogled-chromium
./debian/devutils/update_patches.sh unmerge
# Ensure debian/patches/series is formatted correctly, e.g. blank lines
# Sanity checking for consistency in series file
./debian/devutils/check_patch_files.sh
# Remove entries from debian/copyright that are used in patches
./debian/devutils/fix_copyright_excludes.py
# Use git to add changes and commit
# Make sure you are in the build sandbox
cd build/src
./debian/scripts/revert_domainsubstitution
# Debian already applied patches via quilt. Use quilt to modify patches
# Once you are done, copy the patches from build/src/debian/patches
# to this repo's debian/patches
./debian/scripts/apply_domainsubstitution
dpkg-buildpackage -b -uc -nc
To add either a primary or secondary branch:
- Create a new branch that forks off an existing branch with code that is closest to the desired code.
- Give the branch a name of the format
DISTRO_CODENAME
. For example, Ubuntu 18.10 (cosmic) should have a branch nameubuntu_cosmic
. - Make the necessary changes and commit
- Submit a Pull Request for your new branch to the branch it is based off of. In the Pull Request, specify the new branch name that should be created. (This is necessary because GitHub doesn't support the creation of branches via PRs)
- Update the commit or tag version of the ungoogled-chromium repository in
debian/ungoogled-upstream/version.txt
as necessary. - Increment the revision in
debian/distro_revision.txt
. However, if the upstream version was changed in Step 1, reset the revision to1
. - Use
git tag
to add a new tag with the name generated fromdebian/devutils/print_tag_version.sh
- e.g.
git tag -s $(./debian/devutils/print_tag_version.sh)
- NOTE: This requires that
debian/ungoogled-upstream/ungoogled-chromium
contains the ungoogled-chromium repo files.
- e.g.
If you're going to backport a branch for a newer distro version onto an older distro branch, you will need to either:
- Try to use the older system library: Change
debian/control
to use an older version and get patches for Chromium to work with the older system library. - Use the bundled system library instead:
- If you are merging a newer distro's branch into an older distro's branch, and the older distro's branch removed the system library, git may automatically strip out most, if not all, the code to use the system library.
- For libraries like ICU or VA-API, there may be commits in the history that added or removed the library (try a search on the commit history). You can try cherry-picking them, or using them as a reference.
- Remove the dependency in
debian/control
- Determine the library's name under Chromium's
third_party/
directory. We will refer to this name as$LIB_NAME
below. Note that there are multiplethird_party
directories; the most common one is at the root of the Chromium source tree. Another one you may see isbase/third_party
. The following instructions still apply regardless of whichthird_party
directory you use. - Add
$LIB_NAME
to thekeepers
tuple indebian/scripts/unbundle
. Also, check for any special removal logic, such as calls to functionsstrip
andremove_file
. - Remove any filepaths including
third_party/$LIB_NAME
indebian/clean
. - Some libraries may produce additional build outputs (e.g. switching back to bundled ICU). In this scenario, you will need to add the build outputs into the relevant package's
.install
file. Seedebian/control
for what the different packages are. - Check for any special rules in
debian/rules
dealing with your library underthird_party/$LIB_NAME
- Remove any entries involving
third_party/$LIB_NAME
from theFiles-Excluded
section ofdebian/copyright
- Remove any patches from
debian/patches/
relating to your library.
Contribution guidelines are the same as ungoogled-chromium.
Submit PRs to this repository for every packaging type that should be updated.
There are a few differences with Debian's Chromium:
- Modified default CLI flags and preferences; see
debian/etc/default-flags
anddebian/etc/master_preferences
- Re-enable
chrome://tracing
and DevTool's Performance tab - Package names are prefixed with
ungoogled-
, and will conflict Debian's Chromium packages. - Use LLVM instead of GCC
- Enable more FFMpeg codecs by default
- Use tcmalloc (Chromium default) instead of the system's memory allocator