Skip to content

Commit ffb7aef

Browse files
committed
51.0.2704.106-1
Update README.md and BUILDING.md with up-to-date information Add simple build.py for Debian
1 parent 926e892 commit ffb7aef

File tree

3 files changed

+128
-58
lines changed

3 files changed

+128
-58
lines changed

BUILDING.md

Lines changed: 28 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,30 @@
22

33
**Notice for master branch users**: The information in this document may not apply to the latest tag version. Please consult the documentation from the tag instead.
44

5-
ungoogled-chromium provides scripts to automate the downloading, patching, and building of Chromium with these patches. Here's an overview of the building scripts and files:
6-
* `build-sandbox` - This directory is the build sandbox; the container for all files used and generated during building. It is created when the building environment is setup.
7-
* `build_templates` - This holds the system-dependent files that are used for compiling and generating a binary package. They are copied into the build sandbox by the build setup scripts.
8-
* `debian` - This contains files to generate a dpkg debian directory. Debian-specific patches are located here.
9-
* `ubuntu` - This contains files to generate a dpkg debian directory for Ubuntu
10-
* `download_source.sh` - This script downloads the source tarball from `commondatastorage.googleapis.com` and unpacks it into the build sandbox.
11-
* It accepts arguments; pass in `-h` for more information.
12-
* `generate_domain_substitution_list.sh` - This script generates a list of files containing domain names to be replaced
13-
* It should be run at the root of the build sandbox.
14-
* This script is not needed during the normal build process
15-
* `domain_substitution_list` - This file is generated by `generate_domain_substitution_list.sh` for a specific version of Chromium
16-
* It assumes that the cleaning list has been applied
17-
* `domain_regex_list` - The list of regular expressions used to substitute domain names
18-
* `evaluate_domain_substitution_list.py` - This script evaluates the domain substitution list in the current working directory
19-
* `generate_cleaning_list.sh` - This script generates a file list of mostly all binary files to be stripped from the source tree.
20-
* It should be run at the root of the build sandbox.
21-
* This script is not needed during the normal build process
22-
* `cleaning_list` - This file is generated by `generate_cleaning_list.sh` for a specific version of Chromium
23-
* `evaluate_cleaning_list.py` - This script evaluates the cleaning list in the current working directory
24-
* `generate_debian_scripts.sh` - This script creates a dpkg debian directory in the build sandbox for Debian
25-
* `generate_ubuntu_scripts.sh` - This script creates a dpkg debian directory in the build sandbox for Ubuntu
26-
* `build_debian.sh` - This is the main build script for Debian and derivative distributions. It handles the downloading, patching, and building of .deb packages.
27-
* This script will invoke the other scripts to do certain tasks.
28-
* It accepts arguments; pass in `-h` for more information.
5+
## The building system
6+
7+
ungoogled-chromium provides a flexible and extensible Python library called [`buildlib`](buildlib) that does source code downloading, source cleaning, domain substitution, patching, building, and packaging. There's no documentation on `buildlib` yet, but it's pretty straight-forward to use. [See `build.py`](build.py) for an example on using `buildlib`.
8+
9+
Currently, there is no command-line-configurable build script. You must create a script to use `buildlib`.
10+
11+
## General building requirements
12+
13+
The following is needed to fully use `buildlib`:
14+
* Python 3 (tested on 3.5) for running `buildlib`
15+
* The below can be provided by [Google's depot_tools](https://www.chromium.org/developers/how-tos/install-depot-tools)
16+
* Python 2 (tested on 2.7) for running gyp
17+
* [Jinja2](http://jinja.pocoo.org/) for running gyp
18+
* [Ninja](https://ninja-build.org/) for running the build command
19+
20+
There are additional requirements for specific platforms. See the following sections for more information.
21+
22+
## How to build
23+
24+
Building is done by simply invoking a Python script like `build.py`. It will take care of the setup and building processes. See the following for more information.
2925

3026
## Debian and derivatives
3127

32-
Distributions supported: Debian Jessie 64-bit and Stretch 64-bit, and Ubuntu Xenial 64-bit
28+
As of now, only Debian Stretch 64-bit is tested. Ubuntu Xenial 64-bit support will come soon.
3329
This may work on other Debian-based distributions and 32-bit systems
3430

3531
**Note for Debian Jessie users**: ungoogled-chromium is configured to build against the system's [FFmpeg](https://www.ffmpeg.org/) (available in Stretch and onwards); [Libav](http://libav.org) (used in Jessie) will not work. However, FFmpeg is available in `jessie-backports`. To install it, add `jessie-backports` to the apt sources, and then install `libavutil-dev`, `libavcodec-dev`, and `libavformat-dev` from it. Note that this will replace Libav.
@@ -39,29 +35,25 @@ Run these steps on the system you want to build packages for.
3935
git clone https://github.com/Eloston/ungoogled-chromium.git
4036
cd ungoogled-chromium
4137
git checkout $(git describe --tags `git rev-list --tags --max-count=1`) # Checkout newest tag
42-
# Run dpkg-checkbuilddeps to find packages needed for building
43-
./build_debian.sh -A
38+
dpkg-checkbuilddeps resources/debian/dpkg_dir/control # Use this to see the packages needed to build
39+
./build.py
4440

45-
Debian packages will appear under `ungoogled-chromium/`
46-
47-
Pass the `-h` flag into `build_debian.sh` or `download_source.sh` for more options.
41+
Debian packages will appear in the current working directory.
4842

4943
## Arch Linux
5044

5145
For Arch Linux, consider using [Inox patchset](https://github.com/gcarq/inox-patchset); one of the projects which ungoogled-chromium draws its patches from. It offers pre-built binaries and is also available in AUR.
5246

5347
## Windows
5448

55-
TODO
49+
TODO. See Issue #1
5650

5751
## Other systems, platforms, and configurations
5852

59-
Please note that building on other platforms and systems is not officially supported, and multiple things can go wrong while attempting to build. Nevertheless, here are some tips: TODO
60-
6153
Consult the build instructions on the [Chromium homepage](http://www.chromium.org/Home) to build Chromium for your system.
6254

63-
The patches in the `patches` directory should work for any build of Chromium. They assume a clean and unmodified Chromium source tree.
55+
The main set of patches (in `resources/common/patches`) should work on most, if not all, platforms supported by desktop Chromium. Some patches are there to fix building with certain build flags, so those may not work with other platforms or configurations. However, the patches as they are should apply as long as there is a clean and unmodified source tree.
6456

65-
These patches are also tested with the GYP flags defined in [`build_templates/debian/rules`](build_templates/debian/rules). Note that enabling some flags, such as `safe_browsing`, may cause the build to fail.
57+
It is not recommended to run domain substitution or source cleaning, especially if your build requires additional downloads from Google.
6658

67-
Note about `domain_substitution_list`: Replacing the domains will break URLs in the source tree pointing to Google servers. If your building steps requires additional downloads (such as the the PNaCl toolkit), scripts in the source tree may fail to work.
59+
The domain substitution list, source cleaning list, and some patches in `resources/common` are designed to work with the build flags defined. They may require modifications if the flags are changed.

README.md

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ In addition to features provided by [Iridium Browser](https://iridiumbrowser.de/
1111
* Added menu item under "More tools" to clear the HTTP authentication cache on-demand
1212
* Disabled persistent per-site settings in Preferences file
1313
* Make all popups go to tabs
14-
* Replaced many domains in the source code with non-existant alternatives (see `generate_domain_substitution_list.sh`)
15-
* Stripped binaries from the source code (see `generate_cleaning_list.sh`)
14+
* Replaced many domains in the source code with non-existant alternatives (known as domain substitution)
15+
* Stripped binaries from the source code (known as source cleaning)
1616
* Disabled intranet redirect detector
1717
* Debian build scripts
18-
* (Debian build scripts change) Move the chrome-sandbox into a separate package
18+
* (Debian build scripts change) Move the chrome-sandbox into a separate package
1919
* (Iridium Browser feature change) Prevent URLs with the `trk:` scheme from connecting to the Internet
20+
* Also prevents any URLs with the top-level domain `qjz9zk` (as used in domain substitution) from attempting a connection.
2021
* (Iridium and Inox feature change) Prevent pinging of IPv6 address when detecting the availability of IPv6
2122

2223
**DISCLAIMER: Although I try my best to eliminate bugs and privacy-invading code, there will be those that slip by due to the enormity and continuing evolution of the Chromium project.**
@@ -34,24 +35,33 @@ The `master` branch is for development, so it is not guarenteed to be in a worki
3435

3536
## How ungoogled-chromium is designed
3637

37-
All features are implemented through patches. Patches are contained within the `patches` directory, with the exception of platform-specific patches in the `building/templates` directory
38-
39-
A summary of the files in the `patches` directory:
40-
* `ungoogled-chromium/`
41-
* This directory contains new patches for ungoogled-chromium. They implement the features described above.
42-
* `iridium-browser`
43-
* This directory contains a subset of patches from Iridium Browser.
44-
* Patches are not touched unless they do not apply cleanly onto the version of Chromium being built
45-
* Patches are from the `patchview` branch of its Git repository. [Web view of the patchview branch](https://git.iridiumbrowser.de/cgit.cgi/iridium-browser/?h=patchview)
46-
* `inox-patchset/`
47-
* This directory contains a modified subset of patches from Inox patchset.
48-
* Patches are from [inox-patchset's GitHub](https://github.com/gcarq/inox-patchset)
49-
* [Inox patchset's license](https://github.com/gcarq/inox-patchset/blob/master/LICENSE)
50-
* `debian/`
51-
* This directory contains patches from Debian's Chromium.
52-
* These patches are not Debian-specific. For those, see the `build-templates/debian/` directory
53-
* `patch_order`
54-
* Determines which patches are used and what order they should be applied
38+
Features are implemented through a combination of build flags, patches, and a few file inputs for automated source modification. All of these are stored in the `resources` directory. The `resources` directory contains the `common` directory, which has such files that apply to all platforms. All other directories, named by platform, contain additional platform-specific data. Most of the features, however, are stored in the `common` directory.
39+
40+
There are currently two automated scripts that process the source code:
41+
* Source cleaner - Used to clean out binary files (i.e. do not seem to be human-readable text files, except a few required for building)
42+
* Domain substitution - Used to replace Google and other domains in the source code to eliminate communication not caught by the patches and build flags.
43+
44+
Here's a breakdown of what is in a resources directory:
45+
* `cleaning_list` - (Used for source cleaning) A list of files to be excluded during the extraction of the Chromium source
46+
* `domain_regex_list` - (Used for domain substitution) A list of regular expressions that define how domains will be replaced in the source code
47+
* `domain_substitution_list` - (Used for domain substitution) A list of files that are processed by `domain_regex_list`
48+
* `gn_args.ini` - A list of GN arguments to use for building. (Currently unused, see Issue #16)
49+
* `gyp_flags` - A list of GYP flags to use for building.
50+
* `patches/` - Contains patches. The patches in here vary by platform, but the ones in the `common` directory are described below.
51+
* `patch_order` - The order to apply the patches in. Patches from `common` should be applied before the one for a platform.
52+
53+
All of these files are human-readable, but they are usually processed by the Python building system. See the Building section below for more information.
54+
55+
Here's a breakdown of the `common/patches` directory:
56+
* `ungoogled-chromium/` - Contains new patches for ungoogled-chromium. They implement the features described above.
57+
* `iridium-browser` - Contains a subset of patches from Iridium Browser.
58+
* Patches are not touched unless they do not apply cleanly onto the version of Chromium being built
59+
* Patches are from the `patchview` branch of Iridium's Git repository. [Git webview of the patchview branch](https://git.iridiumbrowser.de/cgit.cgi/iridium-browser/?h=patchview)
60+
* `inox-patchset/` - Contains a modified subset of patches from Inox patchset.
61+
* Patches are from [inox-patchset's GitHub](https://github.com/gcarq/inox-patchset)
62+
* [Inox patchset's license](https://github.com/gcarq/inox-patchset/blob/master/LICENSE)
63+
* `debian/` - Contains patches from Debian's Chromium.
64+
* These patches are not Debian-specific. For those, see the `resources/debian/patches` directory
5565

5666
## Building
5767

@@ -73,7 +83,7 @@ You may also contribute by submitting pull requests.
7383

7484
[Debian for build scripts](https://tracker.debian.org/pkg/chromium-browser)
7585

76-
Google for Chromium
86+
[The Chromium Project](https://www.chromium.org/)
7787

7888
## License
7989

build.py

100644100755
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#!/usr/bin/env python3
2+
3+
# ungoogled-chromium: Google Chromium patches for removing Google integration, enhancing privacy, and adding features
4+
# Copyright (C) 2016 Eloston
5+
#
6+
# This file is part of ungoogled-chromium.
7+
#
8+
# ungoogled-chromium is free software: you can redistribute it and/or modify
9+
# it under the terms of the GNU General Public License as published by
10+
# the Free Software Foundation, either version 3 of the License, or
11+
# (at your option) any later version.
12+
#
13+
# ungoogled-chromium is distributed in the hope that it will be useful,
14+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
# GNU General Public License for more details.
17+
#
18+
# You should have received a copy of the GNU General Public License
19+
# along with ungoogled-chromium. If not, see <http://www.gnu.org/licenses/>.
20+
21+
'''
22+
Simple build script for Debian
23+
24+
Will be extended to work with other platforms
25+
'''
26+
27+
import logging
28+
import configparser
29+
30+
import buildlib.debian
31+
32+
def initialize_logger(logging_level):
33+
logger = logging.getLogger("ungoogled_chromium")
34+
logger.setLevel(logging_level)
35+
36+
console_handler = logging.StreamHandler()
37+
console_handler.setLevel(logging_level)
38+
39+
formatter = logging.Formatter("%(asctime)s - %(levelname)s: %(message)s")
40+
console_handler.setFormatter(formatter)
41+
42+
logger.addHandler(console_handler)
43+
44+
return logger
45+
46+
def read_version_config(config_location):
47+
config = configparser.ConfigParser()
48+
config.read(config_location)
49+
return (config["main"]["chromium_version"], config["main"]["release_revision"])
50+
51+
def main():
52+
logger = initialize_logger(logging.DEBUG)
53+
54+
chromium_version, release_revision = read_version_config("version.ini")
55+
56+
platform = buildlib.debian.DebianPlatform(chromium_version, release_revision, logger=logger)
57+
platform.setup_chromium_source()
58+
platform.setup_build_sandbox()
59+
platform.apply_patches()
60+
platform.setup_build_utilities()
61+
platform.generate_build_configuration()
62+
platform.build()
63+
platform.generate_package()
64+
65+
return 0
66+
67+
if __name__ == "__main__":
68+
exit(main())

0 commit comments

Comments
 (0)