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