4 for patch in musl-*.patch; do
8 # Patches specifically for my messed up system
9 # no libatomic/clang plugins (wyverkiss), no gzip (me)
10 for patch in wyverkiss-*.patch; do
14 # Ungoogled Chromium patches
15 for patch in chromium-*.patch; do
19 python ungoogled-chromium/utils/prune_binaries.py \
20 ./ ungoogled-chromium/pruning.list
22 # Bypass the Python script and apply patches ourselves to avoid GNU patch
23 while read -r patch; do
24 [ "$patch" ] || continue
25 patch -p1 < "ungoogled-chromium/patches/$patch"
26 done < ungoogled-chromium/patches/series
28 python ungoogled-chromium/utils/domain_substitution.py apply \
29 -r ungoogled-chromium/domain_regex.list \
30 -f ungoogled-chromium/domain_substitution.list \
31 -c domainsubcache.tar.gz ./
33 # Avoid falling back to preprocessor mode when sources contain time macros
34 kiss list ccache && export CCACHE_SLOPPINESS=time_macros
36 # Force script incompatible with Python 3 to use /usr/bin/python2
37 # Remove in next release. How exciting.
38 sed -i "1s|python$|&2|" third_party/dom_distiller_js/protoc_plugins/*.py
40 mkdir -p third_party/node/linux/node-linux-x64/bin
41 ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/
44 export CXX="${CXX:-c++}"
48 # Allow building against system libraries in official builds
49 sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \
50 tools/generate_shim_headers/generate_shim_headers.py
52 # compile gn early, so it can be used to generate gni stuff
53 LDFLAGS="$LDFLAGS -lc++ -lc++abi -lunwind" \
54 ./tools/gn/bootstrap/bootstrap.py --skip-generate-buildfiles
66 # remove build scripts for system provided dependencies - basically does the
67 # same as the bundled script to remove bundled libs, but this way we don't
68 # have to list the remaining libs
69 for lib in $system; do
70 find . -type f -path "*third_party/$lib/*" \
71 \! -path "*third_party/$lib/chromium/*" \
72 \! -path "*third_party/$lib/google/*" \
73 \! -path "./base/third_party/icu/*" \
74 \! -path "./third_party/pdfium/third_party/freetype/include/pstables.h" \
75 \! -path "./third_party/harfbuzz-ng/utils/hb_scoped.h" \
78 \! -name "*.isolate" \
83 # switch to system provided dependencies
84 # shellcheck disable=2086
85 ./build/linux/unbundle/replace_gn_files.py --system-libraries $system
87 ./third_party/libaddressinput/chromium/tools/update-strings.py
91 google_default_client_id=\"\"
92 google_default_client_secret=\"\"
93 use_official_google_api_keys=false
94 use_unofficial_version_number=false
97 exclude_unwind_tables=true
98 build_with_tflite_lib=false
99 fatal_linker_warnings=false
100 clang_use_chrome_plugins=false
101 treat_warnings_as_errors=false
102 fieldtrial_testing_like_official_build=true
103 custom_toolchain=\"//build/toolchain/linux/unbundle:default\"
104 host_toolchain=\"//build/toolchain/linux/unbundle:default\"
106 enable_widevine=false
107 enable_swiftshader=false
112 is_official_build=true
113 rtc_use_pipewire=false
114 proprietary_codecs=true
115 rtc_build_examples=false
116 ffmpeg_branding=\"Chrome\"
117 link_pulseaudio=false
118 ozone_platform_x11=true
119 ozone_platform_wayland=false
121 use_allocator=\"none\"
122 use_allocator_shim=false
138 use_custom_libcxx=false
139 use_gnome_keyring=false
140 use_system_harfbuzz=true
145 enable_remoting=false
146 enable_reporting=false
147 enable_nacl_nonsfi=false
148 enable_reading_list=false
149 enable_js_type_check=false
150 enable_one_click_signin=false
151 enable_service_discovery=false
152 enable_mse_mpeg2ts_stream_parser=true
153 enable_hangout_services_extension=false
156 out/Release/gn gen out/Release --args="$conf"
158 # final link needs lots of file descriptors, almost all shells support the -n flag.
159 # shellcheck disable=2039,3045
162 ninja -C out/Release chrome
164 # Package the monster.
165 install -Dm755 chromium.sh "$1/usr/bin/chromium"
166 install -Dm755 out/Release/chrome "$1/usr/lib/chromium/chromium"
167 install -Dm644 out/Release/icudtl.dat "$1/usr/lib/chromium"
168 install -Dm644 out/Release/resources.pak "$1/usr/lib/chromium/resources.pak"
169 install -Dm644 out/Release/locales/en-US.pak "$1/usr/lib/chromium/locales/en-US.pak"
170 install -Dm644 out/Release/chrome_100_percent.pak "$1/usr/lib/chromium/chrome_100_percent.pak"
171 install -Dm644 out/Release/chrome_200_percent.pak "$1/usr/lib/chromium/chrome_200_percent.pak"
172 install -Dm644 out/Release/v8_context_snapshot.bin "$1/usr/lib/chromium/v8_context_snapshot.bin"