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