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