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/, www-client/chromium/files/
Date: Sun, 30 Sep 2018 21:28:31
Message-Id: 1538342900.f74d5c2bf0a8b39abb9de39588e45a6dc1e2dbb2.floppym@gentoo
1 commit: f74d5c2bf0a8b39abb9de39588e45a6dc1e2dbb2
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Sun Sep 30 21:26:36 2018 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Sun Sep 30 21:28:20 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f74d5c2b
7
8 www-client/chromium: dev channel bump (71.0.3559.6)
9
10 Package-Manager: Portage-2.3.50_p10, Repoman-2.3.11_p17
11 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
12
13 www-client/chromium/Manifest | 1 +
14 www-client/chromium/chromium-71.0.3559.6.ebuild | 693 +++++++++++++++++++++
15 .../chromium/files/chromium-compiler-r5.patch | 167 +++++
16 3 files changed, 861 insertions(+)
17
18 diff --git a/www-client/chromium/Manifest b/www-client/chromium/Manifest
19 index 323194c86e8..0fe4a3695cf 100644
20 --- a/www-client/chromium/Manifest
21 +++ b/www-client/chromium/Manifest
22 @@ -2,3 +2,4 @@ DIST chromium-69.0.3497.100.tar.xz 617374764 BLAKE2B 45805e7a743982c167974cbe223
23 DIST chromium-70.0.3538.22.tar.xz 622935696 BLAKE2B d2eb7f72aa9967d2620a705549c13d081aa5b011d47536ca3e1aa77989a9723a6187dab0d0c31c6f4e50469b05960411c8635c24cc9e58a5ed2651c5affb13d9 SHA512 5af260a217734965e4475211646a992b0c568e81610f552c13773082055ee7cc3356f9d60b85abc118e7d7866c903ddc6f4e64d1f0c4126cba19d886dc79b189
24 DIST chromium-70.0.3538.35.tar.xz 622959384 BLAKE2B 1b32897a08a63e6e1a4bcabef97d5b92a568632014b1c197ae76da6f1a6fb76f0ef93b50d41556d27943c72e8b7cefd36249cdd08204992abb54742c63b4c00f SHA512 e4539ab964d95cc56c5c7d963787207b5e2c50a8aa12ac5e6d1e71f35be3adf60881b63f4c189c53f3f80bc69779556d61365afa2d8db43dba4a7bbd781591d9
25 DIST chromium-71.0.3554.4.tar.xz 626667348 BLAKE2B 4cdbd7041fd087c860bfc5c731073713ac01059fa388de10684058a81178d007e6fe2ad2bf6ce58a44b5489b24ded1a29862f98dd8f9ec8484e5e0d9d7a2e38e SHA512 ad4c6bc8ab857bf1a928b959129f5b64c1333f109cc7a5482f3bea3cab070faee85e41128acc4d9e479a312dd66ec201cf115e2dd8e35587f1bdd95ff78dfd18
26 +DIST chromium-71.0.3559.6.tar.xz 626881656 BLAKE2B 4712e7bb9c7018ed4ace7f8d7d7c313e26c6a156c937084f5553e18bd38edd98536b09e867718ed1e9e561c3f39ddc6de4802b780e33d72f1329f636fa356250 SHA512 12ba43ee94aa185d13035c01755b0166082fe4831f1787e755de11a9b6121c0384eb04352f0582659a23908acc4544db359a30e0f22715d69f357c8a1baa3aac
27
28 diff --git a/www-client/chromium/chromium-71.0.3559.6.ebuild b/www-client/chromium/chromium-71.0.3559.6.ebuild
29 new file mode 100644
30 index 00000000000..c458dff8774
31 --- /dev/null
32 +++ b/www-client/chromium/chromium-71.0.3559.6.ebuild
33 @@ -0,0 +1,693 @@
34 +# Copyright 1999-2018 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI="6"
38 +PYTHON_COMPAT=( python2_7 )
39 +
40 +CHROMIUM_LANGS="am ar bg bn ca cs da de el en-GB es es-419 et fa fi fil fr gu he
41 + 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
42 + sv sw ta te th tr uk vi zh-CN zh-TW"
43 +
44 +inherit check-reqs chromium-2 eutils gnome2-utils flag-o-matic multilib ninja-utils pax-utils portability python-any-r1 readme.gentoo-r1 toolchain-funcs xdg-utils
45 +
46 +DESCRIPTION="Open-source version of Google Chrome web browser"
47 +HOMEPAGE="http://chromium.org/"
48 +SRC_URI="https://commondatastorage.googleapis.com/chromium-browser-official/${P}.tar.xz"
49 +
50 +LICENSE="BSD"
51 +SLOT="0"
52 +KEYWORDS="~amd64 ~x86"
53 +IUSE="component-build cups gnome-keyring +hangouts jumbo-build kerberos neon pic +proprietary-codecs pulseaudio selinux +suid +system-ffmpeg +system-icu +system-libvpx +tcmalloc widevine"
54 +RESTRICT="!system-ffmpeg? ( proprietary-codecs? ( bindist ) )"
55 +
56 +COMMON_DEPEND="
57 + app-accessibility/at-spi2-atk:2
58 + app-arch/bzip2:=
59 + cups? ( >=net-print/cups-1.3.11:= )
60 + dev-libs/atk
61 + dev-libs/expat:=
62 + dev-libs/glib:2
63 + system-icu? ( >=dev-libs/icu-59:= )
64 + >=dev-libs/libxml2-2.9.4-r3:=[icu]
65 + dev-libs/libxslt:=
66 + dev-libs/nspr:=
67 + >=dev-libs/nss-3.26:=
68 + >=dev-libs/re2-0.2016.05.01:=
69 + gnome-keyring? ( >=gnome-base/libgnome-keyring-3.12:= )
70 + >=media-libs/alsa-lib-1.0.19:=
71 + media-libs/fontconfig:=
72 + media-libs/freetype:=
73 + >=media-libs/harfbuzz-1.8.8:=[icu(-)]
74 + media-libs/libjpeg-turbo:=
75 + media-libs/libpng:=
76 + system-libvpx? ( media-libs/libvpx:=[postproc,svc] )
77 + >=media-libs/openh264-1.6.0:=
78 + pulseaudio? ( media-sound/pulseaudio:= )
79 + system-ffmpeg? (
80 + >=media-video/ffmpeg-4:=
81 + || (
82 + media-video/ffmpeg[-samba]
83 + >=net-fs/samba-4.5.10-r1[-debug(-)]
84 + )
85 + !=net-fs/samba-4.5.12-r0
86 + media-libs/opus:=
87 + )
88 + sys-apps/dbus:=
89 + sys-apps/pciutils:=
90 + virtual/udev
91 + x11-libs/cairo:=
92 + x11-libs/gdk-pixbuf:2
93 + x11-libs/gtk+:3[X]
94 + x11-libs/libX11:=
95 + x11-libs/libXcomposite:=
96 + x11-libs/libXcursor:=
97 + x11-libs/libXdamage:=
98 + x11-libs/libXext:=
99 + x11-libs/libXfixes:=
100 + >=x11-libs/libXi-1.6.0:=
101 + x11-libs/libXrandr:=
102 + x11-libs/libXrender:=
103 + x11-libs/libXScrnSaver:=
104 + x11-libs/libXtst:=
105 + x11-libs/pango:=
106 + app-arch/snappy:=
107 + media-libs/flac:=
108 + >=media-libs/libwebp-0.4.0:=
109 + sys-libs/zlib:=[minizip]
110 + kerberos? ( virtual/krb5 )
111 +"
112 +# For nvidia-drivers blocker, see bug #413637 .
113 +RDEPEND="${COMMON_DEPEND}
114 + !<www-plugins/chrome-binary-plugins-57
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 + widevine? ( www-plugins/chrome-binary-plugins[widevine(-)] )
121 +"
122 +# dev-vcs/git - https://bugs.gentoo.org/593476
123 +# sys-apps/sandbox - https://crbug.com/586444
124 +DEPEND="${COMMON_DEPEND}
125 + >=app-arch/gzip-1.7
126 + !arm? (
127 + dev-lang/yasm
128 + )
129 + dev-lang/perl
130 + dev-util/gn
131 + >=dev-util/gperf-3.0.3
132 + >=dev-util/ninja-1.7.2
133 + >=net-libs/nodejs-7.6.0[inspector]
134 + sys-apps/hwids[usb(+)]
135 + >=sys-devel/bison-2.4.3
136 + sys-devel/flex
137 + >=sys-devel/clang-5
138 + virtual/pkgconfig
139 + dev-vcs/git
140 +"
141 +
142 +if ! has chromium_pkg_die ${EBUILD_DEATH_HOOKS}; then
143 + EBUILD_DEATH_HOOKS+=" chromium_pkg_die";
144 +fi
145 +
146 +DISABLE_AUTOFORMATTING="yes"
147 +DOC_CONTENTS="
148 +Some web pages may require additional fonts to display properly.
149 +Try installing some of the following packages if some characters
150 +are not displayed properly:
151 +- media-fonts/arphicfonts
152 +- media-fonts/droid
153 +- media-fonts/ipamonafont
154 +- media-fonts/noto
155 +- media-fonts/ja-ipafonts
156 +- media-fonts/takao-fonts
157 +- media-fonts/wqy-microhei
158 +- media-fonts/wqy-zenhei
159 +
160 +To fix broken icons on the Downloads page, you should install an icon
161 +theme that covers the appropriate MIME types, and configure this as your
162 +GTK+ icon theme.
163 +"
164 +
165 +PATCHES=(
166 + "${FILESDIR}/chromium-compiler-r5.patch"
167 + "${FILESDIR}/chromium-widevine-r2.patch"
168 + "${FILESDIR}/chromium-webrtc-r0.patch"
169 + "${FILESDIR}/chromium-memcpy-r0.patch"
170 + "${FILESDIR}/chromium-math.h-r0.patch"
171 + "${FILESDIR}/chromium-stdint.patch"
172 +)
173 +
174 +pre_build_checks() {
175 + #if [[ ${MERGE_TYPE} != binary ]]; then
176 + # local -x CPP="$(tc-getCXX) -E"
177 + # if tc-is-clang && ! version_is_at_least "3.9.1" "$(clang-fullversion)"; then
178 + # # bugs: #601654
179 + # die "At least clang 3.9.1 is required"
180 + # fi
181 + # if tc-is-gcc && ! version_is_at_least 5.0 "$(gcc-version)"; then
182 + # # bugs: #535730, #525374, #518668, #600288, #627356
183 + # die "At least gcc 5.0 is required"
184 + # fi
185 + #fi
186 +
187 + # Check build requirements, bug #541816 and bug #471810 .
188 + CHECKREQS_MEMORY="3G"
189 + CHECKREQS_DISK_BUILD="5G"
190 + eshopts_push -s extglob
191 + if is-flagq '-g?(gdb)?([1-9])'; then
192 + CHECKREQS_DISK_BUILD="25G"
193 + if ! use component-build; then
194 + CHECKREQS_MEMORY="16G"
195 + fi
196 + fi
197 + eshopts_pop
198 + check-reqs_pkg_setup
199 +}
200 +
201 +pkg_pretend() {
202 + pre_build_checks
203 +}
204 +
205 +pkg_setup() {
206 + pre_build_checks
207 +
208 + chromium_suid_sandbox_check_kernel_config
209 +}
210 +
211 +src_prepare() {
212 + # Calling this here supports resumption via FEATURES=keepwork
213 + python_setup
214 +
215 + default
216 +
217 + mkdir -p third_party/node/linux/node-linux-x64/bin || die
218 + ln -s "${EPREFIX}"/usr/bin/node third_party/node/linux/node-linux-x64/bin/node || die
219 +
220 + local keeplibs=(
221 + base/third_party/dmg_fp
222 + base/third_party/dynamic_annotations
223 + base/third_party/icu
224 + base/third_party/nspr
225 + base/third_party/superfasthash
226 + base/third_party/symbolize
227 + base/third_party/valgrind
228 + base/third_party/xdg_mime
229 + base/third_party/xdg_user_dirs
230 + buildtools/third_party/libc++
231 + buildtools/third_party/libc++abi
232 + chrome/third_party/mozilla_security_manager
233 + courgette/third_party
234 + net/third_party/http2
235 + net/third_party/mozilla_security_manager
236 + net/third_party/nss
237 + net/third_party/quic
238 + net/third_party/spdy
239 + net/third_party/uri_template
240 + third_party/WebKit
241 + third_party/abseil-cpp
242 + third_party/analytics
243 + third_party/angle
244 + third_party/angle/src/common/third_party/base
245 + third_party/angle/src/common/third_party/smhasher
246 + third_party/angle/src/third_party/compiler
247 + third_party/angle/src/third_party/libXNVCtrl
248 + third_party/angle/src/third_party/trace_event
249 + third_party/angle/third_party/glslang
250 + third_party/angle/third_party/spirv-headers
251 + third_party/angle/third_party/spirv-tools
252 + third_party/angle/third_party/vulkan-headers
253 + third_party/angle/third_party/vulkan-loader
254 + third_party/angle/third_party/vulkan-tools
255 + third_party/angle/third_party/vulkan-validation-layers
256 + third_party/apple_apsl
257 + third_party/blink
258 + third_party/boringssl
259 + third_party/boringssl/src/third_party/fiat
260 + third_party/breakpad
261 + third_party/breakpad/breakpad/src/third_party/curl
262 + third_party/brotli
263 + third_party/cacheinvalidation
264 + third_party/catapult
265 + third_party/catapult/common/py_vulcanize/third_party/rcssmin
266 + third_party/catapult/common/py_vulcanize/third_party/rjsmin
267 + third_party/catapult/third_party/beautifulsoup4
268 + third_party/catapult/third_party/html5lib-python
269 + third_party/catapult/third_party/polymer
270 + third_party/catapult/third_party/six
271 + third_party/catapult/tracing/third_party/d3
272 + third_party/catapult/tracing/third_party/gl-matrix
273 + third_party/catapult/tracing/third_party/jszip
274 + third_party/catapult/tracing/third_party/mannwhitneyu
275 + third_party/catapult/tracing/third_party/oboe
276 + third_party/catapult/tracing/third_party/pako
277 + third_party/ced
278 + third_party/cld_3
279 + third_party/crashpad
280 + third_party/crashpad/crashpad/third_party/zlib
281 + third_party/crc32c
282 + third_party/cros_system_api
283 + third_party/devscripts
284 + third_party/dom_distiller_js
285 + third_party/fips181
286 + third_party/flatbuffers
287 + third_party/flot
288 + third_party/freetype
289 + third_party/glslang-angle
290 + third_party/google_input_tools
291 + third_party/google_input_tools/third_party/closure_library
292 + third_party/google_input_tools/third_party/closure_library/third_party/closure
293 + third_party/googletest
294 + third_party/hunspell
295 + third_party/iccjpeg
296 + third_party/inspector_protocol
297 + third_party/jinja2
298 + third_party/jstemplate
299 + third_party/khronos
300 + third_party/leveldatabase
301 + third_party/libXNVCtrl
302 + third_party/libaddressinput
303 + third_party/libaom
304 + third_party/libaom/source/libaom/third_party/vector
305 + third_party/libaom/source/libaom/third_party/x86inc
306 + third_party/libjingle
307 + third_party/libphonenumber
308 + third_party/libsecret
309 + third_party/libsrtp
310 + third_party/libsync
311 + third_party/libudev
312 + third_party/libwebm
313 + third_party/libxml/chromium
314 + third_party/libyuv
315 + third_party/llvm
316 + third_party/lss
317 + third_party/lzma_sdk
318 + third_party/markupsafe
319 + third_party/mesa
320 + third_party/metrics_proto
321 + third_party/modp_b64
322 + third_party/node
323 + third_party/node/node_modules/polymer-bundler/lib/third_party/UglifyJS2
324 + third_party/openmax_dl
325 + third_party/ots
326 + third_party/pdfium
327 + third_party/pdfium/third_party/agg23
328 + third_party/pdfium/third_party/base
329 + third_party/pdfium/third_party/bigint
330 + third_party/pdfium/third_party/freetype
331 + third_party/pdfium/third_party/lcms
332 + third_party/pdfium/third_party/libopenjpeg20
333 + third_party/pdfium/third_party/libpng16
334 + third_party/pdfium/third_party/libtiff
335 + third_party/pdfium/third_party/skia_shared
336 + third_party/perfetto
337 + third_party/ply
338 + third_party/polymer
339 + third_party/protobuf
340 + third_party/protobuf/third_party/six
341 + third_party/pyjson5
342 + third_party/qcms
343 + third_party/rnnoise
344 + third_party/s2cellid
345 + third_party/sfntly
346 + third_party/simplejson
347 + third_party/skia
348 + third_party/skia/third_party/gif
349 + third_party/skia/third_party/skcms
350 + third_party/skia/third_party/vulkan
351 + third_party/smhasher
352 + third_party/spirv-headers
353 + third_party/spirv-tools-angle
354 + third_party/sqlite
355 + third_party/swiftshader
356 + third_party/swiftshader/third_party/llvm-subzero
357 + third_party/swiftshader/third_party/subzero
358 + third_party/unrar
359 + third_party/usrsctp
360 + third_party/vulkan
361 + third_party/vulkan-validation-layers
362 + third_party/web-animations-js
363 + third_party/webdriver
364 + third_party/webrtc
365 + third_party/webrtc/common_audio/third_party/fft4g
366 + third_party/webrtc/common_audio/third_party/spl_sqrt_floor
367 + third_party/webrtc/modules/third_party/fft
368 + third_party/webrtc/modules/third_party/g711
369 + third_party/webrtc/modules/third_party/g722
370 + third_party/webrtc/rtc_base/third_party/base64
371 + third_party/webrtc/rtc_base/third_party/sigslot
372 + third_party/widevine
373 + third_party/woff2
374 + third_party/zlib/google
375 + url/third_party/mozilla
376 + v8/src/third_party/valgrind
377 + v8/src/third_party/utf8-decoder
378 + v8/third_party/inspector_protocol
379 + v8/third_party/v8
380 +
381 + # gyp -> gn leftovers
382 + base/third_party/libevent
383 + third_party/adobe
384 + third_party/speech-dispatcher
385 + third_party/usb_ids
386 + third_party/xdg-utils
387 + third_party/yasm/run_yasm.py
388 + )
389 + if ! use system-ffmpeg; then
390 + keeplibs+=( third_party/ffmpeg third_party/opus )
391 + fi
392 + if ! use system-icu; then
393 + keeplibs+=( third_party/icu )
394 + fi
395 + if ! use system-libvpx; then
396 + keeplibs+=( third_party/libvpx )
397 + keeplibs+=( third_party/libvpx/source/libvpx/third_party/x86inc )
398 + fi
399 + if use tcmalloc; then
400 + keeplibs+=( third_party/tcmalloc )
401 + fi
402 +
403 + # Remove most bundled libraries. Some are still needed.
404 + build/linux/unbundle/remove_bundled_libraries.py "${keeplibs[@]}" --do-remove || die
405 +}
406 +
407 +src_configure() {
408 + # Calling this here supports resumption via FEATURES=keepwork
409 + python_setup
410 +
411 + local myconf_gn=""
412 +
413 + # Make sure the build system will use the right tools, bug #340795.
414 + tc-export AR CC CXX NM
415 +
416 + if ! tc-is-clang; then
417 + # Force clang since gcc is pretty broken at the moment.
418 + CC=${CHOST}-clang
419 + CXX=${CHOST}-clang++
420 + strip-unsupported-flags
421 + fi
422 +
423 + if tc-is-clang; then
424 + myconf_gn+=" is_clang=true clang_use_chrome_plugins=false"
425 + else
426 + myconf_gn+=" is_clang=false"
427 + fi
428 +
429 + # Define a custom toolchain for GN
430 + myconf_gn+=" custom_toolchain=\"//build/toolchain/linux/unbundle:default\""
431 +
432 + if tc-is-cross-compiler; then
433 + tc-export BUILD_{AR,CC,CXX,NM}
434 + myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:host\""
435 + myconf_gn+=" v8_snapshot_toolchain=\"//build/toolchain/linux/unbundle:host\""
436 + else
437 + myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:default\""
438 + fi
439 +
440 + # GN needs explicit config for Debug/Release as opposed to inferring it from build directory.
441 + myconf_gn+=" is_debug=false"
442 +
443 + # Component build isn't generally intended for use by end users. It's mostly useful
444 + # for development and debugging.
445 + myconf_gn+=" is_component_build=$(usex component-build true false)"
446 +
447 + # https://chromium.googlesource.com/chromium/src/+/lkcr/docs/jumbo.md
448 + myconf_gn+=" use_jumbo_build=$(usex jumbo-build true false)"
449 +
450 + myconf_gn+=" use_allocator=$(usex tcmalloc \"tcmalloc\" \"none\")"
451 +
452 + # Disable nacl, we can't build without pnacl (http://crbug.com/269560).
453 + myconf_gn+=" enable_nacl=false"
454 +
455 + # Use system-provided libraries.
456 + # TODO: freetype -- remove sources (https://bugs.chromium.org/p/pdfium/issues/detail?id=733).
457 + # TODO: use_system_hunspell (upstream changes needed).
458 + # TODO: use_system_libsrtp (bug #459932).
459 + # TODO: use_system_protobuf (bug #525560).
460 + # TODO: use_system_ssl (http://crbug.com/58087).
461 + # TODO: use_system_sqlite (http://crbug.com/22208).
462 +
463 + # libevent: https://bugs.gentoo.org/593458
464 + local gn_system_libraries=(
465 + flac
466 + fontconfig
467 + freetype
468 + # Need harfbuzz_from_pkgconfig target
469 + #harfbuzz-ng
470 + libdrm
471 + libjpeg
472 + libpng
473 + libwebp
474 + libxml
475 + libxslt
476 + openh264
477 + re2
478 + snappy
479 + yasm
480 + zlib
481 + )
482 + if use system-ffmpeg; then
483 + gn_system_libraries+=( ffmpeg opus )
484 + fi
485 + if use system-icu; then
486 + gn_system_libraries+=( icu )
487 + fi
488 + if use system-libvpx; then
489 + gn_system_libraries+=( libvpx )
490 + fi
491 + build/linux/unbundle/replace_gn_files.py --system-libraries "${gn_system_libraries[@]}" || die
492 +
493 + # See dependency logic in third_party/BUILD.gn
494 + myconf_gn+=" use_system_harfbuzz=true"
495 +
496 + # Optional dependencies.
497 + myconf_gn+=" enable_hangout_services_extension=$(usex hangouts true false)"
498 + myconf_gn+=" enable_widevine=$(usex widevine true false)"
499 + myconf_gn+=" use_cups=$(usex cups true false)"
500 + myconf_gn+=" use_gnome_keyring=$(usex gnome-keyring true false)"
501 + myconf_gn+=" use_kerberos=$(usex kerberos true false)"
502 + myconf_gn+=" use_pulseaudio=$(usex pulseaudio true false)"
503 +
504 + # TODO: link_pulseaudio=true for GN.
505 +
506 + myconf_gn+=" fieldtrial_testing_like_official_build=true"
507 +
508 + # Never use bundled gold binary. Disable gold linker flags for now.
509 + # Do not use bundled clang.
510 + # Trying to use gold results in linker crash.
511 + myconf_gn+=" use_gold=false use_sysroot=false linux_use_bundled_binutils=false use_custom_libcxx=false"
512 +
513 + # Disable forced lld, bug 641556
514 + myconf_gn+=" use_lld=false"
515 +
516 + ffmpeg_branding="$(usex proprietary-codecs Chrome Chromium)"
517 + myconf_gn+=" proprietary_codecs=$(usex proprietary-codecs true false)"
518 + myconf_gn+=" ffmpeg_branding=\"${ffmpeg_branding}\""
519 +
520 + # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys .
521 + # Note: these are for Gentoo use ONLY. For your own distribution,
522 + # please get your own set of keys. Feel free to contact chromium@g.o
523 + # for more info.
524 + local google_api_key="AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc"
525 + local google_default_client_id="329227923882.apps.googleusercontent.com"
526 + local google_default_client_secret="vgKG0NNv7GoDpbtoFNLxCUXu"
527 + myconf_gn+=" google_api_key=\"${google_api_key}\""
528 + myconf_gn+=" google_default_client_id=\"${google_default_client_id}\""
529 + myconf_gn+=" google_default_client_secret=\"${google_default_client_secret}\""
530 +
531 + local myarch="$(tc-arch)"
532 + if [[ $myarch = amd64 ]] ; then
533 + myconf_gn+=" target_cpu=\"x64\""
534 + ffmpeg_target_arch=x64
535 + elif [[ $myarch = x86 ]] ; then
536 + myconf_gn+=" target_cpu=\"x86\""
537 + ffmpeg_target_arch=ia32
538 + elif [[ $myarch = arm64 ]] ; then
539 + myconf_gn+=" target_cpu=\"arm64\""
540 + ffmpeg_target_arch=arm64
541 + elif [[ $myarch = arm ]] ; then
542 + myconf_gn+=" target_cpu=\"arm\""
543 + ffmpeg_target_arch=$(usex neon arm-neon arm)
544 + else
545 + die "Failed to determine target arch, got '$myarch'."
546 + fi
547 +
548 + # Make sure that -Werror doesn't get added to CFLAGS by the build system.
549 + # Depending on GCC version the warnings are different and we don't want
550 + # the build to fail because of that.
551 + myconf_gn+=" treat_warnings_as_errors=false"
552 +
553 + # Disable fatal linker warnings, bug 506268.
554 + myconf_gn+=" fatal_linker_warnings=false"
555 +
556 + # Avoid CFLAGS problems, bug #352457, bug #390147.
557 + if ! use custom-cflags; then
558 + replace-flags "-Os" "-O2"
559 + strip-flags
560 +
561 + # Prevent linker from running out of address space, bug #471810 .
562 + if use x86; then
563 + filter-flags "-g*"
564 + fi
565 +
566 + # Prevent libvpx build failures. Bug 530248, 544702, 546984.
567 + if [[ ${myarch} == amd64 || ${myarch} == x86 ]]; then
568 + filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 -mno-avx -mno-avx2
569 + fi
570 + fi
571 +
572 + # https://bugs.gentoo.org/588596
573 + #append-cxxflags $(test-flags-CXX -fno-delete-null-pointer-checks)
574 +
575 + # Bug 491582.
576 + export TMPDIR="${WORKDIR}/temp"
577 + mkdir -p -m 755 "${TMPDIR}" || die
578 +
579 + # https://bugs.gentoo.org/654216
580 + addpredict /dev/dri/ #nowarn
581 +
582 + #if ! use system-ffmpeg; then
583 + if false; then
584 + local build_ffmpeg_args=""
585 + if use pic && [[ "${ffmpeg_target_arch}" == "ia32" ]]; then
586 + build_ffmpeg_args+=" --disable-asm"
587 + fi
588 +
589 + # Re-configure bundled ffmpeg. See bug #491378 for example reasons.
590 + einfo "Configuring bundled ffmpeg..."
591 + pushd third_party/ffmpeg > /dev/null || die
592 + chromium/scripts/build_ffmpeg.py linux ${ffmpeg_target_arch} \
593 + --branding ${ffmpeg_branding} -- ${build_ffmpeg_args} || die
594 + chromium/scripts/copy_config.sh || die
595 + chromium/scripts/generate_gn.py || die
596 + popd > /dev/null || die
597 + fi
598 +
599 + einfo "Configuring Chromium..."
600 + set -- gn gen --args="${myconf_gn} ${EXTRA_GN}" out/Release
601 + echo "$@"
602 + "$@" || die
603 +}
604 +
605 +src_compile() {
606 + # Calling this here supports resumption via FEATURES=keepwork
607 + python_setup
608 +
609 + #"${EPYTHON}" tools/clang/scripts/update.py --force-local-build --gcc-toolchain /usr --skip-checkout --use-system-cmake --without-android || die
610 +
611 + # Work around broken deps
612 + eninja -C out/Release gen/ui/accessibility/ax_enums.mojom{,-shared}.h
613 +
614 + # Build mksnapshot and pax-mark it.
615 + local x
616 + for x in mksnapshot v8_context_snapshot_generator; do
617 + if tc-is-cross-compiler; then
618 + eninja -C out/Release "host/${x}"
619 + pax-mark m "out/Release/host/${x}"
620 + else
621 + eninja -C out/Release "${x}"
622 + pax-mark m "out/Release/${x}"
623 + fi
624 + done
625 +
626 + # Even though ninja autodetects number of CPUs, we respect
627 + # user's options, for debugging with -j 1 or any other reason.
628 + eninja -C out/Release chrome chromedriver
629 + use suid && eninja -C out/Release chrome_sandbox
630 +
631 + pax-mark m out/Release/chrome
632 +}
633 +
634 +src_install() {
635 + local CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser"
636 + exeinto "${CHROMIUM_HOME}"
637 + doexe out/Release/chrome
638 +
639 + if use suid; then
640 + newexe out/Release/chrome_sandbox chrome-sandbox
641 + fperms 4755 "${CHROMIUM_HOME}/chrome-sandbox"
642 + fi
643 +
644 + doexe out/Release/chromedriver
645 +
646 + local sedargs=( -e "s:/usr/lib/:/usr/$(get_libdir)/:g" )
647 + sed "${sedargs[@]}" "${FILESDIR}/chromium-launcher-r3.sh" > chromium-launcher.sh || die
648 + doexe chromium-launcher.sh
649 +
650 + # It is important that we name the target "chromium-browser",
651 + # xdg-utils expect it; bug #355517.
652 + dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser
653 + # keep the old symlink around for consistency
654 + dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium
655 +
656 + dosym "${CHROMIUM_HOME}/chromedriver" /usr/bin/chromedriver
657 +
658 + # Allow users to override command-line options, bug #357629.
659 + insinto /etc/chromium
660 + newins "${FILESDIR}/chromium.default" "default"
661 +
662 + pushd out/Release/locales > /dev/null || die
663 + chromium_remove_language_paks
664 + popd
665 +
666 + insinto "${CHROMIUM_HOME}"
667 + doins out/Release/*.bin
668 + doins out/Release/*.pak
669 + doins out/Release/*.so
670 +
671 + if ! use system-icu; then
672 + doins out/Release/icudtl.dat
673 + fi
674 +
675 + doins -r out/Release/locales
676 + doins -r out/Release/resources
677 +
678 + if [[ -d out/Release/swiftshader ]]; then
679 + insinto "${CHROMIUM_HOME}/swiftshader"
680 + doins out/Release/swiftshader/*.so
681 + fi
682 +
683 + # Install icons and desktop entry.
684 + local branding size
685 + for size in 16 22 24 32 48 64 128 256 ; do
686 + case ${size} in
687 + 16|32) branding="chrome/app/theme/default_100_percent/chromium" ;;
688 + *) branding="chrome/app/theme/chromium" ;;
689 + esac
690 + newicon -s ${size} "${branding}/product_logo_${size}.png" \
691 + chromium-browser.png
692 + done
693 +
694 + local mime_types="text/html;text/xml;application/xhtml+xml;"
695 + mime_types+="x-scheme-handler/http;x-scheme-handler/https;" # bug #360797
696 + mime_types+="x-scheme-handler/ftp;" # bug #412185
697 + mime_types+="x-scheme-handler/mailto;x-scheme-handler/webcal;" # bug #416393
698 + make_desktop_entry \
699 + chromium-browser \
700 + "Chromium" \
701 + chromium-browser \
702 + "Network;WebBrowser" \
703 + "MimeType=${mime_types}\nStartupWMClass=chromium-browser"
704 + sed -e "/^Exec/s/$/ %U/" -i "${ED}"/usr/share/applications/*.desktop || die
705 +
706 + # Install GNOME default application entry (bug #303100).
707 + insinto /usr/share/gnome-control-center/default-apps
708 + newins "${FILESDIR}"/chromium-browser.xml chromium-browser.xml
709 +
710 + readme.gentoo_create_doc
711 +}
712 +
713 +pkg_preinst() {
714 + gnome2_icon_savelist
715 +}
716 +
717 +pkg_postrm() {
718 + gnome2_icon_cache_update
719 + xdg_desktop_database_update
720 +}
721 +
722 +pkg_postinst() {
723 + gnome2_icon_cache_update
724 + xdg_desktop_database_update
725 + readme.gentoo_print_elog
726 +}
727
728 diff --git a/www-client/chromium/files/chromium-compiler-r5.patch b/www-client/chromium/files/chromium-compiler-r5.patch
729 new file mode 100644
730 index 00000000000..6d6b980b168
731 --- /dev/null
732 +++ b/www-client/chromium/files/chromium-compiler-r5.patch
733 @@ -0,0 +1,167 @@
734 +From 07fa6b9176dfd1acd4eb6706323ab4823f530432 Mon Sep 17 00:00:00 2001
735 +From: Mike Gilbert <floppym@g.o>
736 +Date: Wed, 25 Apr 2018 13:22:49 -0400
737 +Subject: [PATCH] Disable various compiler configs
738 +
739 +---
740 + build/config/compiler/BUILD.gn | 60 ++++++++++------------------------
741 + 1 file changed, 18 insertions(+), 42 deletions(-)
742 +
743 +diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
744 +index 0e796978d479..fa77c2476e4e 100644
745 +--- a/build/config/compiler/BUILD.gn
746 ++++ b/build/config/compiler/BUILD.gn
747 +@@ -235,8 +235,6 @@ config("compiler") {
748 +
749 + configs += [
750 + # See the definitions below.
751 +- ":clang_revision",
752 +- ":compiler_cpu_abi",
753 + ":compiler_codegen",
754 + ]
755 +
756 +@@ -501,17 +499,6 @@ config("compiler") {
757 + }
758 + }
759 +
760 +- if (is_clang && !is_nacl && !use_xcode_clang) {
761 +- cflags += [
762 +- # TODO(hans): Remove this once Clang generates better optimized debug info
763 +- # by default. https://crbug.com/765793
764 +- "-Xclang",
765 +- "-mllvm",
766 +- "-Xclang",
767 +- "-instcombine-lower-dbg-declare=0",
768 +- ]
769 +- }
770 +-
771 + # Print absolute paths in diagnostics. There is no precedent for doing this
772 + # on Linux/Mac (GCC doesn't support it), but MSVC does this with /FC and
773 + # Windows developers rely on it (crbug.com/636109) so only do this on Windows.
774 +@@ -1510,10 +1497,6 @@ config("default_warnings") {
775 + cflags += [
776 + # TODO(thakis): https://crbug.com/753973
777 + "-Wno-enum-compare-switch",
778 +-
779 +- # Ignore warnings about MSVC optimization pragmas.
780 +- # TODO(thakis): Only for no_chromium_code? http://crbug.com/505314
781 +- "-Wno-ignored-pragma-optimize",
782 + ]
783 + }
784 + }
785 +@@ -1555,22 +1538,6 @@ config("chromium_code") {
786 + "__STDC_FORMAT_MACROS",
787 + ]
788 +
789 +- if (!is_debug && !using_sanitizer &&
790 +- (!is_linux || !is_clang || is_official_build) &&
791 +- current_cpu != "s390x" && current_cpu != "s390" &&
792 +- current_cpu != "ppc64" && current_cpu != "ppc64" &&
793 +- current_cpu != "mips" && current_cpu != "mips64") {
794 +- # _FORTIFY_SOURCE isn't really supported by Clang now, see
795 +- # http://llvm.org/bugs/show_bug.cgi?id=16821.
796 +- # It seems to work fine with Ubuntu 12 headers though, so use it in
797 +- # official builds.
798 +- #
799 +- # Non-chromium code is not guaranteed to compile cleanly with
800 +- # _FORTIFY_SOURCE. Also, fortified build may fail when optimizations are
801 +- # disabled, so only do that for Release build.
802 +- defines += [ "_FORTIFY_SOURCE=2" ]
803 +- }
804 +-
805 + if (is_mac) {
806 + cflags_objc = [ "-Wobjc-missing-property-synthesis" ]
807 + cflags_objcc = [ "-Wobjc-missing-property-synthesis" ]
808 +@@ -1940,7 +1907,8 @@ config("default_stack_frames") {
809 + }
810 +
811 + # Default "optimization on" config.
812 +-config("optimize") {
813 ++config("optimize") { }
814 ++config("xoptimize") {
815 + if (is_win) {
816 + # TODO(thakis): Remove is_clang here, https://crbug.com/598772
817 + if (is_official_build && full_wpo_on_official && !is_clang) {
818 +@@ -1974,7 +1942,8 @@ config("optimize") {
819 + }
820 +
821 + # Same config as 'optimize' but without the WPO flag.
822 +-config("optimize_no_wpo") {
823 ++config("optimize_no_wpo") { }
824 ++config("xoptimize_no_wpo") {
825 + if (is_win) {
826 + # Favor size over speed, /O1 must be before the common flags. The GYP
827 + # build also specifies /Os and /GF but these are implied by /O1.
828 +@@ -1997,7 +1966,8 @@ config("optimize_no_wpo") {
829 + }
830 +
831 + # Turn off optimizations.
832 +-config("no_optimize") {
833 ++config("no_optimize") { }
834 ++config("xno_optimize") {
835 + if (is_win) {
836 + cflags = [
837 + "/Od", # Disable optimization.
838 +@@ -2021,7 +1991,8 @@ config("no_optimize") {
839 + # Turns up the optimization level. On Windows, this implies whole program
840 + # optimization and link-time code generation which is very expensive and should
841 + # be used sparingly.
842 +-config("optimize_max") {
843 ++config("optimize_max") { }
844 ++config("xoptimize_max") {
845 + if (is_nacl && is_nacl_irt) {
846 + # The NaCl IRT is a special case and always wants its own config.
847 + # Various components do:
848 +@@ -2068,7 +2039,8 @@ config("optimize_max") {
849 + #
850 + # TODO(crbug.com/621335) - rework how all of these configs are related
851 + # so that we don't need this disclaimer.
852 +-config("optimize_speed") {
853 ++config("optimize_speed") { }
854 ++config("xoptimize_speed") {
855 + if (is_nacl && is_nacl_irt) {
856 + # The NaCl IRT is a special case and always wants its own config.
857 + # Various components do:
858 +@@ -2106,7 +2078,8 @@ config("optimize_speed") {
859 + }
860 + }
861 +
862 +-config("optimize_fuzzing") {
863 ++config("optimize_fuzzing") { }
864 ++config("xoptimize_fuzzing") {
865 + cflags = [ "-O1" ] + common_optimize_on_cflags
866 + ldflags = common_optimize_on_ldflags
867 + visibility = [ ":default_optimization" ]
868 +@@ -2192,7 +2165,8 @@ config("afdo") {
869 + # configs += [ "//build/config/compiler:symbols" ]
870 +
871 + # Full symbols.
872 +-config("symbols") {
873 ++config("symbols") { }
874 ++config("xsymbols") {
875 + if (is_win) {
876 + if (use_goma || is_clang) {
877 + # Note that with VC++ this requires is_win_fastlink, enforced elsewhere.
878 +@@ -2290,7 +2264,8 @@ config("symbols") {
879 + # Minimal symbols.
880 + # This config guarantees to hold symbol for stack trace which are shown to user
881 + # when crash happens in unittests running on buildbot.
882 +-config("minimal_symbols") {
883 ++config("minimal_symbols") { }
884 ++config("xminimal_symbols") {
885 + if (is_win) {
886 + # Linker symbols for backtraces only.
887 + cflags = []
888 +@@ -2330,7 +2305,8 @@ config("minimal_symbols") {
889 + }
890 +
891 + # No symbols.
892 +-config("no_symbols") {
893 ++config("no_symbols") { }
894 ++config("xno_symbols") {
895 + if (!is_win) {
896 + cflags = [ "-g0" ]
897 + asmflags = cflags
898 +--
899 +2.19.0
900 +