Skip to content

Commit f4fde3b

Browse files
committed
Fix package building on Windows
Add GYP flag buildtype=Official for Windows Ignore syzygy source archive in .gitignore Update BUILDING.md for Windows Fix windows-gyp-disable-user32-winxp-lib.patch to remove all XP config Update README.md
1 parent cc9952f commit f4fde3b

File tree

6 files changed

+49
-10
lines changed

6 files changed

+49
-10
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ __pycache__/
99
/chromium-*.*.*.*.tar.xz
1010
/chromium-*.*.*.*.tar.xz.hashes
1111

12+
# Ignore downloaded syzygy archive
13+
/syzygy-*.tar.gz
14+
1215
# Ignore packages
1316
/*.deb
1417
/chromium-browser_*.changes

BUILDING.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ Google only supports [Windows 7 x64 or newer](https://chromium.googlesource.com/
4848
For maximum portability, the build configuration will generate x86 binaries.
4949

5050
In addition to the general building requirements, there are additional requirements:
51-
* Visual Studio. See [Chromium's Windows Build Instructions](https://chromium.googlesource.com/chromium/src/+/51.0.2704.106/docs/windows_build_instructions.md) for the specific version needed
51+
* Visual Studio. See [Chromium's Windows Build Instructions](https://chromium.googlesource.com/chromium/src/+/51.0.2704.106/docs/windows_build_instructions.md) for Google's requirements
52+
* Build has been tested on 2015 Community Edition Update 2 with only the following features installed:
53+
* Programming Languages -> Visual C++ (including all subcomponents)
54+
* Universal Windows App Development Tools -> Windows 10 SDK 10.0.10586
55+
* Windows 8.1 and Windows Phone 8.0/8.1 Tools -> Tools and Windows SDKs
5256
* GNU patch (to deal with patches that have fuzz). You can get the latest GNU patch from [MSYS2](http://msys2.github.io/).
5357
* If you don't want to use the installer, you can download and extract the following files manually from [MSYS2's repository on SourceForge](https://sourceforge.net/projects/msys2/files/REPOS/MSYS2/x86_64/):
5458
* `/usr/bin/patch.exe` from `patch-*-x86_64.pkg.tar.xz`

README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,30 @@
55
### Features
66

77
In addition to features provided by [Iridium Browser](//iridiumbrowser.de/) and [Inox patchset](//github.com/gcarq/inox-patchset), the following is also included:
8+
* Replace many web domains in the source code with non-existent alternatives ending in `qjz9zk` (known as domain substitution)
9+
* Strip binaries from the source code (known as source cleaning)
10+
* This includes all pre-built executables, shared libraries, and other forms of machine code. They are substituted with system or user-provided equivalents, or built from source.
11+
* However some data files (e.g. `icudtl.dat` for Unicode and Globalization support and `*_page_model.bin` that define page models for the DOM Distiller) are left in as they do not contain machine code and are needed for building.
812
* Remove additional detection of and disable specific functionality for Google hosts
913
* Disable searching in Omnibox
1014
* Disable automatic formatting of URL in Omnibox
1115
* Disable JavaScript dialog boxes from showing when a page closes (onbeforeunload dialog boxes)
1216
* Added menu item under "More tools" to clear the HTTP authentication cache on-demand
1317
* Disable persistent per-site settings in Preferences file
1418
* Force all pop-ups into tabs
15-
* Replace many domains in the source code with non-existent alternatives (known as domain substitution)
16-
* Strip binaries from the source code (known as source cleaning)
1719
* Disable intranet redirect detector (unnecessary invalid DNS requests)
1820
* Add more URL schemes allowed for saving
19-
* (Windows) Do not set the Zone Identifier on downloaded files (which is a hassle to remove)
20-
* Provide Debian build scripts
21-
* (Debian build scripts change) Move the chrome-sandbox into a separate package
2221
* (Iridium Browser feature change) Prevent URLs with the `trk:` scheme from connecting to the Internet
2322
* Also prevents any URLs with the top-level domain `qjz9zk` (as used in domain substitution) from attempting a connection.
2423
* (Iridium and Inox feature change) Prevent pinging of IPv6 address when detecting the availability of IPv6
24+
* Support for building Debian and Ubuntu packages
25+
* Creates a separate package `chrome-sandbox` for the SUID sandbox
26+
* Windows support with additional changes:
27+
* Build `wow_helper.exe` from source instead of using the pre-built version
28+
* Build `swapimport.exe` from source instead of downloading it from Google (requires [customized syzygy source code](https://github.com/Eloston/syzygy))
29+
* Build `yasm.exe` from source instead of using the pre-built version
30+
* Use user-provided building utilities instead of the ones bundled with Chromium (currently `gperf` and `bison`)
31+
* Do not set the Zone Identifier on downloaded files (which is a hassle to unset)
2532

2633
**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.**
2734

@@ -38,7 +45,7 @@ The `master` branch is for development, so it is not guaranteed to be in a worki
3845

3946
## How ungoogled-chromium is designed
4047

41-
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.
48+
Features are implemented through a combination of build flags, patches, and a few configuration files for scripts. All of these settings 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.
4249

4350
There are currently two automated scripts that process the source code:
4451
* 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)

buildlib/windows.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
import pathlib
2222
import zipfile
23+
import os
2324

2425
from . import generic
2526

@@ -57,7 +58,7 @@ def setup_chromium_source(self, *args, check_if_exists=True, force_download=Fals
5758
if extract_archive:
5859
self.logger.info("Extracting syzygy archive...")
5960
syzygy_dir = self.sandbox_root / pathlib.Path("third_party", "syzygy")
60-
os.makedirs(str(syzygy_dir.resolve()))
61+
os.makedirs(str(syzygy_dir))
6162
self._extract_tar_file(self.syzygyarchive, syzygy_dir, list(), "syzygy-{}".format(self.SYZYGY_COMMIT))
6263

6364
def apply_patches(self, patch_command=["patch", "-p1"]):
@@ -99,7 +100,7 @@ def file_list_generator():
99100
if "arch" in file_spec and not "32bit" in file_spec["arch"]:
100101
continue
101102
for file_path in (self.sandbox_root / self.build_output).glob(file_spec["filename"]):
102-
if not file_path.suffix.lower() == "pdb":
103+
if not file_path.suffix.lower() == ".pdb":
103104
yield (str(file_path.relative_to(self.sandbox_root / self.build_output)), file_path)
104105
with zipfile.ZipFile(output_filename, mode="w", compression=zipfile.ZIP_DEFLATED) as zip_file:
105106
for arcname, real_path in file_list_generator():

resources/windows/gyp_flags

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ target_arch=ia32
22
ffmpeg_branding=Chrome
33
enable_mpeg2ts_stream_parser=0
44
enable_hevc_demuxing=0
5+
buildtype=Official

resources/windows/patches/ungoogled-windows/windows-gyp-disable-user32-winxp-lib.patch

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,26 @@
11
# Remove dependencies on user32.winxp.lib and user32-delay.dll in GYP
22
# user32.winxp.lib is deleted in source cleaning (which causes building to fail) and Google no longer supports Windows XP
3+
# Also, this patch fixes a handle error that occurs when trying to run the build output
34

45
--- a/chrome/chrome_dll.gypi
56
+++ b/chrome/chrome_dll.gypi
6-
@@ -198,23 +198,23 @@
7+
@@ -142,7 +142,7 @@
8+
# Add a dependency to custom import library for user32 delay
9+
# imports only in x86 builds.
10+
'dependencies': [
11+
- 'chrome_user32_delay_imports',
12+
+ #'chrome_user32_delay_imports',
13+
],
14+
},],
15+
['OS=="win"', {
16+
@@ -192,34 +192,34 @@
17+
}],
18+
['target_arch=="ia32"', {
19+
# Don't set an x64 base address (to avoid breaking HE-ASLR).
20+
- 'BaseAddress': '0x01c30000',
21+
+ #'BaseAddress': '0x01c30000',
22+
# Link against the XP-constrained user32 import library
23+
# instead of the platform-SDK provided one to avoid
724
# inadvertently taking dependencies on post-XP user32
825
# exports.
926
'AdditionalDependencies!': [
@@ -33,3 +50,9 @@
3350
],
3451
'ForceSymbolReferences': [
3552
# Force the inclusion of the delay load hook in this
53+
# binary.
54+
- '_ChromeDelayLoadHook@8',
55+
+ #'_ChromeDelayLoadHook@8',
56+
],
57+
}],
58+
],

0 commit comments

Comments
 (0)