Tuesday, January 04, 2022

Adding an -ungoogled flavor to www/chromium

Hi ports@,

Here is my attempt at porting ungoogled-chromium[1] (which I'll
call "uc" for terseness): https://pseven.xyz/pub/chromium-uc.tar.gz

According to Wikipedia, uc is a project "with the aim of increasing
privacy through removing Google components and blobs". I think it's
a good alternative to the Iridium browser (which is already in
ports), since it is updated more often, has more or less the same
goals, and goes further in order to achieve these goals (uc even
includes Iridium patches), hence why I started working on it.

As suggested by robert@ in [2], it's not actually a new port, but
rather an aditional flavor to the existing chromium port. In order
to integrate with the ports system, every patch and several files
have been imported with some changes. I'll try to explain what I've
done ; I'm not a native English speaker, so if something is unclear,
please let me know.

- patches/{core/,extra/} contains all the patches from uc, preserving
the file hierarchy. Every diff header has been modified so that uc
patches can be applied during do-patch. Some uc patches conflict
with OpenBSD patches, namely:

core/ungoogled-chromium/doh-changes.patch

extra/ungoogled-chromium/disable-download-quarantine.patch

extra/ungoogled-chromium/enable-paste-and-go-new-tab-button.patch

extra/ungoogled-chromium/disable-download-quarantine.patch

These patches have been further modified so that they can be correctly
applied after the existing ones.

- Only a list of certain patches should be applied in a specific
order - this list is contained in files/series, whose contents are
added to PATCH_LIST at the end of the Makefile (there's probably a
better way to do this). This file has been imported unchanged from
uc.

- files/pruning.list contains a list of files to be removed from
the source tree. A line has been removed from this list:

chrome/build/pgo_profiles/chrome-linux-...

This file changes name with each release, so its deletion is done
inside the Makefile, where a glob (chrome-linux-*) is used instead.

- files/domain_substitution.list contains a list of files where
certain domain names should be "neutralized" by replacing them with
a corresponding string. Affected domain names and replacements are
stored in files/domain_regex.list. In uc, this file uses a custom
format that is parsed by a python script ; it has been turned into
a perl script, since perl is in base and the patterns used for
matching domains use a common subset of perl's and python's regexes.

- In uc, the steps of patching, removing files and substituting
domains are done by python scripts. In order to integrate everything
with the ports system, the Makefile now takes care of them with the
post-patch target.

- uc has a flags.gn file containing a list of flags given to gn.
Since some flags conflict with those already set in the Makefile,
they are selected (or not) depending on the flavor.

- uc generates a "chromedriver" binary instead of
"chromedriver.unstripped". This has been reflected in the Makefile.

- I'm not sure where uc's LICENSE file should be located, for now
it's in files/.

Thank you for reading this far, I'd be happy to read your comments.

[1] https://github.com/Eloston/ungoogled-chromium

[2] https://marc.info/?l=openbsd-ports&m=156166568208397&w=2

No comments:

Post a Comment