Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-client/chromium/
Date: Mon, 28 Nov 2022 02:59:55
Message-Id: 1669604376.4e97908831b93b70767f8c331b9b0f7dd04827e2.floppym@gentoo
1 commit: 4e97908831b93b70767f8c331b9b0f7dd04827e2
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Mon Nov 28 02:59:36 2022 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Mon Nov 28 02:59:36 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4e979088
7
8 www-client/chromium: drop 107.0.5304.87, 107.0.5304.110
9
10 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
11
12 www-client/chromium/Manifest | 2 -
13 www-client/chromium/chromium-107.0.5304.110.ebuild | 1227 --------------------
14 www-client/chromium/chromium-107.0.5304.87.ebuild | 1227 --------------------
15 3 files changed, 2456 deletions(-)
16
17 diff --git a/www-client/chromium/Manifest b/www-client/chromium/Manifest
18 index 2b13d242fe11..474e351a6a89 100644
19 --- a/www-client/chromium/Manifest
20 +++ b/www-client/chromium/Manifest
21 @@ -1,7 +1,5 @@
22 DIST chromium-107-patchset-1.tar.xz 5736 BLAKE2B 581ca307d63635ef91aaa907aeebb8c735be6d6bbfcc3fe064fed7531b8848b5d918e017031ee606ed3bd8f0fc23aa6d2f8af4b36d33483dbeee2b5c8eacac82 SHA512 acbfb41c31a510a689cad3b0686e24925b018bd7a2a8f56f74b730dc36d878c266a11b3bb76b131e66f7b859f483ff00e16cbaae1b2b6944010c7396310c03b8
23 -DIST chromium-107.0.5304.110.tar.xz 1688613008 BLAKE2B b595b34fdf709e89a38cae61d4476dcdb6730502bb631caed452d6efee61b2e052b6ce7f3440233ceb454ecdfeb07b0a01727173cdd94e00282552001e34f81d SHA512 f137e617026b5d4799e8be00c4a7a82e4164a4a505982f1fb731c01abecb378d9f6d7a41b015d7d118a2acb50983456c5dec9a7f3009d6af9e097369a52a9e19
24 DIST chromium-107.0.5304.121.tar.xz 1688476176 BLAKE2B f36a74dba65c50accceb13d6bae767960dc8764ac22292c8db860b87197dc00c3ae2b5176d5f391c98e8a332ab1bcda506b4760e95be9aab7926c3a38f8a0410 SHA512 c0d233ed18d95554d5b05102b24d92711b940f3897fd5252422d10bf1e8500c3875033aa4a211a11fd9b01ca5e65bd487aa0b0814da70a337a692d3cefb74081
25 -DIST chromium-107.0.5304.87.tar.xz 1688896996 BLAKE2B bca3506b55f29be6d40db8d4b1350a1703b1899136a2d66159619c202a37e6bf0d35fa21f79125c21bd079ed8002a6e41721f31578c7c48b12e1c4084a1e0b34 SHA512 9db2f8ea4f4f0c2a9791d1e03552f7fc3843338f1272975593347cdf85db283f55ad84fdda564609d52d95c36f4de8d662d24df7cc2e6dcf69d184765469233a
26 DIST chromium-108-patchset-2.tar.xz 6480 BLAKE2B 2a40bb741fdd305b3525b790f82c2b36f6c909680788527a31aa2a11f519ff630aa12ffe7c53553b717f1909978c77e7db07a02a86c8e7d12d63375402802d7a SHA512 3fe182f0f928baaf0f5521efa8763080de765240b5608d5126e84e49335eb5edc788ab406aa71f5fa97c371afe1f6808e93e2e082c7f65169b5f157ff6c3e00b
27 DIST chromium-108.0.5343.2.tar.xz 1669214708 BLAKE2B e022bb908b15a5ae645d23cc5ab1e268ab87b77af3ae9ac352f6dc2fc9ba36f9e212cd53f4e3fdb18bb114f89ffada3f0fbee2b2fd46b6824fccaa68e21d930a SHA512 ff74eae98a44ebfc77a729ee65b4d338fcc39f04f2168247eed039d5c19c945d90c2b6aa5a12ca96d493c5116c2dcf9c959c74ffe2dc25ea6717176f699342b2
28 DIST chromium-profiler-0.2.tar 259952640 BLAKE2B 5e82389fce00b267280d633b26551231c558b80f0c92cd7d60271095a3503365ab673e7a46dc5f74f8a82db1f21262cb24dcc0531d954bab5fb3b175dab3394d SHA512 9fa89a5ab728419683e7495ae676567480987d68a2d589f2aa97bfcbcf123f3c8f97f8bca5f65e5e3f6e41475535add473ded83b9c7a33bb4746a9d05b298a6c
29
30 diff --git a/www-client/chromium/chromium-107.0.5304.110.ebuild b/www-client/chromium/chromium-107.0.5304.110.ebuild
31 deleted file mode 100644
32 index 518cc589dcb4..000000000000
33 --- a/www-client/chromium/chromium-107.0.5304.110.ebuild
34 +++ /dev/null
35 @@ -1,1227 +0,0 @@
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 -PATCHSET_NAME_PPC64="chromium_107.0.5304.68-1raptor1~deb11u1.debian"
57 -SRC_URI="https://commondatastorage.googleapis.com/chromium-browser-official/${P}.tar.xz
58 - https://github.com/stha09/chromium-patches/releases/download/${PATCHSET_NAME}/${PATCHSET_NAME}.tar.xz
59 - ppc64? ( https://quickbuild.io/~raptor-engineering-public/+archive/ubuntu/chromium/+files/${PATCHSET_NAME_PPC64}.tar.xz )
60 - pgo? ( https://github.com/elkablo/chromium-profiler/releases/download/v0.2/chromium-profiler-0.2.tar )"
61 -
62 -LICENSE="BSD"
63 -SLOT="0/stable"
64 -KEYWORDS="~amd64 ~arm64 ~ppc64"
65 -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"
66 -REQUIRED_USE="
67 - component-build? ( !suid !libcxx )
68 - screencast? ( wayland )
69 - !headless? ( || ( X wayland ) )
70 - pgo? ( X !wayland )
71 -"
72 -
73 -COMMON_X_DEPEND="
74 - x11-libs/libXcomposite:=
75 - x11-libs/libXcursor:=
76 - x11-libs/libXdamage:=
77 - x11-libs/libXfixes:=
78 - >=x11-libs/libXi-1.6.0:=
79 - x11-libs/libXrandr:=
80 - x11-libs/libXrender:=
81 - x11-libs/libXtst:=
82 - x11-libs/libxshmfence:=
83 -"
84 -
85 -COMMON_SNAPSHOT_DEPEND="
86 - system-icu? ( >=dev-libs/icu-71.1:= )
87 - >=dev-libs/libxml2-2.9.4-r3:=[icu]
88 - dev-libs/nspr:=
89 - >=dev-libs/nss-3.26:=
90 - !libcxx? ( >=dev-libs/re2-0.2019.08.01:= )
91 - dev-libs/libxslt:=
92 - media-libs/fontconfig:=
93 - >=media-libs/freetype-2.11.0-r1:=
94 - system-harfbuzz? ( >=media-libs/harfbuzz-3:0=[icu(-)] )
95 - media-libs/libjpeg-turbo:=
96 - system-png? ( media-libs/libpng:=[-apng(-)] )
97 - >=media-libs/libwebp-0.4.0:=
98 - media-libs/mesa:=[gbm(+)]
99 - >=media-libs/openh264-1.6.0:=
100 - system-av1? (
101 - >=media-libs/dav1d-1.0.0:=
102 - >=media-libs/libaom-3.4.0:=
103 - )
104 - sys-libs/zlib:=
105 - x11-libs/libdrm:=
106 - !headless? (
107 - dev-libs/glib:2
108 - >=media-libs/alsa-lib-1.0.19:=
109 - pulseaudio? ( media-sound/pulseaudio:= )
110 - sys-apps/pciutils:=
111 - kerberos? ( virtual/krb5 )
112 - vaapi? ( >=media-libs/libva-2.7:=[X?,wayland?] )
113 - X? (
114 - x11-libs/libX11:=
115 - x11-libs/libXext:=
116 - x11-libs/libxcb:=
117 - )
118 - x11-libs/libxkbcommon:=
119 - wayland? (
120 - dev-libs/wayland:=
121 - screencast? ( media-video/pipewire:= )
122 - )
123 - )
124 -"
125 -
126 -COMMON_DEPEND="
127 - ${COMMON_SNAPSHOT_DEPEND}
128 - app-arch/bzip2:=
129 - dev-libs/expat:=
130 - system-ffmpeg? (
131 - >=media-video/ffmpeg-4.3:=
132 - || (
133 - media-video/ffmpeg[-samba]
134 - >=net-fs/samba-4.5.10-r1[-debug(-)]
135 - )
136 - >=media-libs/opus-1.3.1:=
137 - )
138 - net-misc/curl[ssl]
139 - sys-apps/dbus:=
140 - media-libs/flac:=
141 - sys-libs/zlib:=[minizip]
142 - !headless? (
143 - X? ( ${COMMON_X_DEPEND} )
144 - || (
145 - >=app-accessibility/at-spi2-core-2.46.0:2
146 - ( app-accessibility/at-spi2-atk dev-libs/atk )
147 - )
148 - media-libs/mesa:=[X?,wayland?]
149 - cups? ( >=net-print/cups-1.3.11:= )
150 - virtual/udev
151 - x11-libs/cairo:=
152 - x11-libs/gdk-pixbuf:2
153 - x11-libs/pango:=
154 - qt5? (
155 - dev-qt/qtcore:5
156 - dev-qt/qtwidgets:5
157 - )
158 - )
159 -"
160 -RDEPEND="${COMMON_DEPEND}
161 - !headless? (
162 - || (
163 - x11-libs/gtk+:3[X?,wayland?]
164 - gui-libs/gtk:4[X?,wayland?]
165 - )
166 - x11-misc/xdg-utils
167 - )
168 - virtual/ttf-fonts
169 - selinux? ( sec-policy/selinux-chromium )
170 -"
171 -DEPEND="${COMMON_DEPEND}
172 - !headless? (
173 - gtk4? ( gui-libs/gtk:4[X?,wayland?] )
174 - !gtk4? ( x11-libs/gtk+:3[X?,wayland?] )
175 - )
176 -"
177 -
178 -depend_clang_llvm_version() {
179 - echo "sys-devel/clang:$1"
180 - echo "sys-devel/llvm:$1"
181 - echo "=sys-devel/lld-$1*"
182 -}
183 -
184 -depend_clang_llvm_versions() {
185 - local _v
186 - if [[ $# -gt 1 ]]; then
187 - echo "|| ("
188 - for _v in "$@"; do
189 - echo "("
190 - depend_clang_llvm_version "${_v}"
191 - echo ")"
192 - done
193 - echo ")"
194 - elif [[ $# -eq 1 ]]; then
195 - depend_clang_llvm_version "$1"
196 - fi
197 -}
198 -
199 -BDEPEND="
200 - ${COMMON_SNAPSHOT_DEPEND}
201 - ${PYTHON_DEPS}
202 - $(python_gen_any_dep '
203 - dev-python/setuptools[${PYTHON_USEDEP}]
204 - ')
205 - >=app-arch/gzip-1.7
206 - libcxx? ( >=sys-devel/clang-12 )
207 - lto? ( $(depend_clang_llvm_versions 13 14 15) )
208 - pgo? (
209 - >=dev-python/selenium-3.141.0
210 - >=dev-util/web_page_replay_go-20220314
211 - $(depend_clang_llvm_versions 13 14 15)
212 - )
213 - dev-lang/perl
214 - >=dev-util/gn-0.1807
215 - >=dev-util/gperf-3.0.3
216 - >=dev-util/ninja-1.7.2
217 - dev-vcs/git
218 - >=net-libs/nodejs-7.6.0[inspector]
219 - >=sys-devel/bison-2.4.3
220 - sys-devel/flex
221 - virtual/pkgconfig
222 - js-type-check? ( virtual/jre )
223 -"
224 -
225 -# These are intended for ebuild maintainer use to force clang if GCC is broken.
226 -: ${CHROMIUM_FORCE_CLANG=no}
227 -
228 -if [[ ${CHROMIUM_FORCE_CLANG} == yes ]]; then
229 - BDEPEND+=" >=sys-devel/clang-12"
230 -fi
231 -
232 -if ! has chromium_pkg_die ${EBUILD_DEATH_HOOKS}; then
233 - EBUILD_DEATH_HOOKS+=" chromium_pkg_die";
234 -fi
235 -
236 -DISABLE_AUTOFORMATTING="yes"
237 -DOC_CONTENTS="
238 -Some web pages may require additional fonts to display properly.
239 -Try installing some of the following packages if some characters
240 -are not displayed properly:
241 -- media-fonts/arphicfonts
242 -- media-fonts/droid
243 -- media-fonts/ipamonafont
244 -- media-fonts/noto
245 -- media-fonts/ja-ipafonts
246 -- media-fonts/takao-fonts
247 -- media-fonts/wqy-microhei
248 -- media-fonts/wqy-zenhei
249 -
250 -To fix broken icons on the Downloads page, you should install an icon
251 -theme that covers the appropriate MIME types, and configure this as your
252 -GTK+ icon theme.
253 -
254 -For native file dialogs in KDE, install kde-apps/kdialog.
255 -
256 -To make password storage work with your desktop environment you may
257 -have install one of the supported credentials management applications:
258 -- app-crypt/libsecret (GNOME)
259 -- kde-frameworks/kwallet (KDE)
260 -If you have one of above packages installed, but don't want to use
261 -them in Chromium, then add --password-store=basic to CHROMIUM_FLAGS
262 -in /etc/chromium/default.
263 -"
264 -
265 -python_check_deps() {
266 - python_has_version "dev-python/setuptools[${PYTHON_USEDEP}]"
267 -}
268 -
269 -needs_clang() {
270 - [[ ${CHROMIUM_FORCE_CLANG} == yes ]] || use libcxx || use lto || use pgo
271 -}
272 -
273 -llvm_check_deps() {
274 - if ! has_version -b "sys-devel/clang:${LLVM_SLOT}" ; then
275 - einfo "sys-devel/clang:${LLVM_SLOT} is missing! Cannot use LLVM slot ${LLVM_SLOT} ..." >&2
276 - return 1
277 - fi
278 -
279 - if ( use lto || use pgo ) && ! has_version -b "=sys-devel/lld-${LLVM_SLOT}*" ; then
280 - einfo "=sys-devel/lld-${LLVM_SLOT}* is missing! Cannot use LLVM slot ${LLVM_SLOT} ..." >&2
281 - return 1
282 - fi
283 -
284 - einfo "Using LLVM slot ${LLVM_SLOT} to build" >&2
285 -}
286 -
287 -pre_build_checks() {
288 - if [[ ${MERGE_TYPE} != binary ]]; then
289 - [[ ${EBUILD_PHASE_FUNC} == pkg_setup ]] && ( use lto || use pgo ) && llvm_pkg_setup
290 -
291 - local -x CPP="$(tc-getCXX) -E"
292 - if tc-is-gcc && ! ver_test "$(gcc-version)" -ge 9.2; then
293 - die "At least gcc 9.2 is required"
294 - fi
295 - if use pgo && tc-is-cross-compiler; then
296 - die "The pgo USE flag cannot be used when cross-compiling"
297 - fi
298 - if needs_clang || tc-is-clang; then
299 - tc-is-cross-compiler && CPP=${CBUILD}-clang++ || CPP=${CHOST}-clang++
300 - CPP+=" -E"
301 - if ! ver_test "$(clang-major-version)" -ge 12; then
302 - die "At least clang 12 is required"
303 - fi
304 - fi
305 - if [[ ${EBUILD_PHASE_FUNC} == pkg_setup ]] && use js-type-check; then
306 - "${BROOT}"/usr/bin/java -version 2>1 > /dev/null || die "Java VM not setup correctly"
307 - fi
308 - fi
309 -
310 - # Check build requirements, bug #541816 and bug #471810 .
311 - CHECKREQS_MEMORY="4G"
312 - CHECKREQS_DISK_BUILD="12G"
313 - tc-is-cross-compiler && CHECKREQS_DISK_BUILD="14G"
314 - if use lto || use pgo; then
315 - CHECKREQS_MEMORY="9G"
316 - CHECKREQS_DISK_BUILD="13G"
317 - tc-is-cross-compiler && CHECKREQS_DISK_BUILD="16G"
318 - use pgo && CHECKREQS_DISK_BUILD="20G"
319 - fi
320 - if is-flagq '-g?(gdb)?([1-9])'; then
321 - if use custom-cflags || use component-build; then
322 - CHECKREQS_DISK_BUILD="25G"
323 - fi
324 - if ! use component-build; then
325 - CHECKREQS_MEMORY="16G"
326 - fi
327 - fi
328 - check-reqs_${EBUILD_PHASE_FUNC}
329 -}
330 -
331 -pkg_pretend() {
332 - pre_build_checks
333 -
334 - if use headless; then
335 - local headless_unused_flags=("cups" "kerberos" "pulseaudio" "vaapi" "wayland")
336 - for myiuse in ${headless_unused_flags[@]}; do
337 - use ${myiuse} && ewarn "Ignoring USE=${myiuse} since USE=headless is set."
338 - done
339 - fi
340 -}
341 -
342 -pkg_setup() {
343 - pre_build_checks
344 -
345 - chromium_suid_sandbox_check_kernel_config
346 -
347 - # nvidia-drivers does not work correctly with Wayland due to unsupported EGLStreams
348 - if use wayland && ! use headless && has_version "x11-drivers/nvidia-drivers"; then
349 - ewarn "Proprietary nVidia driver does not work with Wayland. You can disable"
350 - ewarn "Wayland by setting DISABLE_OZONE_PLATFORM=true in /etc/chromium/default."
351 - fi
352 -}
353 -
354 -src_prepare() {
355 - # Calling this here supports resumption via FEATURES=keepwork
356 - python_setup
357 -
358 - local PATCHES=(
359 - "${WORKDIR}/patches"
360 - "${FILESDIR}/chromium-93-InkDropHost-crash.patch"
361 - "${FILESDIR}/chromium-98-EnumTable-crash.patch"
362 - "${FILESDIR}/chromium-98-gtk4-build.patch"
363 - "${FILESDIR}/chromium-105-swiftshader-no-wayland.patch"
364 - "${FILESDIR}/chromium-106-revert-GlobalMediaControlsCastStartStop.patch"
365 - "${FILESDIR}/chromium-107-system-zlib.patch"
366 - "${FILESDIR}/chromium-use-oauth2-client-switches-as-default.patch"
367 - "${FILESDIR}/chromium-shim_headers.patch"
368 - "${FILESDIR}/chromium-cross-compile.patch"
369 - )
370 -
371 - if use ppc64 ; then
372 - local p
373 - for p in $(grep -v "^#" "${WORKDIR}"/debian/patches/series | grep "^ppc64le" || die); do
374 - if [[ $p =~ "fix-breakpad-compile.patch" ]]; then
375 - eapply "${FILESDIR}/ppc64le/fix-breakpad-compile.patch"
376 - else
377 - eapply "${WORKDIR}/debian/patches/${p}"
378 - fi
379 - done
380 - eapply "${FILESDIR}/ppc64le/libpng-pdfium-compile-98.patch"
381 - eapply "${FILESDIR}/ppc64le/fix-swiftshader-compile.patch"
382 - fi
383 -
384 - default
385 -
386 - mkdir -p third_party/node/linux/node-linux-x64/bin || die
387 - ln -s "${EPREFIX}"/usr/bin/node third_party/node/linux/node-linux-x64/bin/node || die
388 -
389 - # adjust python interpreter version
390 - sed -i -e "s|\(^script_executable = \).*|\1\"${EPYTHON}\"|g" .gn || die
391 -
392 - local keeplibs=(
393 - base/third_party/cityhash
394 - base/third_party/double_conversion
395 - base/third_party/dynamic_annotations
396 - base/third_party/icu
397 - base/third_party/nspr
398 - base/third_party/superfasthash
399 - base/third_party/symbolize
400 - base/third_party/valgrind
401 - base/third_party/xdg_mime
402 - base/third_party/xdg_user_dirs
403 - buildtools/third_party/libc++
404 - buildtools/third_party/libc++abi
405 - chrome/third_party/mozilla_security_manager
406 - courgette/third_party
407 - net/third_party/mozilla_security_manager
408 - net/third_party/nss
409 - net/third_party/quic
410 - net/third_party/uri_template
411 - third_party/abseil-cpp
412 - third_party/angle
413 - third_party/angle/src/common/third_party/base
414 - third_party/angle/src/common/third_party/smhasher
415 - third_party/angle/src/common/third_party/xxhash
416 - third_party/angle/src/third_party/libXNVCtrl
417 - third_party/angle/src/third_party/trace_event
418 - third_party/angle/src/third_party/volk
419 - third_party/apple_apsl
420 - third_party/axe-core
421 - third_party/blink
422 - third_party/bidimapper
423 - third_party/boringssl
424 - third_party/boringssl/src/third_party/fiat
425 - third_party/breakpad
426 - third_party/breakpad/breakpad/src/third_party/curl
427 - third_party/brotli
428 - third_party/catapult
429 - third_party/catapult/common/py_vulcanize/third_party/rcssmin
430 - third_party/catapult/common/py_vulcanize/third_party/rjsmin
431 - third_party/catapult/third_party/beautifulsoup4-4.9.3
432 - third_party/catapult/third_party/html5lib-1.1
433 - third_party/catapult/third_party/polymer
434 - third_party/catapult/third_party/six
435 - third_party/catapult/tracing/third_party/d3
436 - third_party/catapult/tracing/third_party/gl-matrix
437 - third_party/catapult/tracing/third_party/jpeg-js
438 - third_party/catapult/tracing/third_party/jszip
439 - third_party/catapult/tracing/third_party/mannwhitneyu
440 - third_party/catapult/tracing/third_party/oboe
441 - third_party/catapult/tracing/third_party/pako
442 - third_party/ced
443 - third_party/cld_3
444 - third_party/closure_compiler
445 - third_party/content_analysis_sdk
446 - third_party/cpuinfo
447 - third_party/crashpad
448 - third_party/crashpad/crashpad/third_party/lss
449 - third_party/crashpad/crashpad/third_party/zlib
450 - third_party/crc32c
451 - third_party/cros_system_api
452 - third_party/dawn
453 - third_party/dawn/third_party/gn/webgpu-cts
454 - third_party/dawn/third_party/khronos
455 - third_party/depot_tools
456 - third_party/devscripts
457 - third_party/devtools-frontend
458 - third_party/devtools-frontend/src/front_end/third_party/acorn
459 - third_party/devtools-frontend/src/front_end/third_party/additional_readme_paths.json
460 - third_party/devtools-frontend/src/front_end/third_party/axe-core
461 - third_party/devtools-frontend/src/front_end/third_party/chromium
462 - third_party/devtools-frontend/src/front_end/third_party/codemirror
463 - third_party/devtools-frontend/src/front_end/third_party/diff
464 - third_party/devtools-frontend/src/front_end/third_party/i18n
465 - third_party/devtools-frontend/src/front_end/third_party/intl-messageformat
466 - third_party/devtools-frontend/src/front_end/third_party/lighthouse
467 - third_party/devtools-frontend/src/front_end/third_party/lit-html
468 - third_party/devtools-frontend/src/front_end/third_party/lodash-isequal
469 - third_party/devtools-frontend/src/front_end/third_party/marked
470 - third_party/devtools-frontend/src/front_end/third_party/puppeteer
471 - third_party/devtools-frontend/src/front_end/third_party/wasmparser
472 - third_party/devtools-frontend/src/test/unittests/front_end/third_party/i18n
473 - third_party/devtools-frontend/src/third_party
474 - third_party/distributed_point_functions
475 - third_party/dom_distiller_js
476 - third_party/eigen3
477 - third_party/emoji-segmenter
478 - third_party/farmhash
479 - third_party/fdlibm
480 - third_party/fft2d
481 - third_party/flatbuffers
482 - third_party/fp16
483 - third_party/freetype
484 - third_party/fusejs
485 - third_party/fxdiv
486 - third_party/highway
487 - third_party/libgifcodec
488 - third_party/liburlpattern
489 - third_party/libzip
490 - third_party/gemmlowp
491 - third_party/google_input_tools
492 - third_party/google_input_tools/third_party/closure_library
493 - third_party/google_input_tools/third_party/closure_library/third_party/closure
494 - third_party/googletest
495 - third_party/hunspell
496 - third_party/iccjpeg
497 - third_party/inspector_protocol
498 - third_party/ipcz
499 - third_party/jinja2
500 - third_party/jsoncpp
501 - third_party/jstemplate
502 - third_party/khronos
503 - third_party/leveldatabase
504 - third_party/libaddressinput
505 - third_party/libavif
506 - third_party/libevent
507 - third_party/libgav1
508 - third_party/libjingle
509 - third_party/libjxl
510 - third_party/libphonenumber
511 - third_party/libsecret
512 - third_party/libsrtp
513 - third_party/libsync
514 - third_party/libudev
515 - third_party/libva_protected_content
516 - third_party/libvpx
517 - third_party/libvpx/source/libvpx/third_party/x86inc
518 - third_party/libwebm
519 - third_party/libx11
520 - third_party/libxcb-keysyms
521 - third_party/libxml/chromium
522 - third_party/libyuv
523 - third_party/llvm
524 - third_party/lottie
525 - third_party/lss
526 - third_party/lzma_sdk
527 - third_party/mako
528 - third_party/maldoca
529 - third_party/maldoca/src/third_party/tensorflow_protos
530 - third_party/maldoca/src/third_party/zlibwrapper
531 - third_party/markupsafe
532 - third_party/mesa
533 - third_party/metrics_proto
534 - third_party/minigbm
535 - third_party/modp_b64
536 - third_party/nasm
537 - third_party/nearby
538 - third_party/neon_2_sse
539 - third_party/node
540 - third_party/omnibox_proto
541 - third_party/one_euro_filter
542 - third_party/openscreen
543 - third_party/openscreen/src/third_party/mozilla
544 - third_party/openscreen/src/third_party/tinycbor/src/src
545 - third_party/ots
546 - third_party/pdfium
547 - third_party/pdfium/third_party/agg23
548 - third_party/pdfium/third_party/base
549 - third_party/pdfium/third_party/bigint
550 - third_party/pdfium/third_party/freetype
551 - third_party/pdfium/third_party/lcms
552 - third_party/pdfium/third_party/libopenjpeg
553 - third_party/pdfium/third_party/libpng16
554 - third_party/pdfium/third_party/libtiff
555 - third_party/pdfium/third_party/skia_shared
556 - third_party/perfetto
557 - third_party/perfetto/protos/third_party/chromium
558 - third_party/pffft
559 - third_party/ply
560 - third_party/polymer
561 - third_party/private-join-and-compute
562 - third_party/private_membership
563 - third_party/protobuf
564 - third_party/protobuf/third_party/six
565 - third_party/pthreadpool
566 - third_party/pyjson5
567 - third_party/qcms
568 - third_party/rnnoise
569 - third_party/s2cellid
570 - third_party/securemessage
571 - third_party/shell-encryption
572 - third_party/simplejson
573 - third_party/skia
574 - third_party/skia/include/third_party/vulkan
575 - third_party/skia/third_party/vulkan
576 - third_party/smhasher
577 - third_party/snappy
578 - third_party/sqlite
579 - third_party/swiftshader
580 - third_party/swiftshader/third_party/astc-encoder
581 - third_party/swiftshader/third_party/llvm-subzero
582 - third_party/swiftshader/third_party/marl
583 - third_party/swiftshader/third_party/subzero
584 - third_party/swiftshader/third_party/SPIRV-Headers/include/spirv
585 - third_party/swiftshader/third_party/SPIRV-Tools
586 - third_party/tensorflow-text
587 - third_party/tflite
588 - third_party/tflite/src/third_party/eigen3
589 - third_party/tflite/src/third_party/fft2d
590 - third_party/ruy
591 - third_party/six
592 - third_party/ukey2
593 - third_party/unrar
594 - third_party/utf
595 - third_party/vulkan
596 - third_party/web-animations-js
597 - third_party/webdriver
598 - third_party/webgpu-cts
599 - third_party/webrtc
600 - third_party/webrtc/common_audio/third_party/ooura
601 - third_party/webrtc/common_audio/third_party/spl_sqrt_floor
602 - third_party/webrtc/modules/third_party/fft
603 - third_party/webrtc/modules/third_party/g711
604 - third_party/webrtc/modules/third_party/g722
605 - third_party/webrtc/rtc_base/third_party/base64
606 - third_party/webrtc/rtc_base/third_party/sigslot
607 - third_party/widevine
608 - third_party/woff2
609 - third_party/wuffs
610 - third_party/x11proto
611 - third_party/xcbproto
612 - third_party/xnnpack
613 - third_party/zxcvbn-cpp
614 - third_party/zlib/google
615 - url/third_party/mozilla
616 - v8/src/third_party/siphash
617 - v8/src/third_party/valgrind
618 - v8/src/third_party/utf8-decoder
619 - v8/third_party/inspector_protocol
620 - v8/third_party/v8
621 -
622 - # gyp -> gn leftovers
623 - third_party/speech-dispatcher
624 - third_party/usb_ids
625 - third_party/xdg-utils
626 - )
627 - if ! use system-ffmpeg; then
628 - keeplibs+=( third_party/ffmpeg third_party/opus )
629 - fi
630 - if ! use system-icu; then
631 - keeplibs+=( third_party/icu )
632 - fi
633 - if ! use system-png; then
634 - keeplibs+=( third_party/libpng )
635 - fi
636 - if ! use system-av1; then
637 - keeplibs+=(
638 - third_party/dav1d
639 - third_party/libaom
640 - third_party/libaom/source/libaom/third_party/fastfeat
641 - third_party/libaom/source/libaom/third_party/vector
642 - third_party/libaom/source/libaom/third_party/x86inc
643 - )
644 - fi
645 - if use libcxx; then
646 - keeplibs+=( third_party/re2 )
647 - fi
648 - if use system-harfbuzz; then
649 - keeplibs+=( third_party/harfbuzz-ng/utils )
650 - else
651 - keeplibs+=( third_party/harfbuzz-ng )
652 - fi
653 - if use wayland && ! use headless ; then
654 - keeplibs+=( third_party/wayland )
655 - # only need the .gn files
656 - rm -r third_party/wayland/src || die
657 - fi
658 - if use arm64 || use ppc64 ; then
659 - keeplibs+=( third_party/swiftshader/third_party/llvm-10.0 )
660 - fi
661 - # we need to generate ppc64 stuff because upstream does not ship it yet
662 - # it has to be done before unbundling.
663 - if use ppc64; then
664 - pushd third_party/libvpx >/dev/null || die
665 - mkdir -p source/config/linux/ppc64 || die
666 - # requires git and clang, bug #832803
667 - sed -i -e "s|^update_readme||g; s|clang-format|${EPREFIX}/bin/true|g" \
668 - generate_gni.sh || die
669 - ./generate_gni.sh || die
670 - popd >/dev/null || die
671 -
672 - pushd third_party/ffmpeg >/dev/null || die
673 - cp libavcodec/ppc/h264dsp.c libavcodec/ppc/h264dsp_ppc.c || die
674 - cp libavcodec/ppc/h264qpel.c libavcodec/ppc/h264qpel_ppc.c || die
675 - popd >/dev/null || die
676 - fi
677 -
678 - # Remove most bundled libraries. Some are still needed.
679 - build/linux/unbundle/remove_bundled_libraries.py "${keeplibs[@]}" --do-remove || die
680 -
681 - if use js-type-check; then
682 - ln -s "${EPREFIX}"/usr/bin/java third_party/jdk/current/bin/java || die
683 - fi
684 -
685 - # bundled eu-strip is for amd64 only and we don't want to pre-stripped binaries
686 - mkdir -p buildtools/third_party/eu-strip/bin || die
687 - ln -s "${EPREFIX}"/bin/true buildtools/third_party/eu-strip/bin/eu-strip || die
688 -}
689 -
690 -chromium_configure() {
691 - # Calling this here supports resumption via FEATURES=keepwork
692 - python_setup
693 -
694 - local myconf_gn=""
695 -
696 - # Make sure the build system will use the right tools, bug #340795.
697 - tc-export AR CC CXX NM
698 -
699 - if needs_clang && ! tc-is-clang; then
700 - # Force clang since gcc is either broken or build is using libcxx.
701 - if tc-is-cross-compiler; then
702 - CC="${CBUILD}-clang -target ${CHOST} --sysroot ${ESYSROOT}"
703 - CXX="${CBUILD}-clang++ -target ${CHOST} --sysroot ${ESYSROOT}"
704 - BUILD_CC=${CBUILD}-clang
705 - BUILD_CXX=${CBUILD}-clang++
706 - else
707 - CC=${CHOST}-clang
708 - CXX=${CHOST}-clang++
709 - fi
710 - strip-unsupported-flags
711 - fi
712 -
713 - if tc-is-clang; then
714 - myconf_gn+=" is_clang=true clang_use_chrome_plugins=false"
715 - else
716 - myconf_gn+=" is_clang=false"
717 - fi
718 -
719 - # Force lld for lto or pgo builds only, otherwise disable, bug 641556
720 - if use lto || use pgo; then
721 - myconf_gn+=" use_lld=true"
722 - else
723 - myconf_gn+=" use_lld=false"
724 - fi
725 -
726 - if use lto || use pgo; then
727 - AR=llvm-ar
728 - NM=llvm-nm
729 - if tc-is-cross-compiler; then
730 - BUILD_AR=llvm-ar
731 - BUILD_NM=llvm-nm
732 - fi
733 - fi
734 -
735 - # Define a custom toolchain for GN
736 - myconf_gn+=" custom_toolchain=\"//build/toolchain/linux/unbundle:default\""
737 -
738 - if tc-is-cross-compiler; then
739 - tc-export BUILD_{AR,CC,CXX,NM}
740 - myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:host\""
741 - myconf_gn+=" v8_snapshot_toolchain=\"//build/toolchain/linux/unbundle:host\""
742 - myconf_gn+=" pkg_config=\"$(tc-getPKG_CONFIG)\""
743 - myconf_gn+=" host_pkg_config=\"$(tc-getBUILD_PKG_CONFIG)\""
744 -
745 - # setup cups-config, build system only uses --libs option
746 - if use cups; then
747 - mkdir "${T}/cups-config" || die
748 - cp "${ESYSROOT}/usr/bin/${CHOST}-cups-config" "${T}/cups-config/cups-config" || die
749 - export PATH="${PATH}:${T}/cups-config"
750 - fi
751 -
752 - # Don't inherit PKG_CONFIG_PATH from environment
753 - local -x PKG_CONFIG_PATH=
754 - else
755 - myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:default\""
756 - fi
757 -
758 - # GN needs explicit config for Debug/Release as opposed to inferring it from build directory.
759 - myconf_gn+=" is_debug=false"
760 -
761 - # enable DCHECK with USE=debug only, increases chrome binary size by 30%, bug #811138.
762 - # DCHECK is fatal by default, make it configurable at runtime, #bug 807881.
763 - myconf_gn+=" dcheck_always_on=$(usex debug true false)"
764 - myconf_gn+=" dcheck_is_configurable=$(usex debug true false)"
765 -
766 - # Component build isn't generally intended for use by end users. It's mostly useful
767 - # for development and debugging.
768 - myconf_gn+=" is_component_build=$(usex component-build true false)"
769 -
770 - # Disable nacl, we can't build without pnacl (http://crbug.com/269560).
771 - myconf_gn+=" enable_nacl=false"
772 -
773 - # Use system-provided libraries.
774 - # TODO: freetype -- remove sources (https://bugs.chromium.org/p/pdfium/issues/detail?id=733).
775 - # TODO: use_system_hunspell (upstream changes needed).
776 - # TODO: use_system_protobuf (bug #525560).
777 - # TODO: use_system_sqlite (http://crbug.com/22208).
778 -
779 - # libevent: https://bugs.gentoo.org/593458
780 - local gn_system_libraries=(
781 - flac
782 - fontconfig
783 - freetype
784 - # Need harfbuzz_from_pkgconfig target
785 - #harfbuzz-ng
786 - libdrm
787 - libjpeg
788 - libwebp
789 - libxml
790 - libxslt
791 - openh264
792 - zlib
793 - )
794 - if use system-ffmpeg; then
795 - gn_system_libraries+=( ffmpeg opus )
796 - fi
797 - if use system-icu; then
798 - gn_system_libraries+=( icu )
799 - fi
800 - if use system-png; then
801 - gn_system_libraries+=( libpng )
802 - fi
803 - if use system-av1; then
804 - gn_system_libraries+=( dav1d libaom )
805 - fi
806 - # re2 library interface relies on std::string and std::vector
807 - if ! use libcxx; then
808 - gn_system_libraries+=( re2 )
809 - fi
810 - build/linux/unbundle/replace_gn_files.py --system-libraries "${gn_system_libraries[@]}" || die
811 -
812 - # See dependency logic in third_party/BUILD.gn
813 - myconf_gn+=" use_system_harfbuzz=$(usex system-harfbuzz true false)"
814 -
815 - # Disable deprecated libgnome-keyring dependency, bug #713012
816 - myconf_gn+=" use_gnome_keyring=false"
817 -
818 - # Optional dependencies.
819 - myconf_gn+=" enable_js_type_check=$(usex js-type-check true false)"
820 - myconf_gn+=" enable_hangout_services_extension=$(usex hangouts true false)"
821 - myconf_gn+=" enable_widevine=$(usex widevine true false)"
822 -
823 - if use headless; then
824 - myconf_gn+=" use_cups=false"
825 - myconf_gn+=" use_kerberos=false"
826 - myconf_gn+=" use_pulseaudio=false"
827 - myconf_gn+=" use_vaapi=false"
828 - myconf_gn+=" rtc_use_pipewire=false"
829 - else
830 - myconf_gn+=" use_cups=$(usex cups true false)"
831 - myconf_gn+=" use_kerberos=$(usex kerberos true false)"
832 - myconf_gn+=" use_pulseaudio=$(usex pulseaudio true false)"
833 - myconf_gn+=" use_vaapi=$(usex vaapi true false)"
834 - myconf_gn+=" rtc_use_pipewire=$(usex screencast true false)"
835 - myconf_gn+=" gtk_version=$(usex gtk4 4 3)"
836 - fi
837 -
838 - # TODO: link_pulseaudio=true for GN.
839 -
840 - myconf_gn+=" disable_fieldtrial_testing_config=true"
841 -
842 - # Never use bundled gold binary. Disable gold linker flags for now.
843 - # Do not use bundled clang.
844 - # Trying to use gold results in linker crash.
845 - myconf_gn+=" use_gold=false use_sysroot=false"
846 - myconf_gn+=" use_custom_libcxx=$(usex libcxx true false)"
847 -
848 - # Disable pseudolocales, only used for testing
849 - myconf_gn+=" enable_pseudolocales=false"
850 -
851 - # Disable code formating of generated files
852 - myconf_gn+=" blink_enable_generated_code_formatting=false"
853 -
854 - ffmpeg_branding="$(usex proprietary-codecs Chrome Chromium)"
855 - myconf_gn+=" proprietary_codecs=$(usex proprietary-codecs true false)"
856 - myconf_gn+=" ffmpeg_branding=\"${ffmpeg_branding}\""
857 -
858 - # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys .
859 - # Note: these are for Gentoo use ONLY. For your own distribution,
860 - # please get your own set of keys. Feel free to contact chromium@g.o
861 - # for more info. The OAuth2 credentials, however, have been left out.
862 - # Those OAuth2 credentials have been broken for quite some time anyway.
863 - # Instead we apply a patch to use the --oauth2-client-id= and
864 - # --oauth2-client-secret= switches for setting GOOGLE_DEFAULT_CLIENT_ID and
865 - # GOOGLE_DEFAULT_CLIENT_SECRET at runtime. This allows signing into
866 - # Chromium without baked-in values.
867 - local google_api_key="AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc"
868 - myconf_gn+=" google_api_key=\"${google_api_key}\""
869 - local myarch="$(tc-arch)"
870 -
871 - # Avoid CFLAGS problems, bug #352457, bug #390147.
872 - if ! use custom-cflags; then
873 - replace-flags "-Os" "-O2"
874 - strip-flags
875 -
876 - # Debug info section overflows without component build
877 - # Prevent linker from running out of address space, bug #471810 .
878 - if ! use component-build || use x86; then
879 - filter-flags "-g*"
880 - fi
881 -
882 - # Prevent libvpx/xnnpack build failures. Bug 530248, 544702, 546984, 853646.
883 - if [[ ${myarch} == amd64 || ${myarch} == x86 ]]; then
884 - filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 -mno-avx -mno-avx2 -mno-fma -mno-fma4 -mno-xop -mno-sse4a
885 - fi
886 - fi
887 -
888 - if [[ $myarch = amd64 ]] ; then
889 - myconf_gn+=" target_cpu=\"x64\""
890 - ffmpeg_target_arch=x64
891 - elif [[ $myarch = x86 ]] ; then
892 - myconf_gn+=" target_cpu=\"x86\""
893 - ffmpeg_target_arch=ia32
894 -
895 - # This is normally defined by compiler_cpu_abi in
896 - # build/config/compiler/BUILD.gn, but we patch that part out.
897 - append-flags -msse2 -mfpmath=sse -mmmx
898 - elif [[ $myarch = arm64 ]] ; then
899 - myconf_gn+=" target_cpu=\"arm64\""
900 - ffmpeg_target_arch=arm64
901 - elif [[ $myarch = arm ]] ; then
902 - myconf_gn+=" target_cpu=\"arm\""
903 - ffmpeg_target_arch=$(usex cpu_flags_arm_neon arm-neon arm)
904 - elif [[ $myarch = ppc64 ]] ; then
905 - myconf_gn+=" target_cpu=\"ppc64\""
906 - ffmpeg_target_arch=ppc64
907 - else
908 - die "Failed to determine target arch, got '$myarch'."
909 - fi
910 -
911 - # Make sure that -Werror doesn't get added to CFLAGS by the build system.
912 - # Depending on GCC version the warnings are different and we don't want
913 - # the build to fail because of that.
914 - myconf_gn+=" treat_warnings_as_errors=false"
915 -
916 - # Disable fatal linker warnings, bug 506268.
917 - myconf_gn+=" fatal_linker_warnings=false"
918 -
919 - # Disable external code space for V8 for ppc64. It is disabled for ppc64
920 - # by default, but cross-compiling on amd64 enables it again.
921 - if tc-is-cross-compiler; then
922 - if ! use amd64 && ! use arm64; then
923 - myconf_gn+=" v8_enable_external_code_space=false"
924 - fi
925 - fi
926 -
927 - # Bug 491582.
928 - export TMPDIR="${WORKDIR}/temp"
929 - mkdir -p -m 755 "${TMPDIR}" || die
930 -
931 - # https://bugs.gentoo.org/654216
932 - addpredict /dev/dri/ #nowarn
933 -
934 - #if ! use system-ffmpeg; then
935 - if false; then
936 - local build_ffmpeg_args=""
937 - if use pic && [[ "${ffmpeg_target_arch}" == "ia32" ]]; then
938 - build_ffmpeg_args+=" --disable-asm"
939 - fi
940 -
941 - # Re-configure bundled ffmpeg. See bug #491378 for example reasons.
942 - einfo "Configuring bundled ffmpeg..."
943 - pushd third_party/ffmpeg > /dev/null || die
944 - chromium/scripts/build_ffmpeg.py linux ${ffmpeg_target_arch} \
945 - --branding ${ffmpeg_branding} -- ${build_ffmpeg_args} || die
946 - chromium/scripts/copy_config.sh || die
947 - chromium/scripts/generate_gn.py || die
948 - popd > /dev/null || die
949 - fi
950 -
951 - # Disable unknown warning message from clang.
952 - if tc-is-clang; then
953 - append-flags -Wno-unknown-warning-option
954 - if tc-is-cross-compiler; then
955 - export BUILD_CXXFLAGS+=" -Wno-unknown-warning-option"
956 - export BUILD_CFLAGS+=" -Wno-unknown-warning-option"
957 - fi
958 - fi
959 -
960 - # Explicitly disable ICU data file support for system-icu/headless builds.
961 - if use system-icu || use headless; then
962 - myconf_gn+=" icu_use_data_file=false"
963 - fi
964 -
965 - # Enable ozone wayland and/or headless support
966 - myconf_gn+=" use_ozone=true ozone_auto_platforms=false"
967 - myconf_gn+=" ozone_platform_headless=true"
968 - if use headless; then
969 - myconf_gn+=" ozone_platform=\"headless\""
970 - myconf_gn+=" use_xkbcommon=false use_gtk=false use_qt=false"
971 - myconf_gn+=" use_glib=false use_gio=false"
972 - myconf_gn+=" use_pangocairo=false use_alsa=false"
973 - myconf_gn+=" use_libpci=false use_udev=false"
974 - myconf_gn+=" enable_print_preview=false"
975 - myconf_gn+=" enable_remoting=false"
976 - else
977 - myconf_gn+=" use_system_libdrm=true"
978 - myconf_gn+=" use_system_minigbm=true"
979 - myconf_gn+=" use_xkbcommon=true"
980 - myconf_gn+=" use_qt=$(usex qt5 true false)"
981 - myconf_gn+=" ozone_platform_x11=$(usex X true false)"
982 - myconf_gn+=" ozone_platform_wayland=$(usex wayland true false)"
983 - myconf_gn+=" ozone_platform=$(usex wayland \"wayland\" \"x11\")"
984 - if use wayland; then
985 - myconf_gn+=" use_system_libwayland_server=true"
986 - myconf_gn+=" use_system_wayland_scanner=true"
987 - fi
988 - fi
989 -
990 - # Results in undefined references in chrome linking, may require CFI to work
991 - if use arm64; then
992 - myconf_gn+=" arm_control_flow_integrity=\"none\""
993 - fi
994 -
995 - # Enable official builds
996 - myconf_gn+=" is_official_build=$(usex official true false)"
997 - myconf_gn+=" use_thin_lto=$(usex lto true false)"
998 - myconf_gn+=" thin_lto_enable_optimizations=$(usex lto true false)"
999 - if use official; then
1000 - # Allow building against system libraries in official builds
1001 - sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \
1002 - tools/generate_shim_headers/generate_shim_headers.py || die
1003 - # Disable CFI: unsupported for GCC, requires clang+lto+lld
1004 - myconf_gn+=" is_cfi=false"
1005 - # Don't add symbols to build
1006 - myconf_gn+=" symbol_level=0"
1007 - fi
1008 -
1009 - if use pgo; then
1010 - myconf_gn+=" chrome_pgo_phase=${1}"
1011 - if [[ "$1" == "2" ]]; then
1012 - myconf_gn+=" pgo_data_path=\"${2}\""
1013 - fi
1014 - else
1015 - # Disable PGO, because profile data is only compatible with >=clang-11
1016 - myconf_gn+=" chrome_pgo_phase=0"
1017 - fi
1018 -
1019 - # user CXXFLAGS might overwrite -march=armv8-a+crc+crypto, bug #851639
1020 - if use arm64 && tc-is-gcc; then
1021 - sed -i '/^#if HAVE_ARM64_CRC32C/a #pragma GCC target ("+crc+crypto")' \
1022 - third_party/crc32c/src/src/crc32c_arm64.cc || die
1023 - fi
1024 -
1025 - # skipping typecheck is only supported on amd64, bug #876157
1026 - if ! use amd64; then
1027 - myconf_gn+=" devtools_skip_typecheck=false"
1028 - fi
1029 -
1030 - einfo "Configuring Chromium..."
1031 - set -- gn gen --args="${myconf_gn} ${EXTRA_GN}" out/Release
1032 - echo "$@"
1033 - "$@" || die
1034 -}
1035 -
1036 -src_configure() {
1037 - chromium_configure $(usex pgo 1 0)
1038 -}
1039 -
1040 -chromium_compile() {
1041 - # Final link uses lots of file descriptors.
1042 - ulimit -n 2048
1043 -
1044 - # Calling this here supports resumption via FEATURES=keepwork
1045 - python_setup
1046 -
1047 - # Don't inherit PYTHONPATH from environment, bug #789021, #812689
1048 - local -x PYTHONPATH=
1049 -
1050 - #"${EPYTHON}" tools/clang/scripts/update.py --force-local-build --gcc-toolchain /usr --skip-checkout --use-system-cmake --without-android || die
1051 -
1052 - # Build mksnapshot and pax-mark it.
1053 - local x
1054 - for x in mksnapshot v8_context_snapshot_generator; do
1055 - if tc-is-cross-compiler; then
1056 - eninja -C out/Release "host/${x}"
1057 - pax-mark m "out/Release/host/${x}"
1058 - else
1059 - eninja -C out/Release "${x}"
1060 - pax-mark m "out/Release/${x}"
1061 - fi
1062 - done
1063 -
1064 - # Even though ninja autodetects number of CPUs, we respect
1065 - # user's options, for debugging with -j 1 or any other reason.
1066 - eninja -C out/Release chrome chromedriver
1067 - use suid && eninja -C out/Release chrome_sandbox
1068 -
1069 - pax-mark m out/Release/chrome
1070 -}
1071 -
1072 -# This function is called from virtx, and must always return so that Xvfb
1073 -# session isn't left running. If we return 1, virtx will call die().
1074 -chromium_profile() {
1075 - einfo "Profiling for PGO"
1076 -
1077 - pushd "${WORKDIR}/chromium-profiler-"* >/dev/null || return 1
1078 -
1079 - # Remove old profdata in case profiling was interrupted.
1080 - rm -rf "${1}" || return 1
1081 -
1082 - if ! "${EPYTHON}" ./chromium_profiler.py \
1083 - --chrome-executable "${S}/out/Release/chrome" \
1084 - --chromedriver-executable "${S}/out/Release/chromedriver.unstripped" \
1085 - --add-arg no-sandbox --add-arg disable-dev-shm-usage \
1086 - --profile-output "${1}"; then
1087 - eerror "Profiling failed"
1088 - return 1
1089 - fi
1090 -
1091 - popd >/dev/null || return 1
1092 -}
1093 -
1094 -src_compile() {
1095 - if use pgo; then
1096 - local profdata
1097 -
1098 - profdata="${WORKDIR}/chromium.profdata"
1099 -
1100 - if [[ ! -e "${WORKDIR}/.pgo-profiled" ]]; then
1101 - chromium_compile
1102 - virtx chromium_profile "$profdata"
1103 -
1104 - touch "${WORKDIR}/.pgo-profiled" || die
1105 - fi
1106 -
1107 - if [[ ! -e "${WORKDIR}/.pgo-phase-2-configured" ]]; then
1108 - # Remove phase 1 output
1109 - rm -r out/Release || die
1110 -
1111 - chromium_configure 2 "$profdata"
1112 -
1113 - touch "${WORKDIR}/.pgo-phase-2-configured" || die
1114 - fi
1115 -
1116 - if [[ ! -e "${WORKDIR}/.pgo-phase-2-compiled" ]]; then
1117 - chromium_compile
1118 - touch "${WORKDIR}/.pgo-phase-2-compiled" || die
1119 - fi
1120 - else
1121 - chromium_compile
1122 - fi
1123 -
1124 - mv out/Release/chromedriver{.unstripped,} || die
1125 -
1126 - # Build manpage; bug #684550
1127 - sed -e 's|@@PACKAGE@@|chromium-browser|g;
1128 - s|@@MENUNAME@@|Chromium|g;' \
1129 - chrome/app/resources/manpage.1.in > \
1130 - out/Release/chromium-browser.1 || die
1131 -
1132 - # Build desktop file; bug #706786
1133 - sed -e 's|@@MENUNAME@@|Chromium|g;
1134 - s|@@USR_BIN_SYMLINK_NAME@@|chromium-browser|g;
1135 - s|@@PACKAGE@@|chromium-browser|g;
1136 - s|\(^Exec=\)/usr/bin/|\1|g;' \
1137 - chrome/installer/linux/common/desktop.template > \
1138 - out/Release/chromium-browser-chromium.desktop || die
1139 -
1140 - # Build vk_swiftshader_icd.json; bug #827861
1141 - sed -e 's|${ICD_LIBRARY_PATH}|./libvk_swiftshader.so|g' \
1142 - third_party/swiftshader/src/Vulkan/vk_swiftshader_icd.json.tmpl > \
1143 - out/Release/vk_swiftshader_icd.json || die
1144 -}
1145 -
1146 -src_install() {
1147 - local CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser"
1148 - exeinto "${CHROMIUM_HOME}"
1149 - doexe out/Release/chrome
1150 -
1151 - if use suid; then
1152 - newexe out/Release/chrome_sandbox chrome-sandbox
1153 - fperms 4755 "${CHROMIUM_HOME}/chrome-sandbox"
1154 - fi
1155 -
1156 - doexe out/Release/chromedriver
1157 - doexe out/Release/chrome_crashpad_handler
1158 -
1159 - ozone_auto_session () {
1160 - use X && use wayland && ! use headless && echo true || echo false
1161 - }
1162 - local sedargs=( -e
1163 - "s:/usr/lib/:/usr/$(get_libdir)/:g;
1164 - s:@@OZONE_AUTO_SESSION@@:$(ozone_auto_session):g"
1165 - )
1166 - sed "${sedargs[@]}" "${FILESDIR}/chromium-launcher-r7.sh" > chromium-launcher.sh || die
1167 - doexe chromium-launcher.sh
1168 -
1169 - # It is important that we name the target "chromium-browser",
1170 - # xdg-utils expect it; bug #355517.
1171 - dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser
1172 - # keep the old symlink around for consistency
1173 - dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium
1174 -
1175 - dosym "${CHROMIUM_HOME}/chromedriver" /usr/bin/chromedriver
1176 -
1177 - # Allow users to override command-line options, bug #357629.
1178 - insinto /etc/chromium
1179 - newins "${FILESDIR}/chromium.default" "default"
1180 -
1181 - pushd out/Release/locales > /dev/null || die
1182 - chromium_remove_language_paks
1183 - popd
1184 -
1185 - insinto "${CHROMIUM_HOME}"
1186 - doins out/Release/*.bin
1187 - doins out/Release/*.pak
1188 - (
1189 - shopt -s nullglob
1190 - local files=(out/Release/*.so out/Release/*.so.[0-9])
1191 - [[ ${#files[@]} -gt 0 ]] && doins "${files[@]}"
1192 - )
1193 -
1194 - if ! use system-icu && ! use headless; then
1195 - doins out/Release/icudtl.dat
1196 - fi
1197 -
1198 - doins -r out/Release/locales
1199 - doins -r out/Release/MEIPreload
1200 -
1201 - # Install vk_swiftshader_icd.json; bug #827861
1202 - doins out/Release/vk_swiftshader_icd.json
1203 -
1204 - if [[ -d out/Release/swiftshader ]]; then
1205 - insinto "${CHROMIUM_HOME}/swiftshader"
1206 - doins out/Release/swiftshader/*.so
1207 - fi
1208 -
1209 - # Install icons
1210 - local branding size
1211 - for size in 16 24 32 48 64 128 256 ; do
1212 - case ${size} in
1213 - 16|32) branding="chrome/app/theme/default_100_percent/chromium" ;;
1214 - *) branding="chrome/app/theme/chromium" ;;
1215 - esac
1216 - newicon -s ${size} "${branding}/product_logo_${size}.png" \
1217 - chromium-browser.png
1218 - done
1219 -
1220 - # Install desktop entry
1221 - domenu out/Release/chromium-browser-chromium.desktop
1222 -
1223 - # Install GNOME default application entry (bug #303100).
1224 - insinto /usr/share/gnome-control-center/default-apps
1225 - newins "${FILESDIR}"/chromium-browser.xml chromium-browser.xml
1226 -
1227 - # Install manpage; bug #684550
1228 - doman out/Release/chromium-browser.1
1229 - dosym chromium-browser.1 /usr/share/man/man1/chromium.1
1230 -
1231 - readme.gentoo_create_doc
1232 -}
1233 -
1234 -pkg_postrm() {
1235 - xdg_icon_cache_update
1236 - xdg_desktop_database_update
1237 -}
1238 -
1239 -pkg_postinst() {
1240 - xdg_icon_cache_update
1241 - xdg_desktop_database_update
1242 - readme.gentoo_print_elog
1243 -
1244 - if ! use headless; then
1245 - if use vaapi; then
1246 - elog "VA-API is disabled by default at runtime. You have to enable it"
1247 - elog "by adding --enable-features=VaapiVideoDecoder to CHROMIUM_FLAGS"
1248 - elog "in /etc/chromium/default."
1249 - fi
1250 - if use screencast; then
1251 - elog "Screencast is disabled by default at runtime. Either enable it"
1252 - elog "by navigating to chrome://flags/#enable-webrtc-pipewire-capturer"
1253 - elog "inside Chromium or add --enable-features=WebRTCPipeWireCapturer"
1254 - elog "to CHROMIUM_FLAGS in /etc/chromium/default."
1255 - fi
1256 - if use gtk4; then
1257 - elog "Chromium prefers GTK3 over GTK4 at runtime. To override this"
1258 - elog "behavior you need to pass --gtk-version=4, e.g. by adding it"
1259 - elog "to CHROMIUM_FLAGS in /etc/chromium/default."
1260 - fi
1261 - fi
1262 -}
1263
1264 diff --git a/www-client/chromium/chromium-107.0.5304.87.ebuild b/www-client/chromium/chromium-107.0.5304.87.ebuild
1265 deleted file mode 100644
1266 index 069a51c5dc78..000000000000
1267 --- a/www-client/chromium/chromium-107.0.5304.87.ebuild
1268 +++ /dev/null
1269 @@ -1,1227 +0,0 @@
1270 -# Copyright 2009-2022 Gentoo Authors
1271 -# Distributed under the terms of the GNU General Public License v2
1272 -
1273 -EAPI=8
1274 -PYTHON_COMPAT=( python3_{8..11} )
1275 -PYTHON_REQ_USE="xml(+)"
1276 -LLVM_MAX_SLOT=15
1277 -
1278 -CHROMIUM_LANGS="af am ar bg bn ca cs da de el en-GB es es-419 et fa fi fil fr gu he
1279 - 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
1280 - sv sw ta te th tr uk ur vi zh-CN zh-TW"
1281 -
1282 -VIRTUALX_REQUIRED="pgo"
1283 -
1284 -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
1285 -
1286 -DESCRIPTION="Open-source version of Google Chrome web browser"
1287 -HOMEPAGE="https://chromium.org/"
1288 -PATCHSET="1"
1289 -PATCHSET_NAME="chromium-$(ver_cut 1)-patchset-${PATCHSET}"
1290 -PATCHSET_NAME_PPC64="chromium_107.0.5304.68-1raptor1~deb11u1.debian"
1291 -SRC_URI="https://commondatastorage.googleapis.com/chromium-browser-official/${P}.tar.xz
1292 - https://github.com/stha09/chromium-patches/releases/download/${PATCHSET_NAME}/${PATCHSET_NAME}.tar.xz
1293 - ppc64? ( https://quickbuild.io/~raptor-engineering-public/+archive/ubuntu/chromium/+files/${PATCHSET_NAME_PPC64}.tar.xz )
1294 - pgo? ( https://github.com/elkablo/chromium-profiler/releases/download/v0.2/chromium-profiler-0.2.tar )"
1295 -
1296 -LICENSE="BSD"
1297 -SLOT="0/stable"
1298 -KEYWORDS="amd64 arm64 ~ppc64"
1299 -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"
1300 -REQUIRED_USE="
1301 - component-build? ( !suid !libcxx )
1302 - screencast? ( wayland )
1303 - !headless? ( || ( X wayland ) )
1304 - pgo? ( X !wayland )
1305 -"
1306 -
1307 -COMMON_X_DEPEND="
1308 - x11-libs/libXcomposite:=
1309 - x11-libs/libXcursor:=
1310 - x11-libs/libXdamage:=
1311 - x11-libs/libXfixes:=
1312 - >=x11-libs/libXi-1.6.0:=
1313 - x11-libs/libXrandr:=
1314 - x11-libs/libXrender:=
1315 - x11-libs/libXtst:=
1316 - x11-libs/libxshmfence:=
1317 -"
1318 -
1319 -COMMON_SNAPSHOT_DEPEND="
1320 - system-icu? ( >=dev-libs/icu-71.1:= )
1321 - >=dev-libs/libxml2-2.9.4-r3:=[icu]
1322 - dev-libs/nspr:=
1323 - >=dev-libs/nss-3.26:=
1324 - !libcxx? ( >=dev-libs/re2-0.2019.08.01:= )
1325 - dev-libs/libxslt:=
1326 - media-libs/fontconfig:=
1327 - >=media-libs/freetype-2.11.0-r1:=
1328 - system-harfbuzz? ( >=media-libs/harfbuzz-3:0=[icu(-)] )
1329 - media-libs/libjpeg-turbo:=
1330 - system-png? ( media-libs/libpng:=[-apng(-)] )
1331 - >=media-libs/libwebp-0.4.0:=
1332 - media-libs/mesa:=[gbm(+)]
1333 - >=media-libs/openh264-1.6.0:=
1334 - system-av1? (
1335 - >=media-libs/dav1d-1.0.0:=
1336 - >=media-libs/libaom-3.4.0:=
1337 - )
1338 - sys-libs/zlib:=
1339 - x11-libs/libdrm:=
1340 - !headless? (
1341 - dev-libs/glib:2
1342 - >=media-libs/alsa-lib-1.0.19:=
1343 - pulseaudio? ( media-sound/pulseaudio:= )
1344 - sys-apps/pciutils:=
1345 - kerberos? ( virtual/krb5 )
1346 - vaapi? ( >=media-libs/libva-2.7:=[X?,wayland?] )
1347 - X? (
1348 - x11-libs/libX11:=
1349 - x11-libs/libXext:=
1350 - x11-libs/libxcb:=
1351 - )
1352 - x11-libs/libxkbcommon:=
1353 - wayland? (
1354 - dev-libs/wayland:=
1355 - screencast? ( media-video/pipewire:= )
1356 - )
1357 - )
1358 -"
1359 -
1360 -COMMON_DEPEND="
1361 - ${COMMON_SNAPSHOT_DEPEND}
1362 - app-arch/bzip2:=
1363 - dev-libs/expat:=
1364 - system-ffmpeg? (
1365 - >=media-video/ffmpeg-4.3:=
1366 - || (
1367 - media-video/ffmpeg[-samba]
1368 - >=net-fs/samba-4.5.10-r1[-debug(-)]
1369 - )
1370 - >=media-libs/opus-1.3.1:=
1371 - )
1372 - net-misc/curl[ssl]
1373 - sys-apps/dbus:=
1374 - media-libs/flac:=
1375 - sys-libs/zlib:=[minizip]
1376 - !headless? (
1377 - X? ( ${COMMON_X_DEPEND} )
1378 - || (
1379 - >=app-accessibility/at-spi2-core-2.46.0:2
1380 - ( app-accessibility/at-spi2-atk dev-libs/atk )
1381 - )
1382 - media-libs/mesa:=[X?,wayland?]
1383 - cups? ( >=net-print/cups-1.3.11:= )
1384 - virtual/udev
1385 - x11-libs/cairo:=
1386 - x11-libs/gdk-pixbuf:2
1387 - x11-libs/pango:=
1388 - qt5? (
1389 - dev-qt/qtcore:5
1390 - dev-qt/qtwidgets:5
1391 - )
1392 - )
1393 -"
1394 -RDEPEND="${COMMON_DEPEND}
1395 - !headless? (
1396 - || (
1397 - x11-libs/gtk+:3[X?,wayland?]
1398 - gui-libs/gtk:4[X?,wayland?]
1399 - )
1400 - x11-misc/xdg-utils
1401 - )
1402 - virtual/ttf-fonts
1403 - selinux? ( sec-policy/selinux-chromium )
1404 -"
1405 -DEPEND="${COMMON_DEPEND}
1406 - !headless? (
1407 - gtk4? ( gui-libs/gtk:4[X?,wayland?] )
1408 - !gtk4? ( x11-libs/gtk+:3[X?,wayland?] )
1409 - )
1410 -"
1411 -
1412 -depend_clang_llvm_version() {
1413 - echo "sys-devel/clang:$1"
1414 - echo "sys-devel/llvm:$1"
1415 - echo "=sys-devel/lld-$1*"
1416 -}
1417 -
1418 -depend_clang_llvm_versions() {
1419 - local _v
1420 - if [[ $# -gt 1 ]]; then
1421 - echo "|| ("
1422 - for _v in "$@"; do
1423 - echo "("
1424 - depend_clang_llvm_version "${_v}"
1425 - echo ")"
1426 - done
1427 - echo ")"
1428 - elif [[ $# -eq 1 ]]; then
1429 - depend_clang_llvm_version "$1"
1430 - fi
1431 -}
1432 -
1433 -BDEPEND="
1434 - ${COMMON_SNAPSHOT_DEPEND}
1435 - ${PYTHON_DEPS}
1436 - $(python_gen_any_dep '
1437 - dev-python/setuptools[${PYTHON_USEDEP}]
1438 - ')
1439 - >=app-arch/gzip-1.7
1440 - libcxx? ( >=sys-devel/clang-12 )
1441 - lto? ( $(depend_clang_llvm_versions 13 14 15) )
1442 - pgo? (
1443 - >=dev-python/selenium-3.141.0
1444 - >=dev-util/web_page_replay_go-20220314
1445 - $(depend_clang_llvm_versions 13 14 15)
1446 - )
1447 - dev-lang/perl
1448 - >=dev-util/gn-0.1807
1449 - >=dev-util/gperf-3.0.3
1450 - >=dev-util/ninja-1.7.2
1451 - dev-vcs/git
1452 - >=net-libs/nodejs-7.6.0[inspector]
1453 - >=sys-devel/bison-2.4.3
1454 - sys-devel/flex
1455 - virtual/pkgconfig
1456 - js-type-check? ( virtual/jre )
1457 -"
1458 -
1459 -# These are intended for ebuild maintainer use to force clang if GCC is broken.
1460 -: ${CHROMIUM_FORCE_CLANG=no}
1461 -
1462 -if [[ ${CHROMIUM_FORCE_CLANG} == yes ]]; then
1463 - BDEPEND+=" >=sys-devel/clang-12"
1464 -fi
1465 -
1466 -if ! has chromium_pkg_die ${EBUILD_DEATH_HOOKS}; then
1467 - EBUILD_DEATH_HOOKS+=" chromium_pkg_die";
1468 -fi
1469 -
1470 -DISABLE_AUTOFORMATTING="yes"
1471 -DOC_CONTENTS="
1472 -Some web pages may require additional fonts to display properly.
1473 -Try installing some of the following packages if some characters
1474 -are not displayed properly:
1475 -- media-fonts/arphicfonts
1476 -- media-fonts/droid
1477 -- media-fonts/ipamonafont
1478 -- media-fonts/noto
1479 -- media-fonts/ja-ipafonts
1480 -- media-fonts/takao-fonts
1481 -- media-fonts/wqy-microhei
1482 -- media-fonts/wqy-zenhei
1483 -
1484 -To fix broken icons on the Downloads page, you should install an icon
1485 -theme that covers the appropriate MIME types, and configure this as your
1486 -GTK+ icon theme.
1487 -
1488 -For native file dialogs in KDE, install kde-apps/kdialog.
1489 -
1490 -To make password storage work with your desktop environment you may
1491 -have install one of the supported credentials management applications:
1492 -- app-crypt/libsecret (GNOME)
1493 -- kde-frameworks/kwallet (KDE)
1494 -If you have one of above packages installed, but don't want to use
1495 -them in Chromium, then add --password-store=basic to CHROMIUM_FLAGS
1496 -in /etc/chromium/default.
1497 -"
1498 -
1499 -python_check_deps() {
1500 - python_has_version "dev-python/setuptools[${PYTHON_USEDEP}]"
1501 -}
1502 -
1503 -needs_clang() {
1504 - [[ ${CHROMIUM_FORCE_CLANG} == yes ]] || use libcxx || use lto || use pgo
1505 -}
1506 -
1507 -llvm_check_deps() {
1508 - if ! has_version -b "sys-devel/clang:${LLVM_SLOT}" ; then
1509 - einfo "sys-devel/clang:${LLVM_SLOT} is missing! Cannot use LLVM slot ${LLVM_SLOT} ..." >&2
1510 - return 1
1511 - fi
1512 -
1513 - if ( use lto || use pgo ) && ! has_version -b "=sys-devel/lld-${LLVM_SLOT}*" ; then
1514 - einfo "=sys-devel/lld-${LLVM_SLOT}* is missing! Cannot use LLVM slot ${LLVM_SLOT} ..." >&2
1515 - return 1
1516 - fi
1517 -
1518 - einfo "Using LLVM slot ${LLVM_SLOT} to build" >&2
1519 -}
1520 -
1521 -pre_build_checks() {
1522 - if [[ ${MERGE_TYPE} != binary ]]; then
1523 - [[ ${EBUILD_PHASE_FUNC} == pkg_setup ]] && ( use lto || use pgo ) && llvm_pkg_setup
1524 -
1525 - local -x CPP="$(tc-getCXX) -E"
1526 - if tc-is-gcc && ! ver_test "$(gcc-version)" -ge 9.2; then
1527 - die "At least gcc 9.2 is required"
1528 - fi
1529 - if use pgo && tc-is-cross-compiler; then
1530 - die "The pgo USE flag cannot be used when cross-compiling"
1531 - fi
1532 - if needs_clang || tc-is-clang; then
1533 - tc-is-cross-compiler && CPP=${CBUILD}-clang++ || CPP=${CHOST}-clang++
1534 - CPP+=" -E"
1535 - if ! ver_test "$(clang-major-version)" -ge 12; then
1536 - die "At least clang 12 is required"
1537 - fi
1538 - fi
1539 - if [[ ${EBUILD_PHASE_FUNC} == pkg_setup ]] && use js-type-check; then
1540 - "${BROOT}"/usr/bin/java -version 2>1 > /dev/null || die "Java VM not setup correctly"
1541 - fi
1542 - fi
1543 -
1544 - # Check build requirements, bug #541816 and bug #471810 .
1545 - CHECKREQS_MEMORY="4G"
1546 - CHECKREQS_DISK_BUILD="12G"
1547 - tc-is-cross-compiler && CHECKREQS_DISK_BUILD="14G"
1548 - if use lto || use pgo; then
1549 - CHECKREQS_MEMORY="9G"
1550 - CHECKREQS_DISK_BUILD="13G"
1551 - tc-is-cross-compiler && CHECKREQS_DISK_BUILD="16G"
1552 - use pgo && CHECKREQS_DISK_BUILD="20G"
1553 - fi
1554 - if is-flagq '-g?(gdb)?([1-9])'; then
1555 - if use custom-cflags || use component-build; then
1556 - CHECKREQS_DISK_BUILD="25G"
1557 - fi
1558 - if ! use component-build; then
1559 - CHECKREQS_MEMORY="16G"
1560 - fi
1561 - fi
1562 - check-reqs_${EBUILD_PHASE_FUNC}
1563 -}
1564 -
1565 -pkg_pretend() {
1566 - pre_build_checks
1567 -
1568 - if use headless; then
1569 - local headless_unused_flags=("cups" "kerberos" "pulseaudio" "vaapi" "wayland")
1570 - for myiuse in ${headless_unused_flags[@]}; do
1571 - use ${myiuse} && ewarn "Ignoring USE=${myiuse} since USE=headless is set."
1572 - done
1573 - fi
1574 -}
1575 -
1576 -pkg_setup() {
1577 - pre_build_checks
1578 -
1579 - chromium_suid_sandbox_check_kernel_config
1580 -
1581 - # nvidia-drivers does not work correctly with Wayland due to unsupported EGLStreams
1582 - if use wayland && ! use headless && has_version "x11-drivers/nvidia-drivers"; then
1583 - ewarn "Proprietary nVidia driver does not work with Wayland. You can disable"
1584 - ewarn "Wayland by setting DISABLE_OZONE_PLATFORM=true in /etc/chromium/default."
1585 - fi
1586 -}
1587 -
1588 -src_prepare() {
1589 - # Calling this here supports resumption via FEATURES=keepwork
1590 - python_setup
1591 -
1592 - local PATCHES=(
1593 - "${WORKDIR}/patches"
1594 - "${FILESDIR}/chromium-93-InkDropHost-crash.patch"
1595 - "${FILESDIR}/chromium-98-EnumTable-crash.patch"
1596 - "${FILESDIR}/chromium-98-gtk4-build.patch"
1597 - "${FILESDIR}/chromium-105-swiftshader-no-wayland.patch"
1598 - "${FILESDIR}/chromium-106-revert-GlobalMediaControlsCastStartStop.patch"
1599 - "${FILESDIR}/chromium-107-system-zlib.patch"
1600 - "${FILESDIR}/chromium-use-oauth2-client-switches-as-default.patch"
1601 - "${FILESDIR}/chromium-shim_headers.patch"
1602 - "${FILESDIR}/chromium-cross-compile.patch"
1603 - )
1604 -
1605 - if use ppc64 ; then
1606 - local p
1607 - for p in $(grep -v "^#" "${WORKDIR}"/debian/patches/series | grep "^ppc64le" || die); do
1608 - if [[ $p =~ "fix-breakpad-compile.patch" ]]; then
1609 - eapply "${FILESDIR}/ppc64le/fix-breakpad-compile.patch"
1610 - else
1611 - eapply "${WORKDIR}/debian/patches/${p}"
1612 - fi
1613 - done
1614 - eapply "${FILESDIR}/ppc64le/libpng-pdfium-compile-98.patch"
1615 - eapply "${FILESDIR}/ppc64le/fix-swiftshader-compile.patch"
1616 - fi
1617 -
1618 - default
1619 -
1620 - mkdir -p third_party/node/linux/node-linux-x64/bin || die
1621 - ln -s "${EPREFIX}"/usr/bin/node third_party/node/linux/node-linux-x64/bin/node || die
1622 -
1623 - # adjust python interpreter version
1624 - sed -i -e "s|\(^script_executable = \).*|\1\"${EPYTHON}\"|g" .gn || die
1625 -
1626 - local keeplibs=(
1627 - base/third_party/cityhash
1628 - base/third_party/double_conversion
1629 - base/third_party/dynamic_annotations
1630 - base/third_party/icu
1631 - base/third_party/nspr
1632 - base/third_party/superfasthash
1633 - base/third_party/symbolize
1634 - base/third_party/valgrind
1635 - base/third_party/xdg_mime
1636 - base/third_party/xdg_user_dirs
1637 - buildtools/third_party/libc++
1638 - buildtools/third_party/libc++abi
1639 - chrome/third_party/mozilla_security_manager
1640 - courgette/third_party
1641 - net/third_party/mozilla_security_manager
1642 - net/third_party/nss
1643 - net/third_party/quic
1644 - net/third_party/uri_template
1645 - third_party/abseil-cpp
1646 - third_party/angle
1647 - third_party/angle/src/common/third_party/base
1648 - third_party/angle/src/common/third_party/smhasher
1649 - third_party/angle/src/common/third_party/xxhash
1650 - third_party/angle/src/third_party/libXNVCtrl
1651 - third_party/angle/src/third_party/trace_event
1652 - third_party/angle/src/third_party/volk
1653 - third_party/apple_apsl
1654 - third_party/axe-core
1655 - third_party/blink
1656 - third_party/bidimapper
1657 - third_party/boringssl
1658 - third_party/boringssl/src/third_party/fiat
1659 - third_party/breakpad
1660 - third_party/breakpad/breakpad/src/third_party/curl
1661 - third_party/brotli
1662 - third_party/catapult
1663 - third_party/catapult/common/py_vulcanize/third_party/rcssmin
1664 - third_party/catapult/common/py_vulcanize/third_party/rjsmin
1665 - third_party/catapult/third_party/beautifulsoup4-4.9.3
1666 - third_party/catapult/third_party/html5lib-1.1
1667 - third_party/catapult/third_party/polymer
1668 - third_party/catapult/third_party/six
1669 - third_party/catapult/tracing/third_party/d3
1670 - third_party/catapult/tracing/third_party/gl-matrix
1671 - third_party/catapult/tracing/third_party/jpeg-js
1672 - third_party/catapult/tracing/third_party/jszip
1673 - third_party/catapult/tracing/third_party/mannwhitneyu
1674 - third_party/catapult/tracing/third_party/oboe
1675 - third_party/catapult/tracing/third_party/pako
1676 - third_party/ced
1677 - third_party/cld_3
1678 - third_party/closure_compiler
1679 - third_party/content_analysis_sdk
1680 - third_party/cpuinfo
1681 - third_party/crashpad
1682 - third_party/crashpad/crashpad/third_party/lss
1683 - third_party/crashpad/crashpad/third_party/zlib
1684 - third_party/crc32c
1685 - third_party/cros_system_api
1686 - third_party/dawn
1687 - third_party/dawn/third_party/gn/webgpu-cts
1688 - third_party/dawn/third_party/khronos
1689 - third_party/depot_tools
1690 - third_party/devscripts
1691 - third_party/devtools-frontend
1692 - third_party/devtools-frontend/src/front_end/third_party/acorn
1693 - third_party/devtools-frontend/src/front_end/third_party/additional_readme_paths.json
1694 - third_party/devtools-frontend/src/front_end/third_party/axe-core
1695 - third_party/devtools-frontend/src/front_end/third_party/chromium
1696 - third_party/devtools-frontend/src/front_end/third_party/codemirror
1697 - third_party/devtools-frontend/src/front_end/third_party/diff
1698 - third_party/devtools-frontend/src/front_end/third_party/i18n
1699 - third_party/devtools-frontend/src/front_end/third_party/intl-messageformat
1700 - third_party/devtools-frontend/src/front_end/third_party/lighthouse
1701 - third_party/devtools-frontend/src/front_end/third_party/lit-html
1702 - third_party/devtools-frontend/src/front_end/third_party/lodash-isequal
1703 - third_party/devtools-frontend/src/front_end/third_party/marked
1704 - third_party/devtools-frontend/src/front_end/third_party/puppeteer
1705 - third_party/devtools-frontend/src/front_end/third_party/wasmparser
1706 - third_party/devtools-frontend/src/test/unittests/front_end/third_party/i18n
1707 - third_party/devtools-frontend/src/third_party
1708 - third_party/distributed_point_functions
1709 - third_party/dom_distiller_js
1710 - third_party/eigen3
1711 - third_party/emoji-segmenter
1712 - third_party/farmhash
1713 - third_party/fdlibm
1714 - third_party/fft2d
1715 - third_party/flatbuffers
1716 - third_party/fp16
1717 - third_party/freetype
1718 - third_party/fusejs
1719 - third_party/fxdiv
1720 - third_party/highway
1721 - third_party/libgifcodec
1722 - third_party/liburlpattern
1723 - third_party/libzip
1724 - third_party/gemmlowp
1725 - third_party/google_input_tools
1726 - third_party/google_input_tools/third_party/closure_library
1727 - third_party/google_input_tools/third_party/closure_library/third_party/closure
1728 - third_party/googletest
1729 - third_party/hunspell
1730 - third_party/iccjpeg
1731 - third_party/inspector_protocol
1732 - third_party/ipcz
1733 - third_party/jinja2
1734 - third_party/jsoncpp
1735 - third_party/jstemplate
1736 - third_party/khronos
1737 - third_party/leveldatabase
1738 - third_party/libaddressinput
1739 - third_party/libavif
1740 - third_party/libevent
1741 - third_party/libgav1
1742 - third_party/libjingle
1743 - third_party/libjxl
1744 - third_party/libphonenumber
1745 - third_party/libsecret
1746 - third_party/libsrtp
1747 - third_party/libsync
1748 - third_party/libudev
1749 - third_party/libva_protected_content
1750 - third_party/libvpx
1751 - third_party/libvpx/source/libvpx/third_party/x86inc
1752 - third_party/libwebm
1753 - third_party/libx11
1754 - third_party/libxcb-keysyms
1755 - third_party/libxml/chromium
1756 - third_party/libyuv
1757 - third_party/llvm
1758 - third_party/lottie
1759 - third_party/lss
1760 - third_party/lzma_sdk
1761 - third_party/mako
1762 - third_party/maldoca
1763 - third_party/maldoca/src/third_party/tensorflow_protos
1764 - third_party/maldoca/src/third_party/zlibwrapper
1765 - third_party/markupsafe
1766 - third_party/mesa
1767 - third_party/metrics_proto
1768 - third_party/minigbm
1769 - third_party/modp_b64
1770 - third_party/nasm
1771 - third_party/nearby
1772 - third_party/neon_2_sse
1773 - third_party/node
1774 - third_party/omnibox_proto
1775 - third_party/one_euro_filter
1776 - third_party/openscreen
1777 - third_party/openscreen/src/third_party/mozilla
1778 - third_party/openscreen/src/third_party/tinycbor/src/src
1779 - third_party/ots
1780 - third_party/pdfium
1781 - third_party/pdfium/third_party/agg23
1782 - third_party/pdfium/third_party/base
1783 - third_party/pdfium/third_party/bigint
1784 - third_party/pdfium/third_party/freetype
1785 - third_party/pdfium/third_party/lcms
1786 - third_party/pdfium/third_party/libopenjpeg
1787 - third_party/pdfium/third_party/libpng16
1788 - third_party/pdfium/third_party/libtiff
1789 - third_party/pdfium/third_party/skia_shared
1790 - third_party/perfetto
1791 - third_party/perfetto/protos/third_party/chromium
1792 - third_party/pffft
1793 - third_party/ply
1794 - third_party/polymer
1795 - third_party/private-join-and-compute
1796 - third_party/private_membership
1797 - third_party/protobuf
1798 - third_party/protobuf/third_party/six
1799 - third_party/pthreadpool
1800 - third_party/pyjson5
1801 - third_party/qcms
1802 - third_party/rnnoise
1803 - third_party/s2cellid
1804 - third_party/securemessage
1805 - third_party/shell-encryption
1806 - third_party/simplejson
1807 - third_party/skia
1808 - third_party/skia/include/third_party/vulkan
1809 - third_party/skia/third_party/vulkan
1810 - third_party/smhasher
1811 - third_party/snappy
1812 - third_party/sqlite
1813 - third_party/swiftshader
1814 - third_party/swiftshader/third_party/astc-encoder
1815 - third_party/swiftshader/third_party/llvm-subzero
1816 - third_party/swiftshader/third_party/marl
1817 - third_party/swiftshader/third_party/subzero
1818 - third_party/swiftshader/third_party/SPIRV-Headers/include/spirv
1819 - third_party/swiftshader/third_party/SPIRV-Tools
1820 - third_party/tensorflow-text
1821 - third_party/tflite
1822 - third_party/tflite/src/third_party/eigen3
1823 - third_party/tflite/src/third_party/fft2d
1824 - third_party/ruy
1825 - third_party/six
1826 - third_party/ukey2
1827 - third_party/unrar
1828 - third_party/utf
1829 - third_party/vulkan
1830 - third_party/web-animations-js
1831 - third_party/webdriver
1832 - third_party/webgpu-cts
1833 - third_party/webrtc
1834 - third_party/webrtc/common_audio/third_party/ooura
1835 - third_party/webrtc/common_audio/third_party/spl_sqrt_floor
1836 - third_party/webrtc/modules/third_party/fft
1837 - third_party/webrtc/modules/third_party/g711
1838 - third_party/webrtc/modules/third_party/g722
1839 - third_party/webrtc/rtc_base/third_party/base64
1840 - third_party/webrtc/rtc_base/third_party/sigslot
1841 - third_party/widevine
1842 - third_party/woff2
1843 - third_party/wuffs
1844 - third_party/x11proto
1845 - third_party/xcbproto
1846 - third_party/xnnpack
1847 - third_party/zxcvbn-cpp
1848 - third_party/zlib/google
1849 - url/third_party/mozilla
1850 - v8/src/third_party/siphash
1851 - v8/src/third_party/valgrind
1852 - v8/src/third_party/utf8-decoder
1853 - v8/third_party/inspector_protocol
1854 - v8/third_party/v8
1855 -
1856 - # gyp -> gn leftovers
1857 - third_party/speech-dispatcher
1858 - third_party/usb_ids
1859 - third_party/xdg-utils
1860 - )
1861 - if ! use system-ffmpeg; then
1862 - keeplibs+=( third_party/ffmpeg third_party/opus )
1863 - fi
1864 - if ! use system-icu; then
1865 - keeplibs+=( third_party/icu )
1866 - fi
1867 - if ! use system-png; then
1868 - keeplibs+=( third_party/libpng )
1869 - fi
1870 - if ! use system-av1; then
1871 - keeplibs+=(
1872 - third_party/dav1d
1873 - third_party/libaom
1874 - third_party/libaom/source/libaom/third_party/fastfeat
1875 - third_party/libaom/source/libaom/third_party/vector
1876 - third_party/libaom/source/libaom/third_party/x86inc
1877 - )
1878 - fi
1879 - if use libcxx; then
1880 - keeplibs+=( third_party/re2 )
1881 - fi
1882 - if use system-harfbuzz; then
1883 - keeplibs+=( third_party/harfbuzz-ng/utils )
1884 - else
1885 - keeplibs+=( third_party/harfbuzz-ng )
1886 - fi
1887 - if use wayland && ! use headless ; then
1888 - keeplibs+=( third_party/wayland )
1889 - # only need the .gn files
1890 - rm -r third_party/wayland/src || die
1891 - fi
1892 - if use arm64 || use ppc64 ; then
1893 - keeplibs+=( third_party/swiftshader/third_party/llvm-10.0 )
1894 - fi
1895 - # we need to generate ppc64 stuff because upstream does not ship it yet
1896 - # it has to be done before unbundling.
1897 - if use ppc64; then
1898 - pushd third_party/libvpx >/dev/null || die
1899 - mkdir -p source/config/linux/ppc64 || die
1900 - # requires git and clang, bug #832803
1901 - sed -i -e "s|^update_readme||g; s|clang-format|${EPREFIX}/bin/true|g" \
1902 - generate_gni.sh || die
1903 - ./generate_gni.sh || die
1904 - popd >/dev/null || die
1905 -
1906 - pushd third_party/ffmpeg >/dev/null || die
1907 - cp libavcodec/ppc/h264dsp.c libavcodec/ppc/h264dsp_ppc.c || die
1908 - cp libavcodec/ppc/h264qpel.c libavcodec/ppc/h264qpel_ppc.c || die
1909 - popd >/dev/null || die
1910 - fi
1911 -
1912 - # Remove most bundled libraries. Some are still needed.
1913 - build/linux/unbundle/remove_bundled_libraries.py "${keeplibs[@]}" --do-remove || die
1914 -
1915 - if use js-type-check; then
1916 - ln -s "${EPREFIX}"/usr/bin/java third_party/jdk/current/bin/java || die
1917 - fi
1918 -
1919 - # bundled eu-strip is for amd64 only and we don't want to pre-stripped binaries
1920 - mkdir -p buildtools/third_party/eu-strip/bin || die
1921 - ln -s "${EPREFIX}"/bin/true buildtools/third_party/eu-strip/bin/eu-strip || die
1922 -}
1923 -
1924 -chromium_configure() {
1925 - # Calling this here supports resumption via FEATURES=keepwork
1926 - python_setup
1927 -
1928 - local myconf_gn=""
1929 -
1930 - # Make sure the build system will use the right tools, bug #340795.
1931 - tc-export AR CC CXX NM
1932 -
1933 - if needs_clang && ! tc-is-clang; then
1934 - # Force clang since gcc is either broken or build is using libcxx.
1935 - if tc-is-cross-compiler; then
1936 - CC="${CBUILD}-clang -target ${CHOST} --sysroot ${ESYSROOT}"
1937 - CXX="${CBUILD}-clang++ -target ${CHOST} --sysroot ${ESYSROOT}"
1938 - BUILD_CC=${CBUILD}-clang
1939 - BUILD_CXX=${CBUILD}-clang++
1940 - else
1941 - CC=${CHOST}-clang
1942 - CXX=${CHOST}-clang++
1943 - fi
1944 - strip-unsupported-flags
1945 - fi
1946 -
1947 - if tc-is-clang; then
1948 - myconf_gn+=" is_clang=true clang_use_chrome_plugins=false"
1949 - else
1950 - myconf_gn+=" is_clang=false"
1951 - fi
1952 -
1953 - # Force lld for lto or pgo builds only, otherwise disable, bug 641556
1954 - if use lto || use pgo; then
1955 - myconf_gn+=" use_lld=true"
1956 - else
1957 - myconf_gn+=" use_lld=false"
1958 - fi
1959 -
1960 - if use lto || use pgo; then
1961 - AR=llvm-ar
1962 - NM=llvm-nm
1963 - if tc-is-cross-compiler; then
1964 - BUILD_AR=llvm-ar
1965 - BUILD_NM=llvm-nm
1966 - fi
1967 - fi
1968 -
1969 - # Define a custom toolchain for GN
1970 - myconf_gn+=" custom_toolchain=\"//build/toolchain/linux/unbundle:default\""
1971 -
1972 - if tc-is-cross-compiler; then
1973 - tc-export BUILD_{AR,CC,CXX,NM}
1974 - myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:host\""
1975 - myconf_gn+=" v8_snapshot_toolchain=\"//build/toolchain/linux/unbundle:host\""
1976 - myconf_gn+=" pkg_config=\"$(tc-getPKG_CONFIG)\""
1977 - myconf_gn+=" host_pkg_config=\"$(tc-getBUILD_PKG_CONFIG)\""
1978 -
1979 - # setup cups-config, build system only uses --libs option
1980 - if use cups; then
1981 - mkdir "${T}/cups-config" || die
1982 - cp "${ESYSROOT}/usr/bin/${CHOST}-cups-config" "${T}/cups-config/cups-config" || die
1983 - export PATH="${PATH}:${T}/cups-config"
1984 - fi
1985 -
1986 - # Don't inherit PKG_CONFIG_PATH from environment
1987 - local -x PKG_CONFIG_PATH=
1988 - else
1989 - myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:default\""
1990 - fi
1991 -
1992 - # GN needs explicit config for Debug/Release as opposed to inferring it from build directory.
1993 - myconf_gn+=" is_debug=false"
1994 -
1995 - # enable DCHECK with USE=debug only, increases chrome binary size by 30%, bug #811138.
1996 - # DCHECK is fatal by default, make it configurable at runtime, #bug 807881.
1997 - myconf_gn+=" dcheck_always_on=$(usex debug true false)"
1998 - myconf_gn+=" dcheck_is_configurable=$(usex debug true false)"
1999 -
2000 - # Component build isn't generally intended for use by end users. It's mostly useful
2001 - # for development and debugging.
2002 - myconf_gn+=" is_component_build=$(usex component-build true false)"
2003 -
2004 - # Disable nacl, we can't build without pnacl (http://crbug.com/269560).
2005 - myconf_gn+=" enable_nacl=false"
2006 -
2007 - # Use system-provided libraries.
2008 - # TODO: freetype -- remove sources (https://bugs.chromium.org/p/pdfium/issues/detail?id=733).
2009 - # TODO: use_system_hunspell (upstream changes needed).
2010 - # TODO: use_system_protobuf (bug #525560).
2011 - # TODO: use_system_sqlite (http://crbug.com/22208).
2012 -
2013 - # libevent: https://bugs.gentoo.org/593458
2014 - local gn_system_libraries=(
2015 - flac
2016 - fontconfig
2017 - freetype
2018 - # Need harfbuzz_from_pkgconfig target
2019 - #harfbuzz-ng
2020 - libdrm
2021 - libjpeg
2022 - libwebp
2023 - libxml
2024 - libxslt
2025 - openh264
2026 - zlib
2027 - )
2028 - if use system-ffmpeg; then
2029 - gn_system_libraries+=( ffmpeg opus )
2030 - fi
2031 - if use system-icu; then
2032 - gn_system_libraries+=( icu )
2033 - fi
2034 - if use system-png; then
2035 - gn_system_libraries+=( libpng )
2036 - fi
2037 - if use system-av1; then
2038 - gn_system_libraries+=( dav1d libaom )
2039 - fi
2040 - # re2 library interface relies on std::string and std::vector
2041 - if ! use libcxx; then
2042 - gn_system_libraries+=( re2 )
2043 - fi
2044 - build/linux/unbundle/replace_gn_files.py --system-libraries "${gn_system_libraries[@]}" || die
2045 -
2046 - # See dependency logic in third_party/BUILD.gn
2047 - myconf_gn+=" use_system_harfbuzz=$(usex system-harfbuzz true false)"
2048 -
2049 - # Disable deprecated libgnome-keyring dependency, bug #713012
2050 - myconf_gn+=" use_gnome_keyring=false"
2051 -
2052 - # Optional dependencies.
2053 - myconf_gn+=" enable_js_type_check=$(usex js-type-check true false)"
2054 - myconf_gn+=" enable_hangout_services_extension=$(usex hangouts true false)"
2055 - myconf_gn+=" enable_widevine=$(usex widevine true false)"
2056 -
2057 - if use headless; then
2058 - myconf_gn+=" use_cups=false"
2059 - myconf_gn+=" use_kerberos=false"
2060 - myconf_gn+=" use_pulseaudio=false"
2061 - myconf_gn+=" use_vaapi=false"
2062 - myconf_gn+=" rtc_use_pipewire=false"
2063 - else
2064 - myconf_gn+=" use_cups=$(usex cups true false)"
2065 - myconf_gn+=" use_kerberos=$(usex kerberos true false)"
2066 - myconf_gn+=" use_pulseaudio=$(usex pulseaudio true false)"
2067 - myconf_gn+=" use_vaapi=$(usex vaapi true false)"
2068 - myconf_gn+=" rtc_use_pipewire=$(usex screencast true false)"
2069 - myconf_gn+=" gtk_version=$(usex gtk4 4 3)"
2070 - fi
2071 -
2072 - # TODO: link_pulseaudio=true for GN.
2073 -
2074 - myconf_gn+=" disable_fieldtrial_testing_config=true"
2075 -
2076 - # Never use bundled gold binary. Disable gold linker flags for now.
2077 - # Do not use bundled clang.
2078 - # Trying to use gold results in linker crash.
2079 - myconf_gn+=" use_gold=false use_sysroot=false"
2080 - myconf_gn+=" use_custom_libcxx=$(usex libcxx true false)"
2081 -
2082 - # Disable pseudolocales, only used for testing
2083 - myconf_gn+=" enable_pseudolocales=false"
2084 -
2085 - # Disable code formating of generated files
2086 - myconf_gn+=" blink_enable_generated_code_formatting=false"
2087 -
2088 - ffmpeg_branding="$(usex proprietary-codecs Chrome Chromium)"
2089 - myconf_gn+=" proprietary_codecs=$(usex proprietary-codecs true false)"
2090 - myconf_gn+=" ffmpeg_branding=\"${ffmpeg_branding}\""
2091 -
2092 - # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys .
2093 - # Note: these are for Gentoo use ONLY. For your own distribution,
2094 - # please get your own set of keys. Feel free to contact chromium@g.o
2095 - # for more info. The OAuth2 credentials, however, have been left out.
2096 - # Those OAuth2 credentials have been broken for quite some time anyway.
2097 - # Instead we apply a patch to use the --oauth2-client-id= and
2098 - # --oauth2-client-secret= switches for setting GOOGLE_DEFAULT_CLIENT_ID and
2099 - # GOOGLE_DEFAULT_CLIENT_SECRET at runtime. This allows signing into
2100 - # Chromium without baked-in values.
2101 - local google_api_key="AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc"
2102 - myconf_gn+=" google_api_key=\"${google_api_key}\""
2103 - local myarch="$(tc-arch)"
2104 -
2105 - # Avoid CFLAGS problems, bug #352457, bug #390147.
2106 - if ! use custom-cflags; then
2107 - replace-flags "-Os" "-O2"
2108 - strip-flags
2109 -
2110 - # Debug info section overflows without component build
2111 - # Prevent linker from running out of address space, bug #471810 .
2112 - if ! use component-build || use x86; then
2113 - filter-flags "-g*"
2114 - fi
2115 -
2116 - # Prevent libvpx/xnnpack build failures. Bug 530248, 544702, 546984, 853646.
2117 - if [[ ${myarch} == amd64 || ${myarch} == x86 ]]; then
2118 - filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 -mno-avx -mno-avx2 -mno-fma -mno-fma4 -mno-xop -mno-sse4a
2119 - fi
2120 - fi
2121 -
2122 - if [[ $myarch = amd64 ]] ; then
2123 - myconf_gn+=" target_cpu=\"x64\""
2124 - ffmpeg_target_arch=x64
2125 - elif [[ $myarch = x86 ]] ; then
2126 - myconf_gn+=" target_cpu=\"x86\""
2127 - ffmpeg_target_arch=ia32
2128 -
2129 - # This is normally defined by compiler_cpu_abi in
2130 - # build/config/compiler/BUILD.gn, but we patch that part out.
2131 - append-flags -msse2 -mfpmath=sse -mmmx
2132 - elif [[ $myarch = arm64 ]] ; then
2133 - myconf_gn+=" target_cpu=\"arm64\""
2134 - ffmpeg_target_arch=arm64
2135 - elif [[ $myarch = arm ]] ; then
2136 - myconf_gn+=" target_cpu=\"arm\""
2137 - ffmpeg_target_arch=$(usex cpu_flags_arm_neon arm-neon arm)
2138 - elif [[ $myarch = ppc64 ]] ; then
2139 - myconf_gn+=" target_cpu=\"ppc64\""
2140 - ffmpeg_target_arch=ppc64
2141 - else
2142 - die "Failed to determine target arch, got '$myarch'."
2143 - fi
2144 -
2145 - # Make sure that -Werror doesn't get added to CFLAGS by the build system.
2146 - # Depending on GCC version the warnings are different and we don't want
2147 - # the build to fail because of that.
2148 - myconf_gn+=" treat_warnings_as_errors=false"
2149 -
2150 - # Disable fatal linker warnings, bug 506268.
2151 - myconf_gn+=" fatal_linker_warnings=false"
2152 -
2153 - # Disable external code space for V8 for ppc64. It is disabled for ppc64
2154 - # by default, but cross-compiling on amd64 enables it again.
2155 - if tc-is-cross-compiler; then
2156 - if ! use amd64 && ! use arm64; then
2157 - myconf_gn+=" v8_enable_external_code_space=false"
2158 - fi
2159 - fi
2160 -
2161 - # Bug 491582.
2162 - export TMPDIR="${WORKDIR}/temp"
2163 - mkdir -p -m 755 "${TMPDIR}" || die
2164 -
2165 - # https://bugs.gentoo.org/654216
2166 - addpredict /dev/dri/ #nowarn
2167 -
2168 - #if ! use system-ffmpeg; then
2169 - if false; then
2170 - local build_ffmpeg_args=""
2171 - if use pic && [[ "${ffmpeg_target_arch}" == "ia32" ]]; then
2172 - build_ffmpeg_args+=" --disable-asm"
2173 - fi
2174 -
2175 - # Re-configure bundled ffmpeg. See bug #491378 for example reasons.
2176 - einfo "Configuring bundled ffmpeg..."
2177 - pushd third_party/ffmpeg > /dev/null || die
2178 - chromium/scripts/build_ffmpeg.py linux ${ffmpeg_target_arch} \
2179 - --branding ${ffmpeg_branding} -- ${build_ffmpeg_args} || die
2180 - chromium/scripts/copy_config.sh || die
2181 - chromium/scripts/generate_gn.py || die
2182 - popd > /dev/null || die
2183 - fi
2184 -
2185 - # Disable unknown warning message from clang.
2186 - if tc-is-clang; then
2187 - append-flags -Wno-unknown-warning-option
2188 - if tc-is-cross-compiler; then
2189 - export BUILD_CXXFLAGS+=" -Wno-unknown-warning-option"
2190 - export BUILD_CFLAGS+=" -Wno-unknown-warning-option"
2191 - fi
2192 - fi
2193 -
2194 - # Explicitly disable ICU data file support for system-icu/headless builds.
2195 - if use system-icu || use headless; then
2196 - myconf_gn+=" icu_use_data_file=false"
2197 - fi
2198 -
2199 - # Enable ozone wayland and/or headless support
2200 - myconf_gn+=" use_ozone=true ozone_auto_platforms=false"
2201 - myconf_gn+=" ozone_platform_headless=true"
2202 - if use headless; then
2203 - myconf_gn+=" ozone_platform=\"headless\""
2204 - myconf_gn+=" use_xkbcommon=false use_gtk=false use_qt=false"
2205 - myconf_gn+=" use_glib=false use_gio=false"
2206 - myconf_gn+=" use_pangocairo=false use_alsa=false"
2207 - myconf_gn+=" use_libpci=false use_udev=false"
2208 - myconf_gn+=" enable_print_preview=false"
2209 - myconf_gn+=" enable_remoting=false"
2210 - else
2211 - myconf_gn+=" use_system_libdrm=true"
2212 - myconf_gn+=" use_system_minigbm=true"
2213 - myconf_gn+=" use_xkbcommon=true"
2214 - myconf_gn+=" use_qt=$(usex qt5 true false)"
2215 - myconf_gn+=" ozone_platform_x11=$(usex X true false)"
2216 - myconf_gn+=" ozone_platform_wayland=$(usex wayland true false)"
2217 - myconf_gn+=" ozone_platform=$(usex wayland \"wayland\" \"x11\")"
2218 - if use wayland; then
2219 - myconf_gn+=" use_system_libwayland_server=true"
2220 - myconf_gn+=" use_system_wayland_scanner=true"
2221 - fi
2222 - fi
2223 -
2224 - # Results in undefined references in chrome linking, may require CFI to work
2225 - if use arm64; then
2226 - myconf_gn+=" arm_control_flow_integrity=\"none\""
2227 - fi
2228 -
2229 - # Enable official builds
2230 - myconf_gn+=" is_official_build=$(usex official true false)"
2231 - myconf_gn+=" use_thin_lto=$(usex lto true false)"
2232 - myconf_gn+=" thin_lto_enable_optimizations=$(usex lto true false)"
2233 - if use official; then
2234 - # Allow building against system libraries in official builds
2235 - sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \
2236 - tools/generate_shim_headers/generate_shim_headers.py || die
2237 - # Disable CFI: unsupported for GCC, requires clang+lto+lld
2238 - myconf_gn+=" is_cfi=false"
2239 - # Don't add symbols to build
2240 - myconf_gn+=" symbol_level=0"
2241 - fi
2242 -
2243 - if use pgo; then
2244 - myconf_gn+=" chrome_pgo_phase=${1}"
2245 - if [[ "$1" == "2" ]]; then
2246 - myconf_gn+=" pgo_data_path=\"${2}\""
2247 - fi
2248 - else
2249 - # Disable PGO, because profile data is only compatible with >=clang-11
2250 - myconf_gn+=" chrome_pgo_phase=0"
2251 - fi
2252 -
2253 - # user CXXFLAGS might overwrite -march=armv8-a+crc+crypto, bug #851639
2254 - if use arm64 && tc-is-gcc; then
2255 - sed -i '/^#if HAVE_ARM64_CRC32C/a #pragma GCC target ("+crc+crypto")' \
2256 - third_party/crc32c/src/src/crc32c_arm64.cc || die
2257 - fi
2258 -
2259 - # skipping typecheck is only supported on amd64, bug #876157
2260 - if ! use amd64; then
2261 - myconf_gn+=" devtools_skip_typecheck=false"
2262 - fi
2263 -
2264 - einfo "Configuring Chromium..."
2265 - set -- gn gen --args="${myconf_gn} ${EXTRA_GN}" out/Release
2266 - echo "$@"
2267 - "$@" || die
2268 -}
2269 -
2270 -src_configure() {
2271 - chromium_configure $(usex pgo 1 0)
2272 -}
2273 -
2274 -chromium_compile() {
2275 - # Final link uses lots of file descriptors.
2276 - ulimit -n 2048
2277 -
2278 - # Calling this here supports resumption via FEATURES=keepwork
2279 - python_setup
2280 -
2281 - # Don't inherit PYTHONPATH from environment, bug #789021, #812689
2282 - local -x PYTHONPATH=
2283 -
2284 - #"${EPYTHON}" tools/clang/scripts/update.py --force-local-build --gcc-toolchain /usr --skip-checkout --use-system-cmake --without-android || die
2285 -
2286 - # Build mksnapshot and pax-mark it.
2287 - local x
2288 - for x in mksnapshot v8_context_snapshot_generator; do
2289 - if tc-is-cross-compiler; then
2290 - eninja -C out/Release "host/${x}"
2291 - pax-mark m "out/Release/host/${x}"
2292 - else
2293 - eninja -C out/Release "${x}"
2294 - pax-mark m "out/Release/${x}"
2295 - fi
2296 - done
2297 -
2298 - # Even though ninja autodetects number of CPUs, we respect
2299 - # user's options, for debugging with -j 1 or any other reason.
2300 - eninja -C out/Release chrome chromedriver
2301 - use suid && eninja -C out/Release chrome_sandbox
2302 -
2303 - pax-mark m out/Release/chrome
2304 -}
2305 -
2306 -# This function is called from virtx, and must always return so that Xvfb
2307 -# session isn't left running. If we return 1, virtx will call die().
2308 -chromium_profile() {
2309 - einfo "Profiling for PGO"
2310 -
2311 - pushd "${WORKDIR}/chromium-profiler-"* >/dev/null || return 1
2312 -
2313 - # Remove old profdata in case profiling was interrupted.
2314 - rm -rf "${1}" || return 1
2315 -
2316 - if ! "${EPYTHON}" ./chromium_profiler.py \
2317 - --chrome-executable "${S}/out/Release/chrome" \
2318 - --chromedriver-executable "${S}/out/Release/chromedriver.unstripped" \
2319 - --add-arg no-sandbox --add-arg disable-dev-shm-usage \
2320 - --profile-output "${1}"; then
2321 - eerror "Profiling failed"
2322 - return 1
2323 - fi
2324 -
2325 - popd >/dev/null || return 1
2326 -}
2327 -
2328 -src_compile() {
2329 - if use pgo; then
2330 - local profdata
2331 -
2332 - profdata="${WORKDIR}/chromium.profdata"
2333 -
2334 - if [[ ! -e "${WORKDIR}/.pgo-profiled" ]]; then
2335 - chromium_compile
2336 - virtx chromium_profile "$profdata"
2337 -
2338 - touch "${WORKDIR}/.pgo-profiled" || die
2339 - fi
2340 -
2341 - if [[ ! -e "${WORKDIR}/.pgo-phase-2-configured" ]]; then
2342 - # Remove phase 1 output
2343 - rm -r out/Release || die
2344 -
2345 - chromium_configure 2 "$profdata"
2346 -
2347 - touch "${WORKDIR}/.pgo-phase-2-configured" || die
2348 - fi
2349 -
2350 - if [[ ! -e "${WORKDIR}/.pgo-phase-2-compiled" ]]; then
2351 - chromium_compile
2352 - touch "${WORKDIR}/.pgo-phase-2-compiled" || die
2353 - fi
2354 - else
2355 - chromium_compile
2356 - fi
2357 -
2358 - mv out/Release/chromedriver{.unstripped,} || die
2359 -
2360 - # Build manpage; bug #684550
2361 - sed -e 's|@@PACKAGE@@|chromium-browser|g;
2362 - s|@@MENUNAME@@|Chromium|g;' \
2363 - chrome/app/resources/manpage.1.in > \
2364 - out/Release/chromium-browser.1 || die
2365 -
2366 - # Build desktop file; bug #706786
2367 - sed -e 's|@@MENUNAME@@|Chromium|g;
2368 - s|@@USR_BIN_SYMLINK_NAME@@|chromium-browser|g;
2369 - s|@@PACKAGE@@|chromium-browser|g;
2370 - s|\(^Exec=\)/usr/bin/|\1|g;' \
2371 - chrome/installer/linux/common/desktop.template > \
2372 - out/Release/chromium-browser-chromium.desktop || die
2373 -
2374 - # Build vk_swiftshader_icd.json; bug #827861
2375 - sed -e 's|${ICD_LIBRARY_PATH}|./libvk_swiftshader.so|g' \
2376 - third_party/swiftshader/src/Vulkan/vk_swiftshader_icd.json.tmpl > \
2377 - out/Release/vk_swiftshader_icd.json || die
2378 -}
2379 -
2380 -src_install() {
2381 - local CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser"
2382 - exeinto "${CHROMIUM_HOME}"
2383 - doexe out/Release/chrome
2384 -
2385 - if use suid; then
2386 - newexe out/Release/chrome_sandbox chrome-sandbox
2387 - fperms 4755 "${CHROMIUM_HOME}/chrome-sandbox"
2388 - fi
2389 -
2390 - doexe out/Release/chromedriver
2391 - doexe out/Release/chrome_crashpad_handler
2392 -
2393 - ozone_auto_session () {
2394 - use X && use wayland && ! use headless && echo true || echo false
2395 - }
2396 - local sedargs=( -e
2397 - "s:/usr/lib/:/usr/$(get_libdir)/:g;
2398 - s:@@OZONE_AUTO_SESSION@@:$(ozone_auto_session):g"
2399 - )
2400 - sed "${sedargs[@]}" "${FILESDIR}/chromium-launcher-r7.sh" > chromium-launcher.sh || die
2401 - doexe chromium-launcher.sh
2402 -
2403 - # It is important that we name the target "chromium-browser",
2404 - # xdg-utils expect it; bug #355517.
2405 - dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser
2406 - # keep the old symlink around for consistency
2407 - dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium
2408 -
2409 - dosym "${CHROMIUM_HOME}/chromedriver" /usr/bin/chromedriver
2410 -
2411 - # Allow users to override command-line options, bug #357629.
2412 - insinto /etc/chromium
2413 - newins "${FILESDIR}/chromium.default" "default"
2414 -
2415 - pushd out/Release/locales > /dev/null || die
2416 - chromium_remove_language_paks
2417 - popd
2418 -
2419 - insinto "${CHROMIUM_HOME}"
2420 - doins out/Release/*.bin
2421 - doins out/Release/*.pak
2422 - (
2423 - shopt -s nullglob
2424 - local files=(out/Release/*.so out/Release/*.so.[0-9])
2425 - [[ ${#files[@]} -gt 0 ]] && doins "${files[@]}"
2426 - )
2427 -
2428 - if ! use system-icu && ! use headless; then
2429 - doins out/Release/icudtl.dat
2430 - fi
2431 -
2432 - doins -r out/Release/locales
2433 - doins -r out/Release/MEIPreload
2434 -
2435 - # Install vk_swiftshader_icd.json; bug #827861
2436 - doins out/Release/vk_swiftshader_icd.json
2437 -
2438 - if [[ -d out/Release/swiftshader ]]; then
2439 - insinto "${CHROMIUM_HOME}/swiftshader"
2440 - doins out/Release/swiftshader/*.so
2441 - fi
2442 -
2443 - # Install icons
2444 - local branding size
2445 - for size in 16 24 32 48 64 128 256 ; do
2446 - case ${size} in
2447 - 16|32) branding="chrome/app/theme/default_100_percent/chromium" ;;
2448 - *) branding="chrome/app/theme/chromium" ;;
2449 - esac
2450 - newicon -s ${size} "${branding}/product_logo_${size}.png" \
2451 - chromium-browser.png
2452 - done
2453 -
2454 - # Install desktop entry
2455 - domenu out/Release/chromium-browser-chromium.desktop
2456 -
2457 - # Install GNOME default application entry (bug #303100).
2458 - insinto /usr/share/gnome-control-center/default-apps
2459 - newins "${FILESDIR}"/chromium-browser.xml chromium-browser.xml
2460 -
2461 - # Install manpage; bug #684550
2462 - doman out/Release/chromium-browser.1
2463 - dosym chromium-browser.1 /usr/share/man/man1/chromium.1
2464 -
2465 - readme.gentoo_create_doc
2466 -}
2467 -
2468 -pkg_postrm() {
2469 - xdg_icon_cache_update
2470 - xdg_desktop_database_update
2471 -}
2472 -
2473 -pkg_postinst() {
2474 - xdg_icon_cache_update
2475 - xdg_desktop_database_update
2476 - readme.gentoo_print_elog
2477 -
2478 - if ! use headless; then
2479 - if use vaapi; then
2480 - elog "VA-API is disabled by default at runtime. You have to enable it"
2481 - elog "by adding --enable-features=VaapiVideoDecoder to CHROMIUM_FLAGS"
2482 - elog "in /etc/chromium/default."
2483 - fi
2484 - if use screencast; then
2485 - elog "Screencast is disabled by default at runtime. Either enable it"
2486 - elog "by navigating to chrome://flags/#enable-webrtc-pipewire-capturer"
2487 - elog "inside Chromium or add --enable-features=WebRTCPipeWireCapturer"
2488 - elog "to CHROMIUM_FLAGS in /etc/chromium/default."
2489 - fi
2490 - if use gtk4; then
2491 - elog "Chromium prefers GTK3 over GTK4 at runtime. To override this"
2492 - elog "behavior you need to pass --gtk-version=4, e.g. by adding it"
2493 - elog "to CHROMIUM_FLAGS in /etc/chromium/default."
2494 - fi
2495 - fi
2496 -}