Gentoo Archives: gentoo-commits

From: Stephan Hartmann <sultan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-client/chromium/files/, www-client/chromium/
Date: Mon, 26 Sep 2022 20:33:13
Message-Id: 1664224273.0af9c2e915acc1f39bd0363cfb96fab93679ac00.sultan@gentoo
1 commit: 0af9c2e915acc1f39bd0363cfb96fab93679ac00
2 Author: Stephan Hartmann <sultan <AT> gentoo <DOT> org>
3 AuthorDate: Mon Sep 26 20:29:30 2022 +0000
4 Commit: Stephan Hartmann <sultan <AT> gentoo <DOT> org>
5 CommitDate: Mon Sep 26 20:31:13 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0af9c2e9
7
8 www-client/chromium: dev channel bump to 107.0.5304.10
9
10 Signed-off-by: Stephan Hartmann <sultan <AT> gentoo.org>
11
12 www-client/chromium/Manifest | 2 +
13 www-client/chromium/chromium-107.0.5304.10.ebuild | 1205 ++++++++++++++++++++
14 .../chromium/files/chromium-107-system-zlib.patch | 10 +
15 www-client/chromium/metadata.xml | 1 +
16 4 files changed, 1218 insertions(+)
17
18 diff --git a/www-client/chromium/Manifest b/www-client/chromium/Manifest
19 index 3586e31fb5ae..6638dff5ba7c 100644
20 --- a/www-client/chromium/Manifest
21 +++ b/www-client/chromium/Manifest
22 @@ -3,4 +3,6 @@ DIST chromium-105.0.5195.102.tar.xz 1597977496 BLAKE2B dada382717f8d48c87f586ba1
23 DIST chromium-105.0.5195.125.tar.xz 1597584952 BLAKE2B 690c10de16bbb92b6b69950c378f16a469b29176ad57de6d1f0827358c1443c25c273b962c434bcca38f1868e4e762115b61ee292ada2d5be12e7d19fbbac0af SHA512 a8aaa24d779b69ee8173ed45006c9e7d6ada57de465cfa0a15720f3cd72d271f0560cedf8ae4aa0fde45ae6b750bb4577dcb23349d9cb49a036a7f0a4a5d68ac
24 DIST chromium-106-patchset-2.tar.xz 6324 BLAKE2B acd848057ebc685149c77311a8394bbc6c17c9edb47ffda13855751e012794239175b3a9a19fa31645e39afaf321daf11b7bdc6156fa422a341685be55d88778 SHA512 0188e7c9511ffddf44dc7027a098b72345d29af7ed7d4d5d4cc353a2a78323d2931d1e9f3196a3d9a46d3eb69966018e8f4e1adc75dc2bc9742d9dbe2911f288
25 DIST chromium-106.0.5249.51.tar.xz 1622278168 BLAKE2B 9f91f20df36f376e0a837bfb60518f17896535f1aeddb0d1733688b9954bfc5c591eca262354277905b70b71f8d1707d783ba3204edc1bc5162811d84c85b1c1 SHA512 0f34ffa646f06e3ff70564f1ac21c7ffbe294b7c7746f1ab20aa027924ae3000aacb96ddecb96c75d79b931abb76d5b6fd7ad03d5bec70350baf935176433fac
26 +DIST chromium-107-patchset-1.tar.xz 5736 BLAKE2B 581ca307d63635ef91aaa907aeebb8c735be6d6bbfcc3fe064fed7531b8848b5d918e017031ee606ed3bd8f0fc23aa6d2f8af4b36d33483dbeee2b5c8eacac82 SHA512 acbfb41c31a510a689cad3b0686e24925b018bd7a2a8f56f74b730dc36d878c266a11b3bb76b131e66f7b859f483ff00e16cbaae1b2b6944010c7396310c03b8
27 +DIST chromium-107.0.5304.10.tar.xz 1692683848 BLAKE2B dded32b4fb20013298136257ee4e4af9395c05125423c5899acfe562e1f1858a1f0763e76aaee3e546fa00474b9dfc8d981279cc38531164a1be1708288e7d2f SHA512 39405bc7885670013ed9a84bfad2f504a7f80a9e7de1661409560d9c54e8a0f82dc05393e35ce2063e6bdbfa323ea85d3b4b5051e462a2a7464004d80843f1b4
28 DIST chromium-profiler-0.1.tar 269066240 BLAKE2B 6897387b63ff9a724b67f2e8799fe803dc75da376da809e752d19d6f5cf98bd84ac24161d07ac4a967577279e9ad5a8a46f0825332a7ee933a27693d6dc95611 SHA512 3fb6132599d28455d1b5c04d856ea7623e49b0b0b96f021c31d0952c4ba57d69d0a1cae6f0b91470a235221c89cc0d3bb38303ff02594ed0739712e6e2f8dbcc
29
30 diff --git a/www-client/chromium/chromium-107.0.5304.10.ebuild b/www-client/chromium/chromium-107.0.5304.10.ebuild
31 new file mode 100644
32 index 000000000000..fb48545c8189
33 --- /dev/null
34 +++ b/www-client/chromium/chromium-107.0.5304.10.ebuild
35 @@ -0,0 +1,1205 @@
36 +# Copyright 2009-2022 Gentoo Authors
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +EAPI=8
40 +PYTHON_COMPAT=( python3_{8..11} )
41 +PYTHON_REQ_USE="xml(+)"
42 +LLVM_MAX_SLOT=15
43 +
44 +CHROMIUM_LANGS="af am ar bg bn ca cs da de el en-GB es es-419 et fa fi fil fr gu he
45 + hi hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt-BR pt-PT ro ru sk sl sr
46 + sv sw ta te th tr uk ur vi zh-CN zh-TW"
47 +
48 +VIRTUALX_REQUIRED="pgo"
49 +
50 +inherit check-reqs chromium-2 desktop flag-o-matic llvm ninja-utils pax-utils python-any-r1 readme.gentoo-r1 toolchain-funcs virtualx xdg-utils
51 +
52 +DESCRIPTION="Open-source version of Google Chrome web browser"
53 +HOMEPAGE="https://chromium.org/"
54 +PATCHSET="1"
55 +PATCHSET_NAME="chromium-$(ver_cut 1)-patchset-${PATCHSET}"
56 +SRC_URI="https://commondatastorage.googleapis.com/chromium-browser-official/${P}.tar.xz
57 + https://github.com/stha09/chromium-patches/releases/download/${PATCHSET_NAME}/${PATCHSET_NAME}.tar.xz
58 + pgo? ( https://blackhole.sk/~kabel/src/chromium-profiler-0.1.tar )"
59 +
60 +LICENSE="BSD"
61 +SLOT="0/dev"
62 +KEYWORDS="~amd64 ~arm64"
63 +IUSE="+X component-build cups cpu_flags_arm_neon debug gtk4 +hangouts headless +js-type-check kerberos libcxx lto +official pgo pic +proprietary-codecs pulseaudio qt5 screencast selinux +suid +system-av1 +system-ffmpeg +system-harfbuzz +system-icu +system-png vaapi wayland widevine"
64 +REQUIRED_USE="
65 + component-build? ( !suid !libcxx )
66 + screencast? ( wayland )
67 + !headless? ( || ( X wayland ) )
68 + pgo? ( X !wayland )
69 +"
70 +
71 +COMMON_X_DEPEND="
72 + x11-libs/libXcomposite:=
73 + x11-libs/libXcursor:=
74 + x11-libs/libXdamage:=
75 + x11-libs/libXfixes:=
76 + >=x11-libs/libXi-1.6.0:=
77 + x11-libs/libXrandr:=
78 + x11-libs/libXrender:=
79 + x11-libs/libXtst:=
80 + x11-libs/libxshmfence:=
81 +"
82 +
83 +COMMON_SNAPSHOT_DEPEND="
84 + system-icu? ( >=dev-libs/icu-71.1:= )
85 + >=dev-libs/libxml2-2.9.4-r3:=[icu]
86 + dev-libs/nspr:=
87 + >=dev-libs/nss-3.26:=
88 + !libcxx? ( >=dev-libs/re2-0.2019.08.01:= )
89 + dev-libs/libxslt:=
90 + media-libs/fontconfig:=
91 + >=media-libs/freetype-2.11.0-r1:=
92 + system-harfbuzz? ( >=media-libs/harfbuzz-3:0=[icu(-)] )
93 + media-libs/libjpeg-turbo:=
94 + system-png? ( media-libs/libpng:=[-apng] )
95 + >=media-libs/libwebp-0.4.0:=
96 + media-libs/mesa:=[gbm(+)]
97 + >=media-libs/openh264-1.6.0:=
98 + system-av1? (
99 + >=media-libs/dav1d-1.0.0:=
100 + >=media-libs/libaom-3.4.0:=
101 + )
102 + sys-libs/zlib:=
103 + x11-libs/libdrm:=
104 + !headless? (
105 + dev-libs/glib:2
106 + >=media-libs/alsa-lib-1.0.19:=
107 + pulseaudio? ( media-sound/pulseaudio:= )
108 + sys-apps/pciutils:=
109 + kerberos? ( virtual/krb5 )
110 + vaapi? ( >=x11-libs/libva-2.7:=[X?,wayland?] )
111 + X? (
112 + x11-libs/libX11:=
113 + x11-libs/libXext:=
114 + x11-libs/libxcb:=
115 + )
116 + x11-libs/libxkbcommon:=
117 + wayland? (
118 + dev-libs/wayland:=
119 + screencast? ( media-video/pipewire:= )
120 + )
121 + )
122 +"
123 +
124 +COMMON_DEPEND="
125 + ${COMMON_SNAPSHOT_DEPEND}
126 + app-arch/bzip2:=
127 + dev-libs/expat:=
128 + system-ffmpeg? (
129 + >=media-video/ffmpeg-4.3:=
130 + || (
131 + media-video/ffmpeg[-samba]
132 + >=net-fs/samba-4.5.10-r1[-debug(-)]
133 + )
134 + >=media-libs/opus-1.3.1:=
135 + )
136 + net-misc/curl[ssl]
137 + sys-apps/dbus:=
138 + media-libs/flac:=
139 + sys-libs/zlib:=[minizip]
140 + !headless? (
141 + X? ( ${COMMON_X_DEPEND} )
142 + >=app-accessibility/at-spi2-atk-2.26:2
143 + >=app-accessibility/at-spi2-core-2.26:2
144 + >=dev-libs/atk-2.26
145 + media-libs/mesa:=[X?,wayland?]
146 + cups? ( >=net-print/cups-1.3.11:= )
147 + virtual/udev
148 + x11-libs/cairo:=
149 + x11-libs/gdk-pixbuf:2
150 + x11-libs/pango:=
151 + qt5? (
152 + dev-qt/qtcore:5
153 + dev-qt/qtwidgets:5
154 + )
155 + )
156 +"
157 +RDEPEND="${COMMON_DEPEND}
158 + !headless? (
159 + || (
160 + x11-libs/gtk+:3[X?,wayland?]
161 + gui-libs/gtk:4[X?,wayland?]
162 + )
163 + x11-misc/xdg-utils
164 + )
165 + virtual/ttf-fonts
166 + selinux? ( sec-policy/selinux-chromium )
167 +"
168 +DEPEND="${COMMON_DEPEND}
169 + !headless? (
170 + gtk4? ( gui-libs/gtk:4[X?,wayland?] )
171 + !gtk4? ( x11-libs/gtk+:3[X?,wayland?] )
172 + )
173 +"
174 +
175 +depend_clang_llvm_version() {
176 + echo "sys-devel/clang:$1"
177 + echo "sys-devel/llvm:$1"
178 + echo "=sys-devel/lld-$1*"
179 +}
180 +
181 +depend_clang_llvm_versions() {
182 + local _v
183 + if [[ $# -gt 1 ]]; then
184 + echo "|| ("
185 + for _v in "$@"; do
186 + echo "("
187 + depend_clang_llvm_version "${_v}"
188 + echo ")"
189 + done
190 + echo ")"
191 + elif [[ $# -eq 1 ]]; then
192 + depend_clang_llvm_version "$1"
193 + fi
194 +}
195 +
196 +BDEPEND="
197 + ${COMMON_SNAPSHOT_DEPEND}
198 + ${PYTHON_DEPS}
199 + $(python_gen_any_dep '
200 + dev-python/setuptools[${PYTHON_USEDEP}]
201 + ')
202 + >=app-arch/gzip-1.7
203 + libcxx? ( >=sys-devel/clang-12 )
204 + lto? ( $(depend_clang_llvm_versions 13 14 15) )
205 + pgo? (
206 + >=dev-python/selenium-3.141.0
207 + >=dev-util/web_page_replay_go-20220314
208 + $(depend_clang_llvm_versions 13 14 15)
209 + )
210 + dev-lang/perl
211 + >=dev-util/gn-0.1807
212 + >=dev-util/gperf-3.0.3
213 + >=dev-util/ninja-1.7.2
214 + dev-vcs/git
215 + >=net-libs/nodejs-7.6.0[inspector]
216 + >=sys-devel/bison-2.4.3
217 + sys-devel/flex
218 + virtual/pkgconfig
219 + js-type-check? ( virtual/jre )
220 +"
221 +
222 +# These are intended for ebuild maintainer use to force clang if GCC is broken.
223 +: ${CHROMIUM_FORCE_CLANG=no}
224 +
225 +if [[ ${CHROMIUM_FORCE_CLANG} == yes ]]; then
226 + BDEPEND+=" >=sys-devel/clang-12"
227 +fi
228 +
229 +if ! has chromium_pkg_die ${EBUILD_DEATH_HOOKS}; then
230 + EBUILD_DEATH_HOOKS+=" chromium_pkg_die";
231 +fi
232 +
233 +DISABLE_AUTOFORMATTING="yes"
234 +DOC_CONTENTS="
235 +Some web pages may require additional fonts to display properly.
236 +Try installing some of the following packages if some characters
237 +are not displayed properly:
238 +- media-fonts/arphicfonts
239 +- media-fonts/droid
240 +- media-fonts/ipamonafont
241 +- media-fonts/noto
242 +- media-fonts/ja-ipafonts
243 +- media-fonts/takao-fonts
244 +- media-fonts/wqy-microhei
245 +- media-fonts/wqy-zenhei
246 +
247 +To fix broken icons on the Downloads page, you should install an icon
248 +theme that covers the appropriate MIME types, and configure this as your
249 +GTK+ icon theme.
250 +
251 +For native file dialogs in KDE, install kde-apps/kdialog.
252 +
253 +To make password storage work with your desktop environment you may
254 +have install one of the supported credentials management applications:
255 +- app-crypt/libsecret (GNOME)
256 +- kde-frameworks/kwallet (KDE)
257 +If you have one of above packages installed, but don't want to use
258 +them in Chromium, then add --password-store=basic to CHROMIUM_FLAGS
259 +in /etc/chromium/default.
260 +"
261 +
262 +python_check_deps() {
263 + python_has_version "dev-python/setuptools[${PYTHON_USEDEP}]"
264 +}
265 +
266 +needs_clang() {
267 + [[ ${CHROMIUM_FORCE_CLANG} == yes ]] || use libcxx || use lto || use pgo
268 +}
269 +
270 +llvm_check_deps() {
271 + if ! has_version -b "sys-devel/clang:${LLVM_SLOT}" ; then
272 + einfo "sys-devel/clang:${LLVM_SLOT} is missing! Cannot use LLVM slot ${LLVM_SLOT} ..." >&2
273 + return 1
274 + fi
275 +
276 + if ( use lto || use pgo ) && ! has_version -b "=sys-devel/lld-${LLVM_SLOT}*" ; then
277 + einfo "=sys-devel/lld-${LLVM_SLOT}* is missing! Cannot use LLVM slot ${LLVM_SLOT} ..." >&2
278 + return 1
279 + fi
280 +
281 + einfo "Using LLVM slot ${LLVM_SLOT} to build" >&2
282 +}
283 +
284 +pre_build_checks() {
285 + if [[ ${MERGE_TYPE} != binary ]]; then
286 + [[ ${EBUILD_PHASE_FUNC} == pkg_setup ]] && ( use lto || use pgo ) && llvm_pkg_setup
287 +
288 + local -x CPP="$(tc-getCXX) -E"
289 + if tc-is-gcc && ! ver_test "$(gcc-version)" -ge 9.2; then
290 + die "At least gcc 9.2 is required"
291 + fi
292 + if use pgo && tc-is-cross-compiler; then
293 + die "The pgo USE flag cannot be used when cross-compiling"
294 + fi
295 + if needs_clang || tc-is-clang; then
296 + tc-is-cross-compiler && CPP=${CBUILD}-clang++ || CPP=${CHOST}-clang++
297 + CPP+=" -E"
298 + if ! ver_test "$(clang-major-version)" -ge 12; then
299 + die "At least clang 12 is required"
300 + fi
301 + fi
302 + if [[ ${EBUILD_PHASE_FUNC} == pkg_setup ]] && use js-type-check; then
303 + "${BROOT}"/usr/bin/java -version 2>1 > /dev/null || die "Java VM not setup correctly"
304 + fi
305 + fi
306 +
307 + # Check build requirements, bug #541816 and bug #471810 .
308 + CHECKREQS_MEMORY="4G"
309 + CHECKREQS_DISK_BUILD="12G"
310 + tc-is-cross-compiler && CHECKREQS_DISK_BUILD="14G"
311 + if use lto || use pgo; then
312 + CHECKREQS_MEMORY="9G"
313 + CHECKREQS_DISK_BUILD="13G"
314 + tc-is-cross-compiler && CHECKREQS_DISK_BUILD="16G"
315 + use pgo && CHECKREQS_DISK_BUILD="20G"
316 + fi
317 + if is-flagq '-g?(gdb)?([1-9])'; then
318 + if use custom-cflags || use component-build; then
319 + CHECKREQS_DISK_BUILD="25G"
320 + fi
321 + if ! use component-build; then
322 + CHECKREQS_MEMORY="16G"
323 + fi
324 + fi
325 + check-reqs_${EBUILD_PHASE_FUNC}
326 +}
327 +
328 +pkg_pretend() {
329 + pre_build_checks
330 +
331 + if use headless; then
332 + local headless_unused_flags=("cups" "kerberos" "pulseaudio" "vaapi" "wayland")
333 + for myiuse in ${headless_unused_flags[@]}; do
334 + use ${myiuse} && ewarn "Ignoring USE=${myiuse} since USE=headless is set."
335 + done
336 + fi
337 +}
338 +
339 +pkg_setup() {
340 + pre_build_checks
341 +
342 + chromium_suid_sandbox_check_kernel_config
343 +
344 + # nvidia-drivers does not work correctly with Wayland due to unsupported EGLStreams
345 + if use wayland && ! use headless && has_version "x11-drivers/nvidia-drivers"; then
346 + ewarn "Proprietary nVidia driver does not work with Wayland. You can disable"
347 + ewarn "Wayland by setting DISABLE_OZONE_PLATFORM=true in /etc/chromium/default."
348 + fi
349 +}
350 +
351 +src_prepare() {
352 + # Calling this here supports resumption via FEATURES=keepwork
353 + python_setup
354 +
355 + local PATCHES=(
356 + "${WORKDIR}/patches"
357 + "${FILESDIR}/chromium-93-InkDropHost-crash.patch"
358 + "${FILESDIR}/chromium-98-EnumTable-crash.patch"
359 + "${FILESDIR}/chromium-98-gtk4-build.patch"
360 + "${FILESDIR}/chromium-105-swiftshader-no-wayland.patch"
361 + "${FILESDIR}/chromium-107-system-zlib.patch"
362 + "${FILESDIR}/chromium-use-oauth2-client-switches-as-default.patch"
363 + "${FILESDIR}/chromium-shim_headers.patch"
364 + "${FILESDIR}/chromium-cross-compile.patch"
365 + )
366 +
367 + default
368 +
369 + mkdir -p third_party/node/linux/node-linux-x64/bin || die
370 + ln -s "${EPREFIX}"/usr/bin/node third_party/node/linux/node-linux-x64/bin/node || die
371 +
372 + # adjust python interpreter version
373 + sed -i -e "s|\(^script_executable = \).*|\1\"${EPYTHON}\"|g" .gn || die
374 +
375 + local keeplibs=(
376 + base/third_party/cityhash
377 + base/third_party/double_conversion
378 + base/third_party/dynamic_annotations
379 + base/third_party/icu
380 + base/third_party/nspr
381 + base/third_party/superfasthash
382 + base/third_party/symbolize
383 + base/third_party/valgrind
384 + base/third_party/xdg_mime
385 + base/third_party/xdg_user_dirs
386 + buildtools/third_party/libc++
387 + buildtools/third_party/libc++abi
388 + chrome/third_party/mozilla_security_manager
389 + courgette/third_party
390 + net/third_party/mozilla_security_manager
391 + net/third_party/nss
392 + net/third_party/quic
393 + net/third_party/uri_template
394 + third_party/abseil-cpp
395 + third_party/angle
396 + third_party/angle/src/common/third_party/base
397 + third_party/angle/src/common/third_party/smhasher
398 + third_party/angle/src/common/third_party/xxhash
399 + third_party/angle/src/third_party/libXNVCtrl
400 + third_party/angle/src/third_party/trace_event
401 + third_party/angle/src/third_party/volk
402 + third_party/apple_apsl
403 + third_party/axe-core
404 + third_party/blink
405 + third_party/bidimapper
406 + third_party/boringssl
407 + third_party/boringssl/src/third_party/fiat
408 + third_party/breakpad
409 + third_party/breakpad/breakpad/src/third_party/curl
410 + third_party/brotli
411 + third_party/catapult
412 + third_party/catapult/common/py_vulcanize/third_party/rcssmin
413 + third_party/catapult/common/py_vulcanize/third_party/rjsmin
414 + third_party/catapult/third_party/beautifulsoup4-4.9.3
415 + third_party/catapult/third_party/html5lib-1.1
416 + third_party/catapult/third_party/polymer
417 + third_party/catapult/third_party/six
418 + third_party/catapult/tracing/third_party/d3
419 + third_party/catapult/tracing/third_party/gl-matrix
420 + third_party/catapult/tracing/third_party/jpeg-js
421 + third_party/catapult/tracing/third_party/jszip
422 + third_party/catapult/tracing/third_party/mannwhitneyu
423 + third_party/catapult/tracing/third_party/oboe
424 + third_party/catapult/tracing/third_party/pako
425 + third_party/ced
426 + third_party/cld_3
427 + third_party/closure_compiler
428 + third_party/content_analysis_sdk
429 + third_party/cpuinfo
430 + third_party/crashpad
431 + third_party/crashpad/crashpad/third_party/lss
432 + third_party/crashpad/crashpad/third_party/zlib
433 + third_party/crc32c
434 + third_party/cros_system_api
435 + third_party/dawn
436 + third_party/dawn/third_party/gn/webgpu-cts
437 + third_party/dawn/third_party/khronos
438 + third_party/depot_tools
439 + third_party/devscripts
440 + third_party/devtools-frontend
441 + third_party/devtools-frontend/src/front_end/third_party/acorn
442 + third_party/devtools-frontend/src/front_end/third_party/additional_readme_paths.json
443 + third_party/devtools-frontend/src/front_end/third_party/axe-core
444 + third_party/devtools-frontend/src/front_end/third_party/chromium
445 + third_party/devtools-frontend/src/front_end/third_party/codemirror
446 + third_party/devtools-frontend/src/front_end/third_party/diff
447 + third_party/devtools-frontend/src/front_end/third_party/i18n
448 + third_party/devtools-frontend/src/front_end/third_party/intl-messageformat
449 + third_party/devtools-frontend/src/front_end/third_party/lighthouse
450 + third_party/devtools-frontend/src/front_end/third_party/lit-html
451 + third_party/devtools-frontend/src/front_end/third_party/lodash-isequal
452 + third_party/devtools-frontend/src/front_end/third_party/marked
453 + third_party/devtools-frontend/src/front_end/third_party/puppeteer
454 + third_party/devtools-frontend/src/front_end/third_party/wasmparser
455 + third_party/devtools-frontend/src/test/unittests/front_end/third_party/i18n
456 + third_party/devtools-frontend/src/third_party
457 + third_party/distributed_point_functions
458 + third_party/dom_distiller_js
459 + third_party/eigen3
460 + third_party/emoji-segmenter
461 + third_party/farmhash
462 + third_party/fdlibm
463 + third_party/fft2d
464 + third_party/flatbuffers
465 + third_party/fp16
466 + third_party/freetype
467 + third_party/fusejs
468 + third_party/fxdiv
469 + third_party/highway
470 + third_party/libgifcodec
471 + third_party/liburlpattern
472 + third_party/libzip
473 + third_party/gemmlowp
474 + third_party/google_input_tools
475 + third_party/google_input_tools/third_party/closure_library
476 + third_party/google_input_tools/third_party/closure_library/third_party/closure
477 + third_party/googletest
478 + third_party/hunspell
479 + third_party/iccjpeg
480 + third_party/inspector_protocol
481 + third_party/ipcz
482 + third_party/jinja2
483 + third_party/jsoncpp
484 + third_party/jstemplate
485 + third_party/khronos
486 + third_party/leveldatabase
487 + third_party/libaddressinput
488 + third_party/libavif
489 + third_party/libevent
490 + third_party/libgav1
491 + third_party/libjingle
492 + third_party/libjxl
493 + third_party/libphonenumber
494 + third_party/libsecret
495 + third_party/libsrtp
496 + third_party/libsync
497 + third_party/libudev
498 + third_party/libva_protected_content
499 + third_party/libvpx
500 + third_party/libvpx/source/libvpx/third_party/x86inc
501 + third_party/libwebm
502 + third_party/libx11
503 + third_party/libxcb-keysyms
504 + third_party/libxml/chromium
505 + third_party/libyuv
506 + third_party/llvm
507 + third_party/lottie
508 + third_party/lss
509 + third_party/lzma_sdk
510 + third_party/mako
511 + third_party/maldoca
512 + third_party/maldoca/src/third_party/tensorflow_protos
513 + third_party/maldoca/src/third_party/zlibwrapper
514 + third_party/markupsafe
515 + third_party/mesa
516 + third_party/metrics_proto
517 + third_party/minigbm
518 + third_party/modp_b64
519 + third_party/nasm
520 + third_party/nearby
521 + third_party/neon_2_sse
522 + third_party/node
523 + third_party/omnibox_proto
524 + third_party/one_euro_filter
525 + third_party/openscreen
526 + third_party/openscreen/src/third_party/mozilla
527 + third_party/openscreen/src/third_party/tinycbor/src/src
528 + third_party/ots
529 + third_party/pdfium
530 + third_party/pdfium/third_party/agg23
531 + third_party/pdfium/third_party/base
532 + third_party/pdfium/third_party/bigint
533 + third_party/pdfium/third_party/freetype
534 + third_party/pdfium/third_party/lcms
535 + third_party/pdfium/third_party/libopenjpeg
536 + third_party/pdfium/third_party/libpng16
537 + third_party/pdfium/third_party/libtiff
538 + third_party/pdfium/third_party/skia_shared
539 + third_party/perfetto
540 + third_party/perfetto/protos/third_party/chromium
541 + third_party/pffft
542 + third_party/ply
543 + third_party/polymer
544 + third_party/private-join-and-compute
545 + third_party/private_membership
546 + third_party/protobuf
547 + third_party/protobuf/third_party/six
548 + third_party/pthreadpool
549 + third_party/pyjson5
550 + third_party/qcms
551 + third_party/rnnoise
552 + third_party/s2cellid
553 + third_party/securemessage
554 + third_party/shell-encryption
555 + third_party/simplejson
556 + third_party/skia
557 + third_party/skia/include/third_party/vulkan
558 + third_party/skia/third_party/vulkan
559 + third_party/smhasher
560 + third_party/snappy
561 + third_party/sqlite
562 + third_party/swiftshader
563 + third_party/swiftshader/third_party/astc-encoder
564 + third_party/swiftshader/third_party/llvm-subzero
565 + third_party/swiftshader/third_party/marl
566 + third_party/swiftshader/third_party/subzero
567 + third_party/swiftshader/third_party/SPIRV-Headers/include/spirv
568 + third_party/swiftshader/third_party/SPIRV-Tools
569 + third_party/tensorflow-text
570 + third_party/tflite
571 + third_party/tflite/src/third_party/eigen3
572 + third_party/tflite/src/third_party/fft2d
573 + third_party/ruy
574 + third_party/six
575 + third_party/ukey2
576 + third_party/unrar
577 + third_party/utf
578 + third_party/vulkan
579 + third_party/web-animations-js
580 + third_party/webdriver
581 + third_party/webgpu-cts
582 + third_party/webrtc
583 + third_party/webrtc/common_audio/third_party/ooura
584 + third_party/webrtc/common_audio/third_party/spl_sqrt_floor
585 + third_party/webrtc/modules/third_party/fft
586 + third_party/webrtc/modules/third_party/g711
587 + third_party/webrtc/modules/third_party/g722
588 + third_party/webrtc/rtc_base/third_party/base64
589 + third_party/webrtc/rtc_base/third_party/sigslot
590 + third_party/widevine
591 + third_party/woff2
592 + third_party/wuffs
593 + third_party/x11proto
594 + third_party/xcbproto
595 + third_party/xnnpack
596 + third_party/zxcvbn-cpp
597 + third_party/zlib/google
598 + url/third_party/mozilla
599 + v8/src/third_party/siphash
600 + v8/src/third_party/valgrind
601 + v8/src/third_party/utf8-decoder
602 + v8/third_party/inspector_protocol
603 + v8/third_party/v8
604 +
605 + # gyp -> gn leftovers
606 + third_party/speech-dispatcher
607 + third_party/usb_ids
608 + third_party/xdg-utils
609 + )
610 + if ! use system-ffmpeg; then
611 + keeplibs+=( third_party/ffmpeg third_party/opus )
612 + fi
613 + if ! use system-icu; then
614 + keeplibs+=( third_party/icu )
615 + fi
616 + if ! use system-png; then
617 + keeplibs+=( third_party/libpng )
618 + fi
619 + if ! use system-av1; then
620 + keep_libs+=(
621 + third_party/dav1d
622 + third_party/libaom
623 + third_party/libaom/source/libaom/third_party/fastfeat
624 + third_party/libaom/source/libaom/third_party/vector
625 + third_party/libaom/source/libaom/third_party/x86inc
626 + )
627 + fi
628 + if use libcxx; then
629 + keeplibs+=( third_party/re2 )
630 + fi
631 + if use system-harfbuzz; then
632 + keeplibs+=( third_party/harfbuzz-ng/utils )
633 + else
634 + keeplibs+=( third_party/harfbuzz-ng )
635 + fi
636 + if use wayland && ! use headless ; then
637 + keeplibs+=( third_party/wayland )
638 + # only need the .gn files
639 + rm -r third_party/wayland/src || die
640 + fi
641 + if use arm64 || use ppc64 ; then
642 + keeplibs+=( third_party/swiftshader/third_party/llvm-10.0 )
643 + fi
644 + # we need to generate ppc64 stuff because upstream does not ship it yet
645 + # it has to be done before unbundling.
646 + if use ppc64; then
647 + pushd third_party/libvpx >/dev/null || die
648 + mkdir -p source/config/linux/ppc64 || die
649 + # requires git and clang, bug #832803
650 + sed -i -e "s|^update_readme||g; s|clang-format|${EPREFIX}/bin/true|g" \
651 + generate_gni.sh || die
652 + ./generate_gni.sh || die
653 + popd >/dev/null || die
654 +
655 + pushd third_party/ffmpeg >/dev/null || die
656 + cp libavcodec/ppc/h264dsp.c libavcodec/ppc/h264dsp_ppc.c || die
657 + cp libavcodec/ppc/h264qpel.c libavcodec/ppc/h264qpel_ppc.c || die
658 + popd >/dev/null || die
659 + fi
660 +
661 + # Remove most bundled libraries. Some are still needed.
662 + build/linux/unbundle/remove_bundled_libraries.py "${keeplibs[@]}" --do-remove || die
663 +
664 + if use js-type-check; then
665 + ln -s "${EPREFIX}"/usr/bin/java third_party/jdk/current/bin/java || die
666 + fi
667 +
668 + # bundled eu-strip is for amd64 only and we don't want to pre-stripped binaries
669 + mkdir -p buildtools/third_party/eu-strip/bin || die
670 + ln -s "${EPREFIX}"/bin/true buildtools/third_party/eu-strip/bin/eu-strip || die
671 +}
672 +
673 +chromium_configure() {
674 + # Calling this here supports resumption via FEATURES=keepwork
675 + python_setup
676 +
677 + local myconf_gn=""
678 +
679 + # Make sure the build system will use the right tools, bug #340795.
680 + tc-export AR CC CXX NM
681 +
682 + if needs_clang && ! tc-is-clang; then
683 + # Force clang since gcc is either broken or build is using libcxx.
684 + if tc-is-cross-compiler; then
685 + CC="${CBUILD}-clang -target ${CHOST} --sysroot ${ESYSROOT}"
686 + CXX="${CBUILD}-clang++ -target ${CHOST} --sysroot ${ESYSROOT}"
687 + BUILD_CC=${CBUILD}-clang
688 + BUILD_CXX=${CBUILD}-clang++
689 + else
690 + CC=${CHOST}-clang
691 + CXX=${CHOST}-clang++
692 + fi
693 + strip-unsupported-flags
694 + fi
695 +
696 + if tc-is-clang; then
697 + myconf_gn+=" is_clang=true clang_use_chrome_plugins=false"
698 + else
699 + myconf_gn+=" is_clang=false"
700 + fi
701 +
702 + # Force lld for lto or pgo builds only, otherwise disable, bug 641556
703 + if use lto || use pgo; then
704 + myconf_gn+=" use_lld=true"
705 + else
706 + myconf_gn+=" use_lld=false"
707 + fi
708 +
709 + if use lto || use pgo; then
710 + AR=llvm-ar
711 + NM=llvm-nm
712 + if tc-is-cross-compiler; then
713 + BUILD_AR=llvm-ar
714 + BUILD_NM=llvm-nm
715 + fi
716 + fi
717 +
718 + # Define a custom toolchain for GN
719 + myconf_gn+=" custom_toolchain=\"//build/toolchain/linux/unbundle:default\""
720 +
721 + if tc-is-cross-compiler; then
722 + tc-export BUILD_{AR,CC,CXX,NM}
723 + myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:host\""
724 + myconf_gn+=" v8_snapshot_toolchain=\"//build/toolchain/linux/unbundle:host\""
725 + myconf_gn+=" pkg_config=\"$(tc-getPKG_CONFIG)\""
726 + myconf_gn+=" host_pkg_config=\"$(tc-getBUILD_PKG_CONFIG)\""
727 +
728 + # setup cups-config, build system only uses --libs option
729 + if use cups; then
730 + mkdir "${T}/cups-config" || die
731 + cp "${ESYSROOT}/usr/bin/${CHOST}-cups-config" "${T}/cups-config/cups-config" || die
732 + export PATH="${PATH}:${T}/cups-config"
733 + fi
734 +
735 + # Don't inherit PKG_CONFIG_PATH from environment
736 + local -x PKG_CONFIG_PATH=
737 + else
738 + myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:default\""
739 + fi
740 +
741 + # GN needs explicit config for Debug/Release as opposed to inferring it from build directory.
742 + myconf_gn+=" is_debug=false"
743 +
744 + # enable DCHECK with USE=debug only, increases chrome binary size by 30%, bug #811138.
745 + # DCHECK is fatal by default, make it configurable at runtime, #bug 807881.
746 + myconf_gn+=" dcheck_always_on=$(usex debug true false)"
747 + myconf_gn+=" dcheck_is_configurable=$(usex debug true false)"
748 +
749 + # Component build isn't generally intended for use by end users. It's mostly useful
750 + # for development and debugging.
751 + myconf_gn+=" is_component_build=$(usex component-build true false)"
752 +
753 + # Disable nacl, we can't build without pnacl (http://crbug.com/269560).
754 + myconf_gn+=" enable_nacl=false"
755 +
756 + # Use system-provided libraries.
757 + # TODO: freetype -- remove sources (https://bugs.chromium.org/p/pdfium/issues/detail?id=733).
758 + # TODO: use_system_hunspell (upstream changes needed).
759 + # TODO: use_system_protobuf (bug #525560).
760 + # TODO: use_system_sqlite (http://crbug.com/22208).
761 +
762 + # libevent: https://bugs.gentoo.org/593458
763 + local gn_system_libraries=(
764 + flac
765 + fontconfig
766 + freetype
767 + # Need harfbuzz_from_pkgconfig target
768 + #harfbuzz-ng
769 + libdrm
770 + libjpeg
771 + libwebp
772 + libxml
773 + libxslt
774 + openh264
775 + zlib
776 + )
777 + if use system-ffmpeg; then
778 + gn_system_libraries+=( ffmpeg opus )
779 + fi
780 + if use system-icu; then
781 + gn_system_libraries+=( icu )
782 + fi
783 + if use system-png; then
784 + gn_system_libraries+=( libpng )
785 + fi
786 + if use system-av1; then
787 + gn_system_libraries+=( dav1d libaom )
788 + fi
789 + # re2 library interface relies on std::string and std::vector
790 + if ! use libcxx; then
791 + gn_system_libraries+=( re2 )
792 + fi
793 + build/linux/unbundle/replace_gn_files.py --system-libraries "${gn_system_libraries[@]}" || die
794 +
795 + # See dependency logic in third_party/BUILD.gn
796 + myconf_gn+=" use_system_harfbuzz=$(usex system-harfbuzz true false)"
797 +
798 + # Disable deprecated libgnome-keyring dependency, bug #713012
799 + myconf_gn+=" use_gnome_keyring=false"
800 +
801 + # Optional dependencies.
802 + myconf_gn+=" enable_js_type_check=$(usex js-type-check true false)"
803 + myconf_gn+=" enable_hangout_services_extension=$(usex hangouts true false)"
804 + myconf_gn+=" enable_widevine=$(usex widevine true false)"
805 +
806 + if use headless; then
807 + myconf_gn+=" use_cups=false"
808 + myconf_gn+=" use_kerberos=false"
809 + myconf_gn+=" use_pulseaudio=false"
810 + myconf_gn+=" use_vaapi=false"
811 + myconf_gn+=" rtc_use_pipewire=false"
812 + else
813 + myconf_gn+=" use_cups=$(usex cups true false)"
814 + myconf_gn+=" use_kerberos=$(usex kerberos true false)"
815 + myconf_gn+=" use_pulseaudio=$(usex pulseaudio true false)"
816 + myconf_gn+=" use_vaapi=$(usex vaapi true false)"
817 + myconf_gn+=" rtc_use_pipewire=$(usex screencast true false)"
818 + myconf_gn+=" gtk_version=$(usex gtk4 4 3)"
819 + fi
820 +
821 + # TODO: link_pulseaudio=true for GN.
822 +
823 + myconf_gn+=" disable_fieldtrial_testing_config=true"
824 +
825 + # Never use bundled gold binary. Disable gold linker flags for now.
826 + # Do not use bundled clang.
827 + # Trying to use gold results in linker crash.
828 + myconf_gn+=" use_gold=false use_sysroot=false"
829 + myconf_gn+=" use_custom_libcxx=$(usex libcxx true false)"
830 +
831 + # Disable pseudolocales, only used for testing
832 + myconf_gn+=" enable_pseudolocales=false"
833 +
834 + # Disable code formating of generated files
835 + myconf_gn+=" blink_enable_generated_code_formatting=false"
836 +
837 + ffmpeg_branding="$(usex proprietary-codecs Chrome Chromium)"
838 + myconf_gn+=" proprietary_codecs=$(usex proprietary-codecs true false)"
839 + myconf_gn+=" ffmpeg_branding=\"${ffmpeg_branding}\""
840 +
841 + # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys .
842 + # Note: these are for Gentoo use ONLY. For your own distribution,
843 + # please get your own set of keys. Feel free to contact chromium@g.o
844 + # for more info. The OAuth2 credentials, however, have been left out.
845 + # Those OAuth2 credentials have been broken for quite some time anyway.
846 + # Instead we apply a patch to use the --oauth2-client-id= and
847 + # --oauth2-client-secret= switches for setting GOOGLE_DEFAULT_CLIENT_ID and
848 + # GOOGLE_DEFAULT_CLIENT_SECRET at runtime. This allows signing into
849 + # Chromium without baked-in values.
850 + local google_api_key="AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc"
851 + myconf_gn+=" google_api_key=\"${google_api_key}\""
852 + local myarch="$(tc-arch)"
853 +
854 + # Avoid CFLAGS problems, bug #352457, bug #390147.
855 + if ! use custom-cflags; then
856 + replace-flags "-Os" "-O2"
857 + strip-flags
858 +
859 + # Debug info section overflows without component build
860 + # Prevent linker from running out of address space, bug #471810 .
861 + if ! use component-build || use x86; then
862 + filter-flags "-g*"
863 + fi
864 +
865 + # Prevent libvpx/xnnpack build failures. Bug 530248, 544702, 546984, 853646.
866 + if [[ ${myarch} == amd64 || ${myarch} == x86 ]]; then
867 + filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 -mno-avx -mno-avx2 -mno-fma -mno-fma4 -mno-xop -mno-sse4a
868 + fi
869 + fi
870 +
871 + if [[ $myarch = amd64 ]] ; then
872 + myconf_gn+=" target_cpu=\"x64\""
873 + ffmpeg_target_arch=x64
874 + elif [[ $myarch = x86 ]] ; then
875 + myconf_gn+=" target_cpu=\"x86\""
876 + ffmpeg_target_arch=ia32
877 +
878 + # This is normally defined by compiler_cpu_abi in
879 + # build/config/compiler/BUILD.gn, but we patch that part out.
880 + append-flags -msse2 -mfpmath=sse -mmmx
881 + elif [[ $myarch = arm64 ]] ; then
882 + myconf_gn+=" target_cpu=\"arm64\""
883 + ffmpeg_target_arch=arm64
884 + elif [[ $myarch = arm ]] ; then
885 + myconf_gn+=" target_cpu=\"arm\""
886 + ffmpeg_target_arch=$(usex cpu_flags_arm_neon arm-neon arm)
887 + elif [[ $myarch = ppc64 ]] ; then
888 + myconf_gn+=" target_cpu=\"ppc64\""
889 + ffmpeg_target_arch=ppc64
890 + else
891 + die "Failed to determine target arch, got '$myarch'."
892 + fi
893 +
894 + # Make sure that -Werror doesn't get added to CFLAGS by the build system.
895 + # Depending on GCC version the warnings are different and we don't want
896 + # the build to fail because of that.
897 + myconf_gn+=" treat_warnings_as_errors=false"
898 +
899 + # Disable fatal linker warnings, bug 506268.
900 + myconf_gn+=" fatal_linker_warnings=false"
901 +
902 + # Disable external code space for V8 for ppc64. It is disabled for ppc64
903 + # by default, but cross-compiling on amd64 enables it again.
904 + if tc-is-cross-compiler; then
905 + if ! use amd64 && ! use arm64; then
906 + myconf_gn+=" v8_enable_external_code_space=false"
907 + fi
908 + fi
909 +
910 + # Bug 491582.
911 + export TMPDIR="${WORKDIR}/temp"
912 + mkdir -p -m 755 "${TMPDIR}" || die
913 +
914 + # https://bugs.gentoo.org/654216
915 + addpredict /dev/dri/ #nowarn
916 +
917 + #if ! use system-ffmpeg; then
918 + if false; then
919 + local build_ffmpeg_args=""
920 + if use pic && [[ "${ffmpeg_target_arch}" == "ia32" ]]; then
921 + build_ffmpeg_args+=" --disable-asm"
922 + fi
923 +
924 + # Re-configure bundled ffmpeg. See bug #491378 for example reasons.
925 + einfo "Configuring bundled ffmpeg..."
926 + pushd third_party/ffmpeg > /dev/null || die
927 + chromium/scripts/build_ffmpeg.py linux ${ffmpeg_target_arch} \
928 + --branding ${ffmpeg_branding} -- ${build_ffmpeg_args} || die
929 + chromium/scripts/copy_config.sh || die
930 + chromium/scripts/generate_gn.py || die
931 + popd > /dev/null || die
932 + fi
933 +
934 + # Disable unknown warning message from clang.
935 + if tc-is-clang; then
936 + append-flags -Wno-unknown-warning-option
937 + if tc-is-cross-compiler; then
938 + export BUILD_CXXFLAGS+=" -Wno-unknown-warning-option"
939 + export BUILD_CFLAGS+=" -Wno-unknown-warning-option"
940 + fi
941 + fi
942 +
943 + # Explicitly disable ICU data file support for system-icu/headless builds.
944 + if use system-icu || use headless; then
945 + myconf_gn+=" icu_use_data_file=false"
946 + fi
947 +
948 + # Enable ozone wayland and/or headless support
949 + myconf_gn+=" use_ozone=true ozone_auto_platforms=false"
950 + myconf_gn+=" ozone_platform_headless=true"
951 + if use headless; then
952 + myconf_gn+=" ozone_platform=\"headless\""
953 + myconf_gn+=" use_xkbcommon=false use_gtk=false use_qt=false"
954 + myconf_gn+=" use_glib=false use_gio=false"
955 + myconf_gn+=" use_pangocairo=false use_alsa=false"
956 + myconf_gn+=" use_libpci=false use_udev=false"
957 + myconf_gn+=" enable_print_preview=false"
958 + myconf_gn+=" enable_remoting=false"
959 + else
960 + myconf_gn+=" use_system_libdrm=true"
961 + myconf_gn+=" use_system_minigbm=true"
962 + myconf_gn+=" use_xkbcommon=true"
963 + myconf_gn+=" use_qt=$(usex qt5 true false)"
964 + myconf_gn+=" ozone_platform_x11=$(usex X true false)"
965 + myconf_gn+=" ozone_platform_wayland=$(usex wayland true false)"
966 + myconf_gn+=" ozone_platform=$(usex wayland \"wayland\" \"x11\")"
967 + if use wayland; then
968 + myconf_gn+=" use_system_libwayland_server=true"
969 + myconf_gn+=" use_system_wayland_scanner=true"
970 + fi
971 + fi
972 +
973 + # Results in undefined references in chrome linking, may require CFI to work
974 + if use arm64; then
975 + myconf_gn+=" arm_control_flow_integrity=\"none\""
976 + fi
977 +
978 + # Enable official builds
979 + myconf_gn+=" is_official_build=$(usex official true false)"
980 + myconf_gn+=" use_thin_lto=$(usex lto true false)"
981 + myconf_gn+=" thin_lto_enable_optimizations=$(usex lto true false)"
982 + if use official; then
983 + # Allow building against system libraries in official builds
984 + sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \
985 + tools/generate_shim_headers/generate_shim_headers.py || die
986 + # Disable CFI: unsupported for GCC, requires clang+lto+lld
987 + myconf_gn+=" is_cfi=false"
988 + # Don't add symbols to build
989 + myconf_gn+=" symbol_level=0"
990 + fi
991 +
992 + if use pgo; then
993 + myconf_gn+=" chrome_pgo_phase=${1}"
994 + if [[ "$1" == "2" ]]; then
995 + myconf_gn+=" pgo_data_path=\"${2}\""
996 + fi
997 + else
998 + # Disable PGO, because profile data is only compatible with >=clang-11
999 + myconf_gn+=" chrome_pgo_phase=0"
1000 + fi
1001 +
1002 + # user CXXFLAGS might overwrite -march=armv8-a+crc+crypto, bug #851639
1003 + if use arm64 && tc-is-gcc; then
1004 + sed -i '/^#if HAVE_ARM64_CRC32C/a #pragma GCC target ("+crc+crypto")' \
1005 + third_party/crc32c/src/src/crc32c_arm64.cc || die
1006 + fi
1007 +
1008 + einfo "Configuring Chromium..."
1009 + set -- gn gen --args="${myconf_gn} ${EXTRA_GN}" out/Release
1010 + echo "$@"
1011 + "$@" || die
1012 +}
1013 +
1014 +src_configure() {
1015 + chromium_configure $(usex pgo 1 0)
1016 +}
1017 +
1018 +chromium_compile() {
1019 + # Final link uses lots of file descriptors.
1020 + ulimit -n 2048
1021 +
1022 + # Calling this here supports resumption via FEATURES=keepwork
1023 + python_setup
1024 +
1025 + # Don't inherit PYTHONPATH from environment, bug #789021, #812689
1026 + local -x PYTHONPATH=
1027 +
1028 + #"${EPYTHON}" tools/clang/scripts/update.py --force-local-build --gcc-toolchain /usr --skip-checkout --use-system-cmake --without-android || die
1029 +
1030 + # Build mksnapshot and pax-mark it.
1031 + local x
1032 + for x in mksnapshot v8_context_snapshot_generator; do
1033 + if tc-is-cross-compiler; then
1034 + eninja -C out/Release "host/${x}"
1035 + pax-mark m "out/Release/host/${x}"
1036 + else
1037 + eninja -C out/Release "${x}"
1038 + pax-mark m "out/Release/${x}"
1039 + fi
1040 + done
1041 +
1042 + # Even though ninja autodetects number of CPUs, we respect
1043 + # user's options, for debugging with -j 1 or any other reason.
1044 + eninja -C out/Release chrome chromedriver
1045 + use suid && eninja -C out/Release chrome_sandbox
1046 +
1047 + pax-mark m out/Release/chrome
1048 +}
1049 +
1050 +# This function is called from virtx, and must always return so that Xvfb
1051 +# session isn't left running. If we return 1, virtx will call die().
1052 +chromium_profile() {
1053 + einfo "Profiling for PGO"
1054 +
1055 + pushd "${WORKDIR}/chromium-profiler-"* >/dev/null || return 1
1056 +
1057 + # Remove old profdata in case profiling was interrupted.
1058 + rm -rf "${1}" || return 1
1059 +
1060 + if ! "${EPYTHON}" ./chromium_profiler.py \
1061 + --chrome-executable "${S}/out/Release/chrome" \
1062 + --chromedriver-executable "${S}/out/Release/chromedriver.unstripped" \
1063 + --add-arg no-sandbox --add-arg disable-dev-shm-usage \
1064 + --profile-output "${1}"; then
1065 + eerror "Profiling failed"
1066 + return 1
1067 + fi
1068 +
1069 + popd >/dev/null || return 1
1070 +}
1071 +
1072 +src_compile() {
1073 + if use pgo; then
1074 + local profdata
1075 +
1076 + profdata="${WORKDIR}/chromium.profdata"
1077 +
1078 + if [[ ! -e "${WORKDIR}/.pgo-profiled" ]]; then
1079 + chromium_compile
1080 + virtx chromium_profile "$profdata"
1081 +
1082 + touch "${WORKDIR}/.pgo-profiled" || die
1083 + fi
1084 +
1085 + if [[ ! -e "${WORKDIR}/.pgo-phase-2-configured" ]]; then
1086 + # Remove phase 1 output
1087 + rm -r out/Release || die
1088 +
1089 + chromium_configure 2 "$profdata"
1090 +
1091 + touch "${WORKDIR}/.pgo-phase-2-configured" || die
1092 + fi
1093 +
1094 + if [[ ! -e "${WORKDIR}/.pgo-phase-2-compiled" ]]; then
1095 + chromium_compile
1096 + touch "${WORKDIR}/.pgo-phase-2-compiled" || die
1097 + fi
1098 + else
1099 + chromium_compile
1100 + fi
1101 +
1102 + mv out/Release/chromedriver{.unstripped,} || die
1103 +
1104 + # Build manpage; bug #684550
1105 + sed -e 's|@@PACKAGE@@|chromium-browser|g;
1106 + s|@@MENUNAME@@|Chromium|g;' \
1107 + chrome/app/resources/manpage.1.in > \
1108 + out/Release/chromium-browser.1 || die
1109 +
1110 + # Build desktop file; bug #706786
1111 + sed -e 's|@@MENUNAME@@|Chromium|g;
1112 + s|@@USR_BIN_SYMLINK_NAME@@|chromium-browser|g;
1113 + s|@@PACKAGE@@|chromium-browser|g;
1114 + s|\(^Exec=\)/usr/bin/|\1|g;' \
1115 + chrome/installer/linux/common/desktop.template > \
1116 + out/Release/chromium-browser-chromium.desktop || die
1117 +
1118 + # Build vk_swiftshader_icd.json; bug #827861
1119 + sed -e 's|${ICD_LIBRARY_PATH}|./libvk_swiftshader.so|g' \
1120 + third_party/swiftshader/src/Vulkan/vk_swiftshader_icd.json.tmpl > \
1121 + out/Release/vk_swiftshader_icd.json || die
1122 +}
1123 +
1124 +src_install() {
1125 + local CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser"
1126 + exeinto "${CHROMIUM_HOME}"
1127 + doexe out/Release/chrome
1128 +
1129 + if use suid; then
1130 + newexe out/Release/chrome_sandbox chrome-sandbox
1131 + fperms 4755 "${CHROMIUM_HOME}/chrome-sandbox"
1132 + fi
1133 +
1134 + doexe out/Release/chromedriver
1135 + doexe out/Release/chrome_crashpad_handler
1136 +
1137 + ozone_auto_session () {
1138 + use X && use wayland && ! use headless && echo true || echo false
1139 + }
1140 + local sedargs=( -e
1141 + "s:/usr/lib/:/usr/$(get_libdir)/:g;
1142 + s:@@OZONE_AUTO_SESSION@@:$(ozone_auto_session):g"
1143 + )
1144 + sed "${sedargs[@]}" "${FILESDIR}/chromium-launcher-r7.sh" > chromium-launcher.sh || die
1145 + doexe chromium-launcher.sh
1146 +
1147 + # It is important that we name the target "chromium-browser",
1148 + # xdg-utils expect it; bug #355517.
1149 + dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser
1150 + # keep the old symlink around for consistency
1151 + dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium
1152 +
1153 + dosym "${CHROMIUM_HOME}/chromedriver" /usr/bin/chromedriver
1154 +
1155 + # Allow users to override command-line options, bug #357629.
1156 + insinto /etc/chromium
1157 + newins "${FILESDIR}/chromium.default" "default"
1158 +
1159 + pushd out/Release/locales > /dev/null || die
1160 + chromium_remove_language_paks
1161 + popd
1162 +
1163 + insinto "${CHROMIUM_HOME}"
1164 + doins out/Release/*.bin
1165 + doins out/Release/*.pak
1166 + (
1167 + shopt -s nullglob
1168 + local files=(out/Release/*.so out/Release/*.so.[0-9])
1169 + [[ ${#files[@]} -gt 0 ]] && doins "${files[@]}"
1170 + )
1171 +
1172 + if ! use system-icu && ! use headless; then
1173 + doins out/Release/icudtl.dat
1174 + fi
1175 +
1176 + doins -r out/Release/locales
1177 + doins -r out/Release/MEIPreload
1178 +
1179 + # Install vk_swiftshader_icd.json; bug #827861
1180 + doins out/Release/vk_swiftshader_icd.json
1181 +
1182 + if [[ -d out/Release/swiftshader ]]; then
1183 + insinto "${CHROMIUM_HOME}/swiftshader"
1184 + doins out/Release/swiftshader/*.so
1185 + fi
1186 +
1187 + # Install icons
1188 + local branding size
1189 + for size in 16 24 32 48 64 128 256 ; do
1190 + case ${size} in
1191 + 16|32) branding="chrome/app/theme/default_100_percent/chromium" ;;
1192 + *) branding="chrome/app/theme/chromium" ;;
1193 + esac
1194 + newicon -s ${size} "${branding}/product_logo_${size}.png" \
1195 + chromium-browser.png
1196 + done
1197 +
1198 + # Install desktop entry
1199 + domenu out/Release/chromium-browser-chromium.desktop
1200 +
1201 + # Install GNOME default application entry (bug #303100).
1202 + insinto /usr/share/gnome-control-center/default-apps
1203 + newins "${FILESDIR}"/chromium-browser.xml chromium-browser.xml
1204 +
1205 + # Install manpage; bug #684550
1206 + doman out/Release/chromium-browser.1
1207 + dosym chromium-browser.1 /usr/share/man/man1/chromium.1
1208 +
1209 + readme.gentoo_create_doc
1210 +}
1211 +
1212 +pkg_postrm() {
1213 + xdg_icon_cache_update
1214 + xdg_desktop_database_update
1215 +}
1216 +
1217 +pkg_postinst() {
1218 + xdg_icon_cache_update
1219 + xdg_desktop_database_update
1220 + readme.gentoo_print_elog
1221 +
1222 + if ! use headless; then
1223 + if use vaapi; then
1224 + elog "VA-API is disabled by default at runtime. You have to enable it"
1225 + elog "by adding --enable-features=VaapiVideoDecoder to CHROMIUM_FLAGS"
1226 + elog "in /etc/chromium/default."
1227 + fi
1228 + if use screencast; then
1229 + elog "Screencast is disabled by default at runtime. Either enable it"
1230 + elog "by navigating to chrome://flags/#enable-webrtc-pipewire-capturer"
1231 + elog "inside Chromium or add --enable-features=WebRTCPipeWireCapturer"
1232 + elog "to CHROMIUM_FLAGS in /etc/chromium/default."
1233 + fi
1234 + if use gtk4; then
1235 + elog "Chromium prefers GTK3 over GTK4 at runtime. To override this"
1236 + elog "behavior you need to pass --gtk-version=4, e.g. by adding it"
1237 + elog "to CHROMIUM_FLAGS in /etc/chromium/default."
1238 + fi
1239 + fi
1240 +}
1241
1242 diff --git a/www-client/chromium/files/chromium-107-system-zlib.patch b/www-client/chromium/files/chromium-107-system-zlib.patch
1243 new file mode 100644
1244 index 000000000000..5ee7dccb7ab2
1245 --- /dev/null
1246 +++ b/www-client/chromium/files/chromium-107-system-zlib.patch
1247 @@ -0,0 +1,10 @@
1248 +--- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc
1249 ++++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc
1250 +@@ -19,7 +19,6 @@ limitations under the License.
1251 + #include <cstdio>
1252 +
1253 + #include "absl/strings/string_view.h" // from @com_google_absl
1254 +-#include "contrib/minizip/ioapi.h"
1255 +
1256 + namespace tflite {
1257 + namespace metadata {
1258
1259 diff --git a/www-client/chromium/metadata.xml b/www-client/chromium/metadata.xml
1260 index 8d7ae046c973..cdb8b565f3f1 100644
1261 --- a/www-client/chromium/metadata.xml
1262 +++ b/www-client/chromium/metadata.xml
1263 @@ -19,6 +19,7 @@
1264 <flag name="pic">Disable optimized assembly code that is not PIC friendly</flag>
1265 <flag name="proprietary-codecs">Enable codecs for patent-encumbered audio and video formats.</flag>
1266 <flag name="suid">Build the SUID sandbox, which is only needed on CONFIG_USER_NS=n kernels</flag>
1267 + <flag name="system-av1">Use system libaom and dav1d instead of the bundled one.</flag>
1268 <flag name="system-ffmpeg">Use system ffmpeg instead of the bundled one</flag>
1269 <flag name="system-harfbuzz">Use system harfbuzz instead of the bundled one.</flag>
1270 <flag name="system-icu">Use system icu instead of the bundled one</flag>