Gentoo Archives: gentoo-commits

From: Stephan Hartmann <sultan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-client/chromium/
Date: Sat, 06 Feb 2021 20:36:24
Message-Id: 1612643771.3c1f81ab92ab5a316e96fed45505250f00c89135.sultan@gentoo
1 commit: 3c1f81ab92ab5a316e96fed45505250f00c89135
2 Author: Stephan Hartmann <sultan <AT> gentoo <DOT> org>
3 AuthorDate: Sat Feb 6 20:34:28 2021 +0000
4 Commit: Stephan Hartmann <sultan <AT> gentoo <DOT> org>
5 CommitDate: Sat Feb 6 20:36:11 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3c1f81ab
7
8 www-client/chromium: stable channel bump to 88.0.4324.150
9
10 Bug: https://bugs.gentoo.org/768459
11 Bug: https://bugs.gentoo.org/768831
12 Package-Manager: Portage-3.0.13, Repoman-3.0.2
13 Signed-off-by: Stephan Hartmann <sultan <AT> gentoo.org>
14
15 www-client/chromium/Manifest | 1 +
16 www-client/chromium/chromium-88.0.4324.150.ebuild | 901 ++++++++++++++++++++++
17 2 files changed, 902 insertions(+)
18
19 diff --git a/www-client/chromium/Manifest b/www-client/chromium/Manifest
20 index 6c669419994..a25d75add3e 100644
21 --- a/www-client/chromium/Manifest
22 +++ b/www-client/chromium/Manifest
23 @@ -1,4 +1,5 @@
24 DIST chromium-88-patchset-3.tar.xz 8396 BLAKE2B 4c978f1a6efef3f71e3dd6340c392b74bc6a734b49a9ca43343d03903159dafc66159939f9a6c4b55665ddbe7bd97a26d8d86c285ec02cf76cad5f5cc7410570 SHA512 c39afa26f5b0b9930f6f67ce0c42eefd74c09d528b26bc0db57129b150f75ff83c8b1cb97bd9c5d75f288fb4767cc68c9c5ce89231b4a59f8ca02493e4dd281a
25 +DIST chromium-88.0.4324.150.tar.xz 857377456 BLAKE2B 65f3d4a0f930743d04786a21c10561a93a2eb27c2c06d260495ead6ebf9344b2938f28c083a4077c9d2413f47cb083a83633b571ab1f54b25823fc8db18f504b SHA512 5e0419ce26e58b6ba30586c806fa3001f6c3c094e09c82fb08ed828a199c582308ce9bc0ea445aa0214d29710a586bf5a972553fbef5eab574fb0dc3ebe6280b
26 DIST chromium-88.0.4324.96.tar.xz 857138392 BLAKE2B 6c3136ff7bd0fe3cde3cfd9340804b5ddd9dd10f892870eac677a2364b8ddd8a6ab09770b167287e890b525d0ef572a5c03a1e8e28d1d16740043ae17ad56746 SHA512 f51e6dbbd4ea2b6528a601c1bd7e76820a4b614f05366d2999b4a30d8e13581279f69a1a76d3f417ae1cea38f9f834d011f754d078784a70388e2cde0ccba6b6
27 DIST chromium-89-patchset-6.tar.xz 4308 BLAKE2B 22e2db8b5e287925f8b550075e48ad381ccf7ef54e23d8f4e4aedff7fd6cfee8f9e70eff1edb8c867c256ee5ec881ef9379e18278b84b47ff08dcc00f5801667 SHA512 aa5d902c1959f50eb9a0d773a77bf12e5a955d796ee8b18f6e2143573dd73beec62109940e55a858fd9927753dba1d3bf9c1bd940b18a616e7b70b801e93f041
28 DIST chromium-89.0.4389.23.tar.xz 891010136 BLAKE2B 071f2d3b2962341b6bf9ead31dae04b1f71841593c22d5f7e2a407bcbf3a05f012f43f3baa9f167303789be4ea64cc3c80fd3e4b8049bd3faff8ff43569bfe5c SHA512 a7a58ffdf035bc8a7b3ebf40bf46a83be2689d7cfdbfd8476b356eaf7fe1f6e1fb61a14eb1c4d8474992c066a1eeef574644aa14d2fd34c2d53f84089427fc72
29
30 diff --git a/www-client/chromium/chromium-88.0.4324.150.ebuild b/www-client/chromium/chromium-88.0.4324.150.ebuild
31 new file mode 100644
32 index 00000000000..dd5a7157d26
33 --- /dev/null
34 +++ b/www-client/chromium/chromium-88.0.4324.150.ebuild
35 @@ -0,0 +1,901 @@
36 +# Copyright 2009-2021 Gentoo Authors
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +EAPI=7
40 +PYTHON_COMPAT=( python2_7 )
41 +PYTHON_REQ_USE="xml"
42 +
43 +CHROMIUM_LANGS="am ar bg bn ca cs da de el en-GB es es-419 et fa fi fil fr gu he
44 + hi hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt-BR pt-PT ro ru sk sl sr
45 + sv sw ta te th tr uk vi zh-CN zh-TW"
46 +
47 +inherit check-reqs chromium-2 desktop flag-o-matic multilib ninja-utils pax-utils portability python-any-r1 readme.gentoo-r1 toolchain-funcs xdg-utils
48 +
49 +DESCRIPTION="Open-source version of Google Chrome web browser"
50 +HOMEPAGE="https://chromium.org/"
51 +PATCHSET="3"
52 +PATCHSET_NAME="chromium-$(ver_cut 1)-patchset-${PATCHSET}"
53 +SRC_URI="https://commondatastorage.googleapis.com/chromium-browser-official/${P}.tar.xz
54 + https://files.pythonhosted.org/packages/ed/7b/bbf89ca71e722b7f9464ebffe4b5ee20a9e5c9a555a56e2d3914bb9119a6/setuptools-44.1.0.zip
55 + https://github.com/stha09/chromium-patches/releases/download/${PATCHSET_NAME}/${PATCHSET_NAME}.tar.xz"
56 +
57 +LICENSE="BSD"
58 +SLOT="0"
59 +KEYWORDS="~amd64 ~arm64 ~x86"
60 +IUSE="component-build cups cpu_flags_arm_neon +hangouts headless +js-type-check kerberos official pic +proprietary-codecs pulseaudio selinux +suid +system-ffmpeg +system-icu +tcmalloc vaapi wayland widevine"
61 +REQUIRED_USE="
62 + component-build? ( !suid )
63 +"
64 +
65 +COMMON_X_DEPEND="
66 + media-libs/mesa:=[gbm]
67 + x11-libs/libX11:=
68 + x11-libs/libXcomposite:=
69 + x11-libs/libXcursor:=
70 + x11-libs/libXdamage:=
71 + x11-libs/libXext:=
72 + x11-libs/libXfixes:=
73 + >=x11-libs/libXi-1.6.0:=
74 + x11-libs/libXrandr:=
75 + x11-libs/libXrender:=
76 + x11-libs/libXtst:=
77 + x11-libs/libXScrnSaver:=
78 + x11-libs/libxcb:=
79 + vaapi? ( >=x11-libs/libva-2.7:=[X,drm] )
80 +"
81 +
82 +COMMON_DEPEND="
83 + app-arch/bzip2:=
84 + cups? ( >=net-print/cups-1.3.11:= )
85 + dev-libs/expat:=
86 + dev-libs/glib:2
87 + >=dev-libs/libxml2-2.9.4-r3:=[icu]
88 + dev-libs/nspr:=
89 + >=dev-libs/nss-3.26:=
90 + >=media-libs/alsa-lib-1.0.19:=
91 + media-libs/fontconfig:=
92 + media-libs/freetype:=
93 + >=media-libs/harfbuzz-2.4.0:0=[icu(-)]
94 + media-libs/libjpeg-turbo:=
95 + media-libs/libpng:=
96 + pulseaudio? ( media-sound/pulseaudio:= )
97 + system-ffmpeg? (
98 + >=media-video/ffmpeg-4.3:=
99 + || (
100 + media-video/ffmpeg[-samba]
101 + >=net-fs/samba-4.5.10-r1[-debug(-)]
102 + )
103 + >=media-libs/opus-1.3.1:=
104 + )
105 + sys-apps/dbus:=
106 + sys-apps/pciutils:=
107 + virtual/udev
108 + x11-libs/cairo:=
109 + x11-libs/gdk-pixbuf:2
110 + x11-libs/pango:=
111 + media-libs/flac:=
112 + >=media-libs/libwebp-0.4.0:=
113 + sys-libs/zlib:=[minizip]
114 + kerberos? ( virtual/krb5 )
115 + !headless? (
116 + ${COMMON_X_DEPEND}
117 + >=app-accessibility/at-spi2-atk-2.26:2
118 + >=app-accessibility/at-spi2-core-2.26:2
119 + >=dev-libs/atk-2.26
120 + x11-libs/gtk+:3[X]
121 + wayland? (
122 + dev-libs/wayland:=
123 + dev-libs/libffi:=
124 + x11-libs/gtk+:3[wayland,X]
125 + x11-libs/libdrm:=
126 + x11-libs/libxkbcommon:=
127 + )
128 + )
129 +"
130 +# For nvidia-drivers blocker, see bug #413637 .
131 +RDEPEND="${COMMON_DEPEND}
132 + x11-misc/xdg-utils
133 + virtual/opengl
134 + virtual/ttf-fonts
135 + selinux? ( sec-policy/selinux-chromium )
136 + tcmalloc? ( !<x11-drivers/nvidia-drivers-331.20 )
137 +"
138 +DEPEND="${COMMON_DEPEND}
139 +"
140 +# dev-vcs/git - https://bugs.gentoo.org/593476
141 +BDEPEND="
142 + ${PYTHON_DEPS}
143 + >=app-arch/gzip-1.7
144 + app-arch/unzip
145 + dev-lang/perl
146 + >=dev-util/gn-0.1807
147 + dev-vcs/git
148 + >=dev-util/gperf-3.0.3
149 + >=dev-util/ninja-1.7.2
150 + >=net-libs/nodejs-7.6.0[inspector]
151 + sys-apps/hwids[usb(+)]
152 + >=sys-devel/bison-2.4.3
153 + sys-devel/flex
154 + virtual/pkgconfig
155 + js-type-check? ( virtual/jre )
156 +"
157 +
158 +# These are intended for ebuild maintainer use to force clang if GCC is broken.
159 +: ${CHROMIUM_FORCE_CLANG=no}
160 +: ${CHROMIUM_FORCE_LIBCXX=no}
161 +
162 +if [[ ${CHROMIUM_FORCE_CLANG} == yes ]]; then
163 + BDEPEND+=" >=sys-devel/clang-10"
164 +fi
165 +
166 +if [[ ${CHROMIUM_FORCE_LIBCXX} == yes ]]; then
167 + RDEPEND+=" >=sys-libs/libcxx-10"
168 + DEPEND+=" >=sys-libs/libcxx-10"
169 +else
170 + COMMON_DEPEND="
171 + app-arch/snappy:=
172 + dev-libs/libxslt:=
173 + >=dev-libs/re2-0.2019.08.01:=
174 + >=media-libs/openh264-1.6.0:=
175 + system-icu? ( >=dev-libs/icu-68.1:= )
176 + "
177 + RDEPEND+="${COMMON_DEPEND}"
178 + DEPEND+="${COMMON_DEPEND}"
179 +fi
180 +
181 +if ! has chromium_pkg_die ${EBUILD_DEATH_HOOKS}; then
182 + EBUILD_DEATH_HOOKS+=" chromium_pkg_die";
183 +fi
184 +
185 +DISABLE_AUTOFORMATTING="yes"
186 +DOC_CONTENTS="
187 +Some web pages may require additional fonts to display properly.
188 +Try installing some of the following packages if some characters
189 +are not displayed properly:
190 +- media-fonts/arphicfonts
191 +- media-fonts/droid
192 +- media-fonts/ipamonafont
193 +- media-fonts/noto
194 +- media-fonts/ja-ipafonts
195 +- media-fonts/takao-fonts
196 +- media-fonts/wqy-microhei
197 +- media-fonts/wqy-zenhei
198 +
199 +To fix broken icons on the Downloads page, you should install an icon
200 +theme that covers the appropriate MIME types, and configure this as your
201 +GTK+ icon theme.
202 +
203 +For native file dialogs in KDE, install kde-apps/kdialog.
204 +
205 +To make password storage work with your desktop environment you may
206 +have install one of the supported credentials management applications:
207 +- app-crypt/libsecret (GNOME)
208 +- kde-frameworks/kwallet (KDE)
209 +If you have one of above packages installed, but don't want to use
210 +them in Chromium, then add --password-store=basic to CHROMIUM_FLAGS
211 +in /etc/chromium/default.
212 +"
213 +
214 +pre_build_checks() {
215 + if [[ ${MERGE_TYPE} != binary ]]; then
216 + local -x CPP="$(tc-getCXX) -E"
217 + if tc-is-gcc && ! ver_test "$(gcc-version)" -ge 9.2; then
218 + die "At least gcc 9.2 is required"
219 + fi
220 + # component build hangs with tcmalloc enabled due to sandbox issue, bug #695976.
221 + if has usersandbox ${FEATURES} && use tcmalloc && use component-build; then
222 + die "Component build with tcmalloc requires FEATURES=-usersandbox."
223 + fi
224 + if [[ ${CHROMIUM_FORCE_CLANG} == yes ]] || tc-is-clang; then
225 + if use component-build; then
226 + die "Component build with clang requires fuzzer headers."
227 + fi
228 + fi
229 + fi
230 +
231 + # Check build requirements, bug #541816 and bug #471810 .
232 + CHECKREQS_MEMORY="3G"
233 + CHECKREQS_DISK_BUILD="7G"
234 + if ( shopt -s extglob; is-flagq '-g?(gdb)?([1-9])' ); then
235 + if use custom-cflags || use component-build; then
236 + CHECKREQS_DISK_BUILD="25G"
237 + fi
238 + if ! use component-build; then
239 + CHECKREQS_MEMORY="16G"
240 + fi
241 + fi
242 + check-reqs_pkg_setup
243 +}
244 +
245 +pkg_pretend() {
246 + pre_build_checks
247 +}
248 +
249 +pkg_setup() {
250 + pre_build_checks
251 +
252 + chromium_suid_sandbox_check_kernel_config
253 +
254 + # nvidia-drivers does not work correctly with Wayland due to unsupported EGLStreams
255 + if use wayland && ! use headless && has_version "x11-drivers/nvidia-drivers"; then
256 + ewarn "Proprietary nVidia driver does not work with Wayland. You can disable"
257 + ewarn "Wayland by setting DISABLE_OZONE_PLATFORM=true in /etc/chromium/default."
258 + fi
259 +}
260 +
261 +src_prepare() {
262 + # Calling this here supports resumption via FEATURES=keepwork
263 + python_setup
264 +
265 + rm "${WORKDIR}/patches/chromium-84-blink-disable-clang-format.patch" || die
266 +
267 + local PATCHES=(
268 + "${WORKDIR}/patches"
269 + "${FILESDIR}/chromium-88-ozone-deps.patch"
270 + "${FILESDIR}/chromium-87-webcodecs-deps.patch"
271 + )
272 +
273 + default
274 +
275 + mkdir -p third_party/node/linux/node-linux-x64/bin || die
276 + ln -s "${EPREFIX}"/usr/bin/node third_party/node/linux/node-linux-x64/bin/node || die
277 +
278 + local keeplibs=(
279 + base/third_party/cityhash
280 + base/third_party/double_conversion
281 + base/third_party/dynamic_annotations
282 + base/third_party/icu
283 + base/third_party/nspr
284 + base/third_party/superfasthash
285 + base/third_party/symbolize
286 + base/third_party/valgrind
287 + base/third_party/xdg_mime
288 + base/third_party/xdg_user_dirs
289 + buildtools/third_party/libc++
290 + buildtools/third_party/libc++abi
291 + chrome/third_party/mozilla_security_manager
292 + courgette/third_party
293 + net/third_party/mozilla_security_manager
294 + net/third_party/nss
295 + net/third_party/quic
296 + net/third_party/uri_template
297 + third_party/abseil-cpp
298 + third_party/angle
299 + third_party/angle/src/common/third_party/base
300 + third_party/angle/src/common/third_party/smhasher
301 + third_party/angle/src/common/third_party/xxhash
302 + third_party/angle/src/third_party/compiler
303 + third_party/angle/src/third_party/libXNVCtrl
304 + third_party/angle/src/third_party/trace_event
305 + third_party/angle/src/third_party/volk
306 + third_party/angle/third_party/glslang
307 + third_party/angle/third_party/spirv-headers
308 + third_party/angle/third_party/spirv-tools
309 + third_party/angle/third_party/vulkan-headers
310 + third_party/angle/third_party/vulkan-loader
311 + third_party/angle/third_party/vulkan-tools
312 + third_party/angle/third_party/vulkan-validation-layers
313 + third_party/apple_apsl
314 + third_party/axe-core
315 + third_party/blink
316 + third_party/boringssl
317 + third_party/boringssl/src/third_party/fiat
318 + third_party/breakpad
319 + third_party/breakpad/breakpad/src/third_party/curl
320 + third_party/brotli
321 + third_party/catapult
322 + third_party/catapult/common/py_vulcanize/third_party/rcssmin
323 + third_party/catapult/common/py_vulcanize/third_party/rjsmin
324 + third_party/catapult/third_party/beautifulsoup4
325 + third_party/catapult/third_party/html5lib-python
326 + third_party/catapult/third_party/polymer
327 + third_party/catapult/third_party/six
328 + third_party/catapult/tracing/third_party/d3
329 + third_party/catapult/tracing/third_party/gl-matrix
330 + third_party/catapult/tracing/third_party/jpeg-js
331 + third_party/catapult/tracing/third_party/jszip
332 + third_party/catapult/tracing/third_party/mannwhitneyu
333 + third_party/catapult/tracing/third_party/oboe
334 + third_party/catapult/tracing/third_party/pako
335 + third_party/ced
336 + third_party/cld_3
337 + third_party/closure_compiler
338 + third_party/crashpad
339 + third_party/crashpad/crashpad/third_party/lss
340 + third_party/crashpad/crashpad/third_party/zlib
341 + third_party/crc32c
342 + third_party/cros_system_api
343 + third_party/dav1d
344 + third_party/dawn
345 + third_party/dawn/third_party/khronos
346 + third_party/depot_tools
347 + third_party/devscripts
348 + third_party/devtools-frontend
349 + third_party/devtools-frontend/src/front_end/third_party/acorn
350 + third_party/devtools-frontend/src/front_end/third_party/axe-core
351 + third_party/devtools-frontend/src/front_end/third_party/chromium
352 + third_party/devtools-frontend/src/front_end/third_party/codemirror
353 + third_party/devtools-frontend/src/front_end/third_party/fabricjs
354 + third_party/devtools-frontend/src/front_end/third_party/i18n
355 + third_party/devtools-frontend/src/front_end/third_party/intl-messageformat
356 + third_party/devtools-frontend/src/front_end/third_party/lighthouse
357 + third_party/devtools-frontend/src/front_end/third_party/lit-html
358 + third_party/devtools-frontend/src/front_end/third_party/lodash-isequal
359 + third_party/devtools-frontend/src/front_end/third_party/marked
360 + third_party/devtools-frontend/src/front_end/third_party/puppeteer
361 + third_party/devtools-frontend/src/front_end/third_party/wasmparser
362 + third_party/devtools-frontend/src/third_party
363 + third_party/dom_distiller_js
364 + third_party/emoji-segmenter
365 + third_party/flatbuffers
366 + third_party/freetype
367 + third_party/fusejs
368 + third_party/libgifcodec
369 + third_party/glslang
370 + third_party/google_input_tools
371 + third_party/google_input_tools/third_party/closure_library
372 + third_party/google_input_tools/third_party/closure_library/third_party/closure
373 + third_party/googletest
374 + third_party/harfbuzz-ng/utils
375 + third_party/hunspell
376 + third_party/iccjpeg
377 + third_party/inspector_protocol
378 + third_party/jinja2
379 + third_party/jsoncpp
380 + third_party/jstemplate
381 + third_party/khronos
382 + third_party/leveldatabase
383 + third_party/libXNVCtrl
384 + third_party/libaddressinput
385 + third_party/libaom
386 + third_party/libaom/source/libaom/third_party/vector
387 + third_party/libaom/source/libaom/third_party/x86inc
388 + third_party/libavif
389 + third_party/libjingle
390 + third_party/libphonenumber
391 + third_party/libsecret
392 + third_party/libsrtp
393 + third_party/libsync
394 + third_party/libudev
395 + third_party/libvpx
396 + third_party/libvpx/source/libvpx/third_party/x86inc
397 + third_party/libwebm
398 + third_party/libx11
399 + third_party/libxcb-keysyms
400 + third_party/libxml/chromium
401 + third_party/libyuv
402 + third_party/llvm
403 + third_party/lottie
404 + third_party/lss
405 + third_party/lzma_sdk
406 + third_party/mako
407 + third_party/markupsafe
408 + third_party/mesa
409 + third_party/metrics_proto
410 + third_party/modp_b64
411 + third_party/nasm
412 + third_party/nearby
413 + third_party/node
414 + third_party/node/node_modules/polymer-bundler/lib/third_party/UglifyJS2
415 + third_party/one_euro_filter
416 + third_party/opencv
417 + third_party/openscreen
418 + third_party/openscreen/src/third_party/mozilla
419 + third_party/openscreen/src/third_party/tinycbor/src/src
420 + third_party/ots
421 + third_party/pdfium
422 + third_party/pdfium/third_party/agg23
423 + third_party/pdfium/third_party/base
424 + third_party/pdfium/third_party/bigint
425 + third_party/pdfium/third_party/freetype
426 + third_party/pdfium/third_party/lcms
427 + third_party/pdfium/third_party/libopenjpeg20
428 + third_party/pdfium/third_party/libpng16
429 + third_party/pdfium/third_party/libtiff
430 + third_party/pdfium/third_party/skia_shared
431 + third_party/perfetto
432 + third_party/pffft
433 + third_party/ply
434 + third_party/polymer
435 + third_party/private-join-and-compute
436 + third_party/private_membership
437 + third_party/protobuf
438 + third_party/protobuf/third_party/six
439 + third_party/pyjson5
440 + third_party/qcms
441 + third_party/rnnoise
442 + third_party/s2cellid
443 + third_party/schema_org
444 + third_party/securemessage
445 + third_party/shaka-player
446 + third_party/shell-encryption
447 + third_party/simplejson
448 + third_party/skia
449 + third_party/skia/include/third_party/skcms
450 + third_party/skia/include/third_party/vulkan
451 + third_party/skia/third_party/skcms
452 + third_party/skia/third_party/vulkan
453 + third_party/smhasher
454 + third_party/spirv-cross/spirv-cross
455 + third_party/spirv-headers
456 + third_party/SPIRV-Tools
457 + third_party/sqlite
458 + third_party/swiftshader
459 + third_party/swiftshader/third_party/astc-encoder
460 + third_party/swiftshader/third_party/llvm-subzero
461 + third_party/swiftshader/third_party/marl
462 + third_party/swiftshader/third_party/subzero
463 + third_party/swiftshader/third_party/SPIRV-Headers/include/spirv/unified1
464 + third_party/tint
465 + third_party/ukey2
466 + third_party/unrar
467 + third_party/usrsctp
468 + third_party/vulkan
469 + third_party/web-animations-js
470 + third_party/webdriver
471 + third_party/webrtc
472 + third_party/webrtc/common_audio/third_party/ooura
473 + third_party/webrtc/common_audio/third_party/spl_sqrt_floor
474 + third_party/webrtc/modules/third_party/fft
475 + third_party/webrtc/modules/third_party/g711
476 + third_party/webrtc/modules/third_party/g722
477 + third_party/webrtc/rtc_base/third_party/base64
478 + third_party/webrtc/rtc_base/third_party/sigslot
479 + third_party/widevine
480 + third_party/woff2
481 + third_party/wuffs
482 + third_party/x11proto
483 + third_party/xcbproto
484 + third_party/zxcvbn-cpp
485 + third_party/zlib/google
486 + tools/grit/third_party/six
487 + url/third_party/mozilla
488 + v8/src/third_party/siphash
489 + v8/src/third_party/valgrind
490 + v8/src/third_party/utf8-decoder
491 + v8/third_party/inspector_protocol
492 + v8/third_party/v8
493 +
494 + # gyp -> gn leftovers
495 + base/third_party/libevent
496 + third_party/adobe
497 + third_party/speech-dispatcher
498 + third_party/usb_ids
499 + third_party/xdg-utils
500 + )
501 + if ! use system-ffmpeg; then
502 + keeplibs+=( third_party/ffmpeg third_party/opus )
503 + fi
504 + if ! use system-icu; then
505 + keeplibs+=( third_party/icu )
506 + fi
507 + if use tcmalloc; then
508 + keeplibs+=( third_party/tcmalloc )
509 + fi
510 + if use wayland && ! use headless ; then
511 + keeplibs+=( third_party/wayland )
512 + fi
513 + if [[ ${CHROMIUM_FORCE_LIBCXX} == yes ]]; then
514 + keeplibs+=( third_party/libxml )
515 + keeplibs+=( third_party/libxslt )
516 + keeplibs+=( third_party/openh264 )
517 + keeplibs+=( third_party/re2 )
518 + keeplibs+=( third_party/snappy )
519 + if use system-icu; then
520 + keeplibs+=( third_party/icu )
521 + fi
522 + fi
523 + if use arm64 || use ppc64 ; then
524 + keeplibs+=( third_party/swiftshader/third_party/llvm-10.0 )
525 + fi
526 + # we need to generate ppc64 stuff because upstream does not ship it yet
527 + # it has to be done before unbundling.
528 + if use ppc64; then
529 + pushd third_party/libvpx >/dev/null || die
530 + mkdir -p source/config/linux/ppc64 || die
531 + ./generate_gni.sh || die
532 + popd >/dev/null || die
533 + fi
534 +
535 + # Remove most bundled libraries. Some are still needed.
536 + build/linux/unbundle/remove_bundled_libraries.py "${keeplibs[@]}" --do-remove || die
537 +}
538 +
539 +src_configure() {
540 + # Calling this here supports resumption via FEATURES=keepwork
541 + python_setup
542 +
543 + local myconf_gn=""
544 +
545 + # Make sure the build system will use the right tools, bug #340795.
546 + tc-export AR CC CXX NM
547 +
548 + if [[ ${CHROMIUM_FORCE_CLANG} == yes ]] && ! tc-is-clang; then
549 + # Force clang since gcc is pretty broken at the moment.
550 + CC=${CHOST}-clang
551 + CXX=${CHOST}-clang++
552 + strip-unsupported-flags
553 + fi
554 +
555 + if tc-is-clang; then
556 + myconf_gn+=" is_clang=true clang_use_chrome_plugins=false"
557 + else
558 + if [[ ${CHROMIUM_FORCE_LIBCXX} == yes ]]; then
559 + die "Compiling with sys-libs/libcxx requires clang."
560 + fi
561 + myconf_gn+=" is_clang=false"
562 + fi
563 +
564 + # Define a custom toolchain for GN
565 + myconf_gn+=" custom_toolchain=\"//build/toolchain/linux/unbundle:default\""
566 +
567 + if tc-is-cross-compiler; then
568 + tc-export BUILD_{AR,CC,CXX,NM}
569 + myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:host\""
570 + myconf_gn+=" v8_snapshot_toolchain=\"//build/toolchain/linux/unbundle:host\""
571 + else
572 + myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:default\""
573 + fi
574 +
575 + # GN needs explicit config for Debug/Release as opposed to inferring it from build directory.
576 + myconf_gn+=" is_debug=false"
577 +
578 + # Component build isn't generally intended for use by end users. It's mostly useful
579 + # for development and debugging.
580 + myconf_gn+=" is_component_build=$(usex component-build true false)"
581 +
582 + myconf_gn+=" use_allocator=$(usex tcmalloc \"tcmalloc\" \"none\")"
583 +
584 + # Disable nacl, we can't build without pnacl (http://crbug.com/269560).
585 + myconf_gn+=" enable_nacl=false"
586 +
587 + # Use system-provided libraries.
588 + # TODO: freetype -- remove sources (https://bugs.chromium.org/p/pdfium/issues/detail?id=733).
589 + # TODO: use_system_hunspell (upstream changes needed).
590 + # TODO: use_system_libsrtp (bug #459932).
591 + # TODO: use_system_protobuf (bug #525560).
592 + # TODO: use_system_ssl (http://crbug.com/58087).
593 + # TODO: use_system_sqlite (http://crbug.com/22208).
594 +
595 + # libevent: https://bugs.gentoo.org/593458
596 + local gn_system_libraries=(
597 + flac
598 + fontconfig
599 + freetype
600 + # Need harfbuzz_from_pkgconfig target
601 + #harfbuzz-ng
602 + libdrm
603 + libjpeg
604 + libpng
605 + libwebp
606 + zlib
607 + )
608 + if use system-ffmpeg; then
609 + gn_system_libraries+=( ffmpeg opus )
610 + fi
611 + if use system-icu; then
612 + gn_system_libraries+=( icu )
613 + fi
614 + if [[ ${CHROMIUM_FORCE_LIBCXX} != yes ]]; then
615 + # unbundle only without libc++, because libc++ is not fully ABI compatible with libstdc++
616 + gn_system_libraries+=( libxml )
617 + gn_system_libraries+=( libxslt )
618 + gn_system_libraries+=( openh264 )
619 + gn_system_libraries+=( re2 )
620 + gn_system_libraries+=( snappy )
621 + fi
622 + build/linux/unbundle/replace_gn_files.py --system-libraries "${gn_system_libraries[@]}" || die
623 +
624 + # See dependency logic in third_party/BUILD.gn
625 + myconf_gn+=" use_system_harfbuzz=true"
626 +
627 + # Disable deprecated libgnome-keyring dependency, bug #713012
628 + myconf_gn+=" use_gnome_keyring=false"
629 +
630 + # Optional dependencies.
631 + myconf_gn+=" enable_js_type_check=$(usex js-type-check true false)"
632 + myconf_gn+=" enable_hangout_services_extension=$(usex hangouts true false)"
633 + myconf_gn+=" enable_widevine=$(usex widevine true false)"
634 + myconf_gn+=" use_cups=$(usex cups true false)"
635 + myconf_gn+=" use_kerberos=$(usex kerberos true false)"
636 + myconf_gn+=" use_pulseaudio=$(usex pulseaudio true false)"
637 + myconf_gn+=" use_vaapi=$(usex vaapi true false)"
638 +
639 + # TODO: link_pulseaudio=true for GN.
640 +
641 + myconf_gn+=" fieldtrial_testing_like_official_build=true"
642 +
643 + # Never use bundled gold binary. Disable gold linker flags for now.
644 + # Do not use bundled clang.
645 + # Trying to use gold results in linker crash.
646 + myconf_gn+=" use_gold=false use_sysroot=false use_custom_libcxx=false"
647 +
648 + # Disable forced lld, bug 641556
649 + myconf_gn+=" use_lld=false"
650 +
651 + ffmpeg_branding="$(usex proprietary-codecs Chrome Chromium)"
652 + myconf_gn+=" proprietary_codecs=$(usex proprietary-codecs true false)"
653 + myconf_gn+=" ffmpeg_branding=\"${ffmpeg_branding}\""
654 +
655 + # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys .
656 + # Note: these are for Gentoo use ONLY. For your own distribution,
657 + # please get your own set of keys. Feel free to contact chromium@g.o
658 + # for more info.
659 + local google_api_key="AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc"
660 + local google_default_client_id="329227923882.apps.googleusercontent.com"
661 + local google_default_client_secret="vgKG0NNv7GoDpbtoFNLxCUXu"
662 + myconf_gn+=" google_api_key=\"${google_api_key}\""
663 + myconf_gn+=" google_default_client_id=\"${google_default_client_id}\""
664 + myconf_gn+=" google_default_client_secret=\"${google_default_client_secret}\""
665 + local myarch="$(tc-arch)"
666 +
667 + # Avoid CFLAGS problems, bug #352457, bug #390147.
668 + if ! use custom-cflags; then
669 + replace-flags "-Os" "-O2"
670 + strip-flags
671 +
672 + # Debug info section overflows without component build
673 + # Prevent linker from running out of address space, bug #471810 .
674 + if ! use component-build || use x86; then
675 + filter-flags "-g*"
676 + fi
677 +
678 + # Prevent libvpx build failures. Bug 530248, 544702, 546984.
679 + if [[ ${myarch} == amd64 || ${myarch} == x86 ]]; then
680 + filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 -mno-avx -mno-avx2 -mno-fma -mno-fma4
681 + fi
682 + fi
683 +
684 + if [[ ${CHROMIUM_FORCE_LIBCXX} == yes ]]; then
685 + append-flags -stdlib=libc++
686 + append-ldflags -stdlib=libc++
687 + fi
688 +
689 + if [[ $myarch = amd64 ]] ; then
690 + myconf_gn+=" target_cpu=\"x64\""
691 + ffmpeg_target_arch=x64
692 + elif [[ $myarch = x86 ]] ; then
693 + myconf_gn+=" target_cpu=\"x86\""
694 + ffmpeg_target_arch=ia32
695 +
696 + # This is normally defined by compiler_cpu_abi in
697 + # build/config/compiler/BUILD.gn, but we patch that part out.
698 + append-flags -msse2 -mfpmath=sse -mmmx
699 + elif [[ $myarch = arm64 ]] ; then
700 + myconf_gn+=" target_cpu=\"arm64\""
701 + ffmpeg_target_arch=arm64
702 + elif [[ $myarch = arm ]] ; then
703 + myconf_gn+=" target_cpu=\"arm\""
704 + ffmpeg_target_arch=$(usex cpu_flags_arm_neon arm-neon arm)
705 + elif [[ $myarch = ppc64 ]] ; then
706 + myconf_gn+=" target_cpu=\"ppc64\""
707 + ffmpeg_target_arch=ppc64
708 + else
709 + die "Failed to determine target arch, got '$myarch'."
710 + fi
711 +
712 + # Make sure that -Werror doesn't get added to CFLAGS by the build system.
713 + # Depending on GCC version the warnings are different and we don't want
714 + # the build to fail because of that.
715 + myconf_gn+=" treat_warnings_as_errors=false"
716 +
717 + # Disable fatal linker warnings, bug 506268.
718 + myconf_gn+=" fatal_linker_warnings=false"
719 +
720 + # Bug 491582.
721 + export TMPDIR="${WORKDIR}/temp"
722 + mkdir -p -m 755 "${TMPDIR}" || die
723 +
724 + # https://bugs.gentoo.org/654216
725 + addpredict /dev/dri/ #nowarn
726 +
727 + #if ! use system-ffmpeg; then
728 + if false; then
729 + local build_ffmpeg_args=""
730 + if use pic && [[ "${ffmpeg_target_arch}" == "ia32" ]]; then
731 + build_ffmpeg_args+=" --disable-asm"
732 + fi
733 +
734 + # Re-configure bundled ffmpeg. See bug #491378 for example reasons.
735 + einfo "Configuring bundled ffmpeg..."
736 + pushd third_party/ffmpeg > /dev/null || die
737 + chromium/scripts/build_ffmpeg.py linux ${ffmpeg_target_arch} \
738 + --branding ${ffmpeg_branding} -- ${build_ffmpeg_args} || die
739 + chromium/scripts/copy_config.sh || die
740 + chromium/scripts/generate_gn.py || die
741 + popd > /dev/null || die
742 + fi
743 +
744 + # Chromium relies on this, but was disabled in >=clang-10, crbug.com/1042470
745 + append-cxxflags $(test-flags-CXX -flax-vector-conversions=all)
746 +
747 + # Disable unknown warning message from clang.
748 + tc-is-clang && append-flags -Wno-unknown-warning-option
749 +
750 + # Explicitly disable ICU data file support for system-icu builds.
751 + if use system-icu; then
752 + myconf_gn+=" icu_use_data_file=false"
753 + fi
754 +
755 + # Enable ozone wayland and/or headless support
756 + if use wayland || use headless; then
757 + myconf_gn+=" use_ozone=true ozone_auto_platforms=false"
758 + myconf_gn+=" ozone_platform_headless=true"
759 + if use headless; then
760 + myconf_gn+=" ozone_platform=\"headless\""
761 + myconf_gn+=" use_x11=false"
762 + else
763 + myconf_gn+=" ozone_platform_wayland=true"
764 + myconf_gn+=" use_system_libdrm=true"
765 + myconf_gn+=" use_system_minigbm=true"
766 + myconf_gn+=" use_xkbcommon=true"
767 + myconf_gn+=" ozone_platform=\"wayland\""
768 + fi
769 + else
770 + myconf_gn+=" use_ozone=false"
771 + fi
772 +
773 + # Enable official builds
774 + myconf_gn+=" is_official_build=$(usex official true false)"
775 + if use official; then
776 + # Allow building against system libraries in official builds
777 + sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \
778 + tools/generate_shim_headers/generate_shim_headers.py || die
779 + # Disable CFI: unsupported for GCC, requires clang+lto+lld
780 + myconf_gn+=" is_cfi=false"
781 + # Disable PGO, because profile data is missing in tarball
782 + # (https://groups.google.com/a/chromium.org/g/chromium-packagers/c/2ID9c4j6UkY)
783 + myconf_gn+=" chrome_pgo_phase=0"
784 + fi
785 +
786 + einfo "Configuring Chromium..."
787 + set -- gn gen --args="${myconf_gn} ${EXTRA_GN}" out/Release
788 + echo "$@"
789 + "$@" || die
790 +}
791 +
792 +src_compile() {
793 + # Final link uses lots of file descriptors.
794 + ulimit -n 2048
795 +
796 + # Calling this here supports resumption via FEATURES=keepwork
797 + python_setup
798 +
799 + # https://bugs.gentoo.org/717456
800 + local -x PYTHONPATH="${WORKDIR}/setuptools-44.1.0:${PYTHONPATH+:}${PYTHONPATH}"
801 +
802 + #"${EPYTHON}" tools/clang/scripts/update.py --force-local-build --gcc-toolchain /usr --skip-checkout --use-system-cmake --without-android || die
803 +
804 + # Build mksnapshot and pax-mark it.
805 + local x
806 + for x in mksnapshot v8_context_snapshot_generator; do
807 + if tc-is-cross-compiler; then
808 + eninja -C out/Release "host/${x}"
809 + pax-mark m "out/Release/host/${x}"
810 + else
811 + eninja -C out/Release "${x}"
812 + pax-mark m "out/Release/${x}"
813 + fi
814 + done
815 +
816 + # Even though ninja autodetects number of CPUs, we respect
817 + # user's options, for debugging with -j 1 or any other reason.
818 + eninja -C out/Release chrome chromedriver
819 + use suid && eninja -C out/Release chrome_sandbox
820 +
821 + pax-mark m out/Release/chrome
822 +
823 + # Build manpage; bug #684550
824 + sed -e 's|@@PACKAGE@@|chromium-browser|g;
825 + s|@@MENUNAME@@|Chromium|g;' \
826 + chrome/app/resources/manpage.1.in > \
827 + out/Release/chromium-browser.1 || die
828 +
829 + # Build desktop file; bug #706786
830 + sed -e 's|@@MENUNAME@@|Chromium|g;
831 + s|@@USR_BIN_SYMLINK_NAME@@|chromium-browser|g;
832 + s|@@PACKAGE@@|chromium-browser|g;
833 + s|\(^Exec=\)/usr/bin/|\1|g;' \
834 + chrome/installer/linux/common/desktop.template > \
835 + out/Release/chromium-browser-chromium.desktop || die
836 +}
837 +
838 +src_install() {
839 + local CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser"
840 + exeinto "${CHROMIUM_HOME}"
841 + doexe out/Release/chrome
842 +
843 + if use suid; then
844 + newexe out/Release/chrome_sandbox chrome-sandbox
845 + fperms 4755 "${CHROMIUM_HOME}/chrome-sandbox"
846 + fi
847 +
848 + doexe out/Release/chromedriver
849 +
850 + local sedargs=( -e
851 + "s:/usr/lib/:/usr/$(get_libdir)/:g;
852 + s:@@OZONE_AUTO_SESSION@@:$(usex wayland true false):g;
853 + s:@@FORCE_OZONE_PLATFORM@@:$(usex headless true false):g"
854 + )
855 + sed "${sedargs[@]}" "${FILESDIR}/chromium-launcher-r6.sh" > chromium-launcher.sh || die
856 + doexe chromium-launcher.sh
857 +
858 + # It is important that we name the target "chromium-browser",
859 + # xdg-utils expect it; bug #355517.
860 + dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser
861 + # keep the old symlink around for consistency
862 + dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium
863 +
864 + dosym "${CHROMIUM_HOME}/chromedriver" /usr/bin/chromedriver
865 +
866 + # Allow users to override command-line options, bug #357629.
867 + insinto /etc/chromium
868 + newins "${FILESDIR}/chromium.default" "default"
869 +
870 + pushd out/Release/locales > /dev/null || die
871 + chromium_remove_language_paks
872 + popd
873 +
874 + insinto "${CHROMIUM_HOME}"
875 + doins out/Release/*.bin
876 + doins out/Release/*.pak
877 + (
878 + shopt -s nullglob
879 + local files=(out/Release/*.so)
880 + [[ ${#files[@]} -gt 0 ]] && doins "${files[@]}"
881 + )
882 +
883 + if ! use system-icu; then
884 + doins out/Release/icudtl.dat
885 + fi
886 +
887 + doins -r out/Release/locales
888 + doins -r out/Release/resources
889 +
890 + if [[ -d out/Release/swiftshader ]]; then
891 + insinto "${CHROMIUM_HOME}/swiftshader"
892 + doins out/Release/swiftshader/*.so
893 + fi
894 +
895 + # Install icons
896 + local branding size
897 + for size in 16 24 32 48 64 128 256 ; do
898 + case ${size} in
899 + 16|32) branding="chrome/app/theme/default_100_percent/chromium" ;;
900 + *) branding="chrome/app/theme/chromium" ;;
901 + esac
902 + newicon -s ${size} "${branding}/product_logo_${size}.png" \
903 + chromium-browser.png
904 + done
905 +
906 + # Install desktop entry
907 + domenu out/Release/chromium-browser-chromium.desktop
908 +
909 + # Install GNOME default application entry (bug #303100).
910 + insinto /usr/share/gnome-control-center/default-apps
911 + newins "${FILESDIR}"/chromium-browser.xml chromium-browser.xml
912 +
913 + # Install manpage; bug #684550
914 + doman out/Release/chromium-browser.1
915 + dosym chromium-browser.1 /usr/share/man/man1/chromium.1
916 +
917 + readme.gentoo_create_doc
918 +}
919 +
920 +pkg_postrm() {
921 + xdg_icon_cache_update
922 + xdg_desktop_database_update
923 +}
924 +
925 +pkg_postinst() {
926 + xdg_icon_cache_update
927 + xdg_desktop_database_update
928 + readme.gentoo_print_elog
929 +
930 + if use vaapi; then
931 + elog "VA-API is disabled by default at runtime. Either enable it"
932 + elog "by navigating to chrome://flags/#enable-accelerated-video-decode"
933 + elog "inside Chromium or add --enable-accelerated-video-decode"
934 + elog "to CHROMIUM_FLAGS in /etc/chromium/default."
935 + fi
936 +}