Browse Source

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

Eloston 7 years ago
parent
commit
f4fde3baa6

+ 3 - 0
.gitignore

@@ -9,6 +9,9 @@ __pycache__/
 /chromium-*.*.*.*.tar.xz
 /chromium-*.*.*.*.tar.xz.hashes
 
+# Ignore downloaded syzygy archive
+/syzygy-*.tar.gz
+
 # Ignore packages
 /*.deb
 /chromium-browser_*.changes

+ 5 - 1
BUILDING.md

@@ -48,7 +48,11 @@ Google only supports [Windows 7 x64 or newer](https://chromium.googlesource.com/
 For maximum portability, the build configuration will generate x86 binaries.
 
 In addition to the general building requirements, there are additional requirements:
-* 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
+* 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
+    * Build has been tested on 2015 Community Edition Update 2 with only the following features installed:
+        * Programming Languages -> Visual C++ (including all subcomponents)
+        * Universal Windows App Development Tools -> Windows 10 SDK 10.0.10586
+        * Windows 8.1 and Windows Phone 8.0/8.1 Tools -> Tools and Windows SDKs
 * GNU patch (to deal with patches that have fuzz). You can get the latest GNU patch from [MSYS2](http://msys2.github.io/).
     * 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/):
         * `/usr/bin/patch.exe` from `patch-*-x86_64.pkg.tar.xz`

+ 13 - 6
README.md

@@ -5,6 +5,10 @@
 ### Features
 
 In addition to features provided by [Iridium Browser](//iridiumbrowser.de/) and [Inox patchset](//github.com/gcarq/inox-patchset), the following is also included:
+* Replace many web domains in the source code with non-existent alternatives ending in `qjz9zk` (known as domain substitution)
+* Strip binaries from the source code (known as source cleaning)
+    * 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.
+    * 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.
 * Remove additional detection of and disable specific functionality for Google hosts
 * Disable searching in Omnibox
 * Disable automatic formatting of URL in Omnibox
@@ -12,16 +16,19 @@ In addition to features provided by [Iridium Browser](//iridiumbrowser.de/) and
 * Added menu item under "More tools" to clear the HTTP authentication cache on-demand
 * Disable persistent per-site settings in Preferences file
 * Force all pop-ups into tabs
-* Replace many domains in the source code with non-existent alternatives (known as domain substitution)
-* Strip binaries from the source code (known as source cleaning)
 * Disable intranet redirect detector (unnecessary invalid DNS requests)
 * Add more URL schemes allowed for saving
-* (Windows) Do not set the Zone Identifier on downloaded files (which is a hassle to remove)
-* Provide Debian build scripts
-    * (Debian build scripts change) Move the chrome-sandbox into a separate package
 * (Iridium Browser feature change) Prevent URLs with the `trk:` scheme from connecting to the Internet
     * Also prevents any URLs with the top-level domain `qjz9zk` (as used in domain substitution) from attempting a connection.
 * (Iridium and Inox feature change) Prevent pinging of IPv6 address when detecting the availability of IPv6
+* Support for building Debian and Ubuntu packages
+    * Creates a separate package `chrome-sandbox` for the SUID sandbox
+* Windows support with additional changes:
+    * Build `wow_helper.exe` from source instead of using the pre-built version
+    * Build `swapimport.exe` from source instead of downloading it from Google (requires [customized syzygy source code](https://github.com/Eloston/syzygy))
+    * Build `yasm.exe` from source instead of using the pre-built version
+    * Use user-provided building utilities instead of the ones bundled with Chromium (currently `gperf` and `bison`)
+    * Do not set the Zone Identifier on downloaded files (which is a hassle to unset)
 
 **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.**
 
@@ -38,7 +45,7 @@ The `master` branch is for development, so it is not guaranteed to be in a worki
 
 ## How ungoogled-chromium is designed
 
-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.
+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.
 
 There are currently two automated scripts that process the source code:
 * 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)

+ 3 - 2
buildlib/windows.py

@@ -20,6 +20,7 @@
 
 import pathlib
 import zipfile
+import os
 
 from . import generic
 
@@ -57,7 +58,7 @@ class WindowsPlatform(generic.GenericPlatform):
         if extract_archive:
             self.logger.info("Extracting syzygy archive...")
             syzygy_dir = self.sandbox_root / pathlib.Path("third_party", "syzygy")
-            os.makedirs(str(syzygy_dir.resolve()))
+            os.makedirs(str(syzygy_dir))
             self._extract_tar_file(self.syzygyarchive, syzygy_dir, list(), "syzygy-{}".format(self.SYZYGY_COMMIT))
 
     def apply_patches(self, patch_command=["patch", "-p1"]):
@@ -99,7 +100,7 @@ class WindowsPlatform(generic.GenericPlatform):
                     if "arch" in file_spec and not "32bit" in file_spec["arch"]:
                         continue
                     for file_path in (self.sandbox_root / self.build_output).glob(file_spec["filename"]):
-                        if not file_path.suffix.lower() == "pdb":
+                        if not file_path.suffix.lower() == ".pdb":
                             yield (str(file_path.relative_to(self.sandbox_root / self.build_output)), file_path)
         with zipfile.ZipFile(output_filename, mode="w", compression=zipfile.ZIP_DEFLATED) as zip_file:
             for arcname, real_path in file_list_generator():

+ 1 - 0
resources/windows/gyp_flags

@@ -2,3 +2,4 @@ target_arch=ia32
 ffmpeg_branding=Chrome
 enable_mpeg2ts_stream_parser=0
 enable_hevc_demuxing=0
+buildtype=Official

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

@@ -1,9 +1,26 @@
 # Remove dependencies on user32.winxp.lib and user32-delay.dll in GYP
 # user32.winxp.lib is deleted in source cleaning (which causes building to fail) and Google no longer supports Windows XP
+# Also, this patch fixes a handle error that occurs when trying to run the build output
 
 --- a/chrome/chrome_dll.gypi
 +++ b/chrome/chrome_dll.gypi
-@@ -198,23 +198,23 @@
+@@ -142,7 +142,7 @@
+               # Add a dependency to custom import library for user32 delay
+               # imports only in x86 builds.
+               'dependencies': [
+-                'chrome_user32_delay_imports',
++                #'chrome_user32_delay_imports',
+               ],
+             },],
+             ['OS=="win"', {
+@@ -192,34 +192,34 @@
+                     }],
+                     ['target_arch=="ia32"', {
+                       # Don't set an x64 base address (to avoid breaking HE-ASLR).
+-                      'BaseAddress': '0x01c30000',
++                      #'BaseAddress': '0x01c30000',
+                       # Link against the XP-constrained user32 import library
+                       # instead of the platform-SDK provided one to avoid
                        # inadvertently taking dependencies on post-XP user32
                        # exports.
                        'AdditionalDependencies!': [
@@ -33,3 +50,9 @@
                        ],
                        'ForceSymbolReferences': [
                          # Force the inclusion of the delay load hook in this
+                         # binary.
+-                        '_ChromeDelayLoadHook@8',
++                        #'_ChromeDelayLoadHook@8',
+                       ],
+                     }],
+                   ],