3 for patch in *.patch; do
7 python ungoogled-chromium/utils/prune_binaries.py \
8 ./ ungoogled-chromium/pruning.list
10 # Bypass the Python script and apply patches ourselves to avoid GNU patch
11 while read -r patch; do
12 [ "$patch" ] || continue
13 patch -p1 < "ungoogled-chromium/patches/$patch"
14 done < ungoogled-chromium/patches/series
16 python ungoogled-chromium/utils/domain_substitution.py apply \
17 -r ungoogled-chromium/domain_regex.list \
18 -f ungoogled-chromium/domain_substitution.list \
19 -c domainsubcache.tar.gz ./
21 # Avoid falling back to preprocessor mode when sources contain time macros
22 kiss list ccache && export CCACHE_SLOPPINESS=time_macros
24 # Force script incompatible with Python 3 to use /usr/bin/python2
25 # Remove in next release. How exciting.
26 sed -i "1s|python$|&2|" third_party/dom_distiller_js/protoc_plugins/*.py
28 mkdir -p third_party/node/linux/node-linux-x64/bin
29 ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/
32 export CXX="${CXX:-c++}"
36 # Allow building against system libraries in official builds
37 sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \
38 tools/generate_shim_headers/generate_shim_headers.py
40 # compile gn early, so it can be used to generate gni stuff
41 LDFLAGS="$LDFLAGS -lc++ -lc++abi -lunwind" \
42 ./tools/gn/bootstrap/bootstrap.py --skip-generate-buildfiles
52 # remove build scripts for system provided dependencies - basically does the
53 # same as the bundled script to remove bundled libs, but this way we don't
54 # have to list the remaining libs
55 for lib in $system; do
56 find . -type f -path "*third_party/$lib/*" \
57 \! -path "*third_party/$lib/chromium/*" \
58 \! -path "*third_party/$lib/google/*" \
59 \! -path "./base/third_party/icu/*" \
60 \! -path "./third_party/pdfium/third_party/freetype/include/pstables.h" \
61 \! -path "./third_party/harfbuzz-ng/utils/hb_scoped.h" \
64 \! -name "*.isolate" \
69 # switch to system provided dependencies
70 # shellcheck disable=2086
71 ./build/linux/unbundle/replace_gn_files.py --system-libraries $system
73 ./third_party/libaddressinput/chromium/tools/update-strings.py
77 google_default_client_id=\"\"
78 google_default_client_secret=\"\"
79 use_official_google_api_keys=false
80 use_unofficial_version_number=false
83 exclude_unwind_tables=true
84 build_with_tflite_lib=false
85 fatal_linker_warnings=false
86 clang_use_chrome_plugins=false
87 treat_warnings_as_errors=false
88 fieldtrial_testing_like_official_build=true
89 custom_toolchain=\"//build/toolchain/linux/unbundle:default\"
90 host_toolchain=\"//build/toolchain/linux/unbundle:default\"
93 enable_swiftshader=false
98 is_official_build=true
99 rtc_use_pipewire=false
100 proprietary_codecs=true
101 rtc_build_examples=false
102 ffmpeg_branding=\"Chrome\"
103 link_pulseaudio=false
104 ozone_platform_x11=true
105 ozone_platform_wayland=false
107 use_allocator=\"none\"
108 use_allocator_shim=false
124 use_custom_libcxx=false
125 use_gnome_keyring=false
126 use_system_harfbuzz=true
131 enable_remoting=false
132 enable_reporting=false
133 enable_nacl_nonsfi=false
134 enable_reading_list=false
135 enable_js_type_check=false
136 enable_one_click_signin=false
137 enable_service_discovery=false
138 enable_mse_mpeg2ts_stream_parser=true
139 enable_hangout_services_extension=false
142 out/Release/gn gen out/Release --args="$conf"
144 # final link needs lots of file descriptors, almost all shells support the -n flag.
145 # shellcheck disable=2039,3045
148 ninja -C out/Release chrome
150 # Package the monster.
151 install -Dm755 chromium.sh "$1/usr/bin/chromium"
152 install -Dm755 out/Release/chrome "$1/usr/lib/chromium/chromium"
153 install -Dm644 out/Release/icudtl.dat "$1/usr/lib/chromium"
154 install -Dm644 out/Release/locales/*.pak -t "$1/usr/lib/chromium/locales"
156 for lib in libEGL.so libGLESv2.so; do
157 install -Dm755 "out/Release/$lib" "$1/usr/lib/chromium"
160 for stuff in bin pak; do
161 install -Dm644 out/Release/*.$stuff "$1/usr/lib/chromium"