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
54 # remove build scripts for system provided dependencies - basically does the
55 # same as the bundled script to remove bundled libs, but this way we don't
56 # have to list the remaining libs
57 for lib in $system; do
58 find . -type f -path "*third_party/$lib/*" \
59 \! -path "*third_party/$lib/chromium/*" \
60 \! -path "*third_party/$lib/google/*" \
61 \! -path "./base/third_party/icu/*" \
62 \! -path "./third_party/pdfium/third_party/freetype/include/pstables.h" \
63 \! -path "./third_party/harfbuzz-ng/utils/hb_scoped.h" \
66 \! -name "*.isolate" \
71 # switch to system provided dependencies
72 # shellcheck disable=2086
73 ./build/linux/unbundle/replace_gn_files.py --system-libraries $system
75 ./third_party/libaddressinput/chromium/tools/update-strings.py
79 google_default_client_id=\"\"
80 google_default_client_secret=\"\"
81 use_official_google_api_keys=false
82 use_unofficial_version_number=false
85 exclude_unwind_tables=true
86 build_with_tflite_lib=false
87 fatal_linker_warnings=false
88 clang_use_chrome_plugins=false
89 treat_warnings_as_errors=false
90 fieldtrial_testing_like_official_build=true
91 custom_toolchain=\"//build/toolchain/linux/unbundle:default\"
92 host_toolchain=\"//build/toolchain/linux/unbundle:default\"
95 enable_swiftshader=false
100 is_official_build=true
101 rtc_use_pipewire=false
102 proprietary_codecs=true
103 rtc_build_examples=false
104 ffmpeg_branding=\"Chrome\"
105 link_pulseaudio=false
106 ozone_platform_x11=true
107 ozone_platform_wayland=false
109 use_allocator=\"none\"
110 use_allocator_shim=false
126 use_custom_libcxx=false
127 use_gnome_keyring=false
128 use_system_harfbuzz=true
133 enable_remoting=false
134 enable_reporting=false
135 enable_nacl_nonsfi=false
136 enable_reading_list=false
137 enable_js_type_check=false
138 enable_one_click_signin=false
139 enable_service_discovery=false
140 enable_mse_mpeg2ts_stream_parser=true
141 enable_hangout_services_extension=false
144 out/Release/gn gen out/Release --args="$conf"
146 # final link needs lots of file descriptors, almost all shells support the -n flag.
147 # shellcheck disable=2039,3045
150 ninja -C out/Release chrome
152 # Package the monster.
153 install -Dm755 chromium.sh "$1/usr/bin/chromium"
154 install -Dm755 out/Release/chrome "$1/usr/lib/chromium/chromium"
155 install -Dm644 out/Release/icudtl.dat "$1/usr/lib/chromium"
156 install -Dm644 out/Release/locales/*.pak -t "$1/usr/lib/chromium/locales"
158 for lib in libEGL.so libGLESv2.so; do
159 install -Dm755 "out/Release/$lib" "$1/usr/lib/chromium"
162 for stuff in bin pak; do
163 install -Dm644 out/Release/*.$stuff "$1/usr/lib/chromium"