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