Gentoo Archives: gentoo-commits

From: "Paweł Hajdan" <phajdan.jr@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-client/chromium/, www-client/chromium/files/
Date: Fri, 28 Apr 2017 15:45:04
Message-Id: 1493394286.db98d9c90fca877536fd1c77f81eed5841fae5dc.phajdan.jr@gentoo
1 commit: db98d9c90fca877536fd1c77f81eed5841fae5dc
2 Author: Pawel Hajdan, Jr <phajdan.jr <AT> gentoo <DOT> org>
3 AuthorDate: Fri Apr 28 15:44:10 2017 +0000
4 Commit: Paweł Hajdan <phajdan.jr <AT> gentoo <DOT> org>
5 CommitDate: Fri Apr 28 15:44:46 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=db98d9c9
7
8 www-client/chromium: dev channel bump (60.0.3080.5)
9
10 Package-Manager: Portage-2.3.3, Repoman-2.3.1
11
12 www-client/chromium/Manifest | 1 +
13 www-client/chromium/chromium-60.0.3080.5.ebuild | 648 +++++++++++++++++++++
14 www-client/chromium/files/chromium-clang-r1.patch | 11 +
15 .../chromium/files/chromium-dma-buf-r2.patch | 20 +
16 .../chromium/files/chromium-gn-bootstrap-r5.patch | 11 +
17 5 files changed, 691 insertions(+)
18
19 diff --git a/www-client/chromium/Manifest b/www-client/chromium/Manifest
20 index a2fcdb90d75..90025ec9a1a 100644
21 --- a/www-client/chromium/Manifest
22 +++ b/www-client/chromium/Manifest
23 @@ -1,3 +1,4 @@
24 DIST chromium-58.0.3029.81.tar.xz 509252204 SHA256 5ab61b7025a5143fa1b21713479b316ec7a98e262e79e84f9c9a9656179217cb SHA512 49e8a641e6fe839880ac4cc17aa4b79875dbd0e14adcf7ad0138730334555fd57c93c1e7ebdf6f03c61528c351a5a489f56fb7d7809aef268627b186c547a4f3 WHIRLPOOL eed9d97cd4cb4d9a56864e65e797f6d126327d6e9371bdfe416fd57f0f4c9c83f37e125798a1753b5d8bc5921036bdfe064b3d7e94c3ba315a710241a6c5b179
25 DIST chromium-59.0.3067.0.tar.xz 519365816 SHA256 a8edc9aaa2cb24fc227740f4bc3585980c6e01c3a1117b7a77a7802b6c92767f SHA512 877f53f288ec865f623ad2cdbe70d4e2a3728d5af05252275931697041a86fff7e0a0a3ef228d9169ffd2edda7ed636f8dbe1bf1abed0b9900a857a0b86455fc WHIRLPOOL 98d816351e0e3f3ddad3fd11d57e70e9c9dd82d40376e08b6a8416dbf4500aa9eec9c0ad7ee760d7db85697863bd5834223c205273f37e0900d32c1aa7b7c237
26 DIST chromium-59.0.3071.29.tar.xz 531699488 SHA256 8a727561e4d9892d99d93cdbed29bdc97aa597c3e0ff819100eb822bae35e79d SHA512 e364aa088f812b919043f3ef70bbc3505f383146f5736599eb982e36eddc6440703c77f6416f76eafa5e2a9ae3b3e954e8acd2457d28666b06a9ca6c8a655e4d WHIRLPOOL 99ac0719890d901c43dcbd392ee26ffaa959e9d8fe09a4eba64d51a921ca0371e913ed34c7e720fb81d42e6fc16d439548eb01afa128a0707a1788b70bcb32a8
27 +DIST chromium-60.0.3080.5.tar.xz 529799584 SHA256 7d6cc16eba14b4417b02f8533707b6ea910574402b2f92463f831eb7c19eb536 SHA512 da4ad6820d080549c694d5ef2cdaf380004f19630c4caf3c5cdb73863685751cc278c81f846d30c3ebee1be4608dad3cfe1598af31f10b4e6c47bffab4c91431 WHIRLPOOL b9f48d1fccf7914463572d857cb0e552d3178114a20d4f83d486037d9b55c3277a2f93c6fea245d136ae5b59a14a8bf0c1bc923e4395e5619a043ef0655601ec
28
29 diff --git a/www-client/chromium/chromium-60.0.3080.5.ebuild b/www-client/chromium/chromium-60.0.3080.5.ebuild
30 new file mode 100644
31 index 00000000000..6081cb18f33
32 --- /dev/null
33 +++ b/www-client/chromium/chromium-60.0.3080.5.ebuild
34 @@ -0,0 +1,648 @@
35 +# Copyright 1999-2017 Gentoo Foundation
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI="6"
39 +PYTHON_COMPAT=( python2_7 )
40 +
41 +CHROMIUM_LANGS="am ar bg bn ca cs da de el en-GB es es-419 et fa fi fil fr gu he
42 + 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
43 + sv sw ta te th tr uk vi zh-CN zh-TW"
44 +
45 +inherit check-reqs chromium-2 eutils gnome2-utils flag-o-matic multilib multiprocessing pax-utils portability python-any-r1 readme.gentoo-r1 toolchain-funcs versionator virtualx xdg-utils
46 +
47 +DESCRIPTION="Open-source version of Google Chrome web browser"
48 +HOMEPAGE="http://chromium.org/"
49 +SRC_URI="https://commondatastorage.googleapis.com/chromium-browser-official/${P}.tar.xz"
50 +
51 +LICENSE="BSD"
52 +SLOT="0"
53 +KEYWORDS="~amd64 ~arm ~arm64 ~x86"
54 +IUSE="component-build cups gconf gnome-keyring +gtk3 +hangouts kerberos neon pic +proprietary-codecs pulseaudio selinux +suid +system-ffmpeg +system-libvpx +tcmalloc widevine"
55 +RESTRICT="!system-ffmpeg? ( proprietary-codecs? ( bindist ) )"
56 +
57 +# Native Client binaries are compiled with different set of flags, bug #452066.
58 +QA_FLAGS_IGNORED=".*\.nexe"
59 +
60 +# Native Client binaries may be stripped by the build system, which uses the
61 +# right tools for it, bug #469144 .
62 +QA_PRESTRIPPED=".*\.nexe"
63 +
64 +COMMON_DEPEND="
65 + app-arch/bzip2:=
66 + cups? ( >=net-print/cups-1.3.11:= )
67 + dev-libs/expat:=
68 + dev-libs/glib:2
69 + dev-libs/icu:=
70 + dev-libs/libxslt:=
71 + dev-libs/nspr:=
72 + >=dev-libs/nss-3.14.3:=
73 + >=dev-libs/re2-0.2016.05.01:=
74 + gconf? ( >=gnome-base/gconf-2.24.0:= )
75 + gnome-keyring? ( >=gnome-base/libgnome-keyring-3.12:= )
76 + >=media-libs/alsa-lib-1.0.19:=
77 + media-libs/fontconfig:=
78 + media-libs/freetype:=
79 + >=media-libs/harfbuzz-1.4.2:=
80 + media-libs/libjpeg-turbo:=
81 + media-libs/libpng:=
82 + system-libvpx? ( media-libs/libvpx:=[postproc,svc] )
83 + pulseaudio? ( media-sound/pulseaudio:= )
84 + system-ffmpeg? ( >=media-video/ffmpeg-3:= )
85 + sys-apps/dbus:=
86 + sys-apps/pciutils:=
87 + virtual/udev
88 + x11-libs/cairo:=
89 + x11-libs/gdk-pixbuf:2
90 + x11-libs/libX11:=
91 + x11-libs/libXcomposite:=
92 + x11-libs/libXcursor:=
93 + x11-libs/libXdamage:=
94 + x11-libs/libXext:=
95 + x11-libs/libXfixes:=
96 + >=x11-libs/libXi-1.6.0:=
97 + x11-libs/libXrandr:=
98 + x11-libs/libXrender:=
99 + x11-libs/libXScrnSaver:=
100 + x11-libs/libXtst:=
101 + x11-libs/pango:=
102 + app-arch/snappy:=
103 + media-libs/flac:=
104 + >=media-libs/libwebp-0.4.0:=
105 + sys-libs/zlib:=[minizip]
106 + kerberos? ( virtual/krb5 )
107 +"
108 +# For nvidia-drivers blocker, see bug #413637 .
109 +RDEPEND="${COMMON_DEPEND}
110 + !=www-client/chromium-9999
111 + !<www-plugins/chrome-binary-plugins-57
112 + x11-misc/xdg-utils
113 + virtual/opengl
114 + virtual/ttf-fonts
115 + !gtk3? ( x11-libs/gtk+:2 )
116 + gtk3? ( x11-libs/gtk+:3 )
117 + selinux? ( sec-policy/selinux-chromium )
118 + tcmalloc? ( !<x11-drivers/nvidia-drivers-331.20 )
119 + widevine? ( www-plugins/chrome-binary-plugins[widevine(-)] )
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
131 + net-libs/nodejs
132 + sys-apps/hwids[usb(+)]
133 + tcmalloc? ( !<sys-apps/sandbox-2.11 )
134 + >=sys-devel/bison-2.4.3
135 + sys-devel/flex
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 +pre_build_checks() {
179 + if [[ ${MERGE_TYPE} != binary ]]; then
180 + local -x CPP="$(tc-getCXX) -E"
181 + if tc-is-gcc; then
182 + # https://bugs.chromium.org/p/chromium/issues/detail?id=714412
183 + die "GCC build is currently broken; please use clang instead (CC=clang CXX=clang++)"
184 + fi
185 + if tc-is-clang && ! version_is_at_least "3.9.1" "$(clang-fullversion)"; then
186 + # bugs: #601654
187 + die "At least clang 3.9.1 is required"
188 + fi
189 + if tc-is-gcc && ! version_is_at_least 4.8 "$(gcc-version)"; then
190 + # bugs: #535730, #525374, #518668, #600288
191 + die "At least gcc 4.8 is required"
192 + fi
193 + fi
194 +
195 + # Check build requirements, bug #541816 and bug #471810 .
196 + CHECKREQS_MEMORY="3G"
197 + CHECKREQS_DISK_BUILD="5G"
198 + eshopts_push -s extglob
199 + if is-flagq '-g?(gdb)?([1-9])'; then
200 + CHECKREQS_DISK_BUILD="25G"
201 + if ! use component-build; then
202 + CHECKREQS_MEMORY="16G"
203 + fi
204 + fi
205 + eshopts_pop
206 + check-reqs_pkg_setup
207 +}
208 +
209 +pkg_pretend() {
210 + pre_build_checks
211 +}
212 +
213 +pkg_setup() {
214 + pre_build_checks
215 +
216 + # Make sure the build system will use the right python, bug #344367.
217 + python-any-r1_pkg_setup
218 +
219 + chromium_suid_sandbox_check_kernel_config
220 +}
221 +
222 +src_prepare() {
223 + local PATCHES=(
224 + "${FILESDIR}/${PN}-widevine-r1.patch"
225 + "${FILESDIR}/${PN}-FORTIFY_SOURCE.patch"
226 + "${FILESDIR}/skia-avx2.patch"
227 + "${FILESDIR}/${PN}-dma-buf-r2.patch"
228 + "${FILESDIR}/${PN}-system-ffmpeg-r6.patch"
229 + "${FILESDIR}/${PN}-gn-bootstrap-r5.patch"
230 + "${FILESDIR}/${PN}-clang-r1.patch"
231 + )
232 +
233 + default
234 +
235 + mkdir -p third_party/node/linux/node-linux-x64/bin || die
236 + ln -s "${EPREFIX}"/usr/bin/node third_party/node/linux/node-linux-x64/bin/node || die
237 +
238 + local keeplibs=(
239 + base/third_party/dmg_fp
240 + base/third_party/dynamic_annotations
241 + base/third_party/icu
242 + base/third_party/nspr
243 + base/third_party/superfasthash
244 + base/third_party/symbolize
245 + base/third_party/valgrind
246 + base/third_party/xdg_mime
247 + base/third_party/xdg_user_dirs
248 + breakpad/src/third_party/curl
249 + chrome/third_party/mozilla_security_manager
250 + courgette/third_party
251 + net/third_party/mozilla_security_manager
252 + net/third_party/nss
253 + third_party/WebKit
254 + third_party/analytics
255 + third_party/angle
256 + third_party/angle/src/common/third_party/numerics
257 + third_party/angle/src/third_party/compiler
258 + third_party/angle/src/third_party/libXNVCtrl
259 + third_party/angle/src/third_party/murmurhash
260 + third_party/angle/src/third_party/trace_event
261 + third_party/boringssl
262 + third_party/brotli
263 + third_party/cacheinvalidation
264 + third_party/catapult
265 + third_party/catapult/third_party/polymer
266 + third_party/catapult/third_party/py_vulcanize
267 + third_party/catapult/third_party/py_vulcanize/third_party/rcssmin
268 + third_party/catapult/third_party/py_vulcanize/third_party/rjsmin
269 + third_party/catapult/tracing/third_party/d3
270 + third_party/catapult/tracing/third_party/gl-matrix
271 + third_party/catapult/tracing/third_party/jszip
272 + third_party/catapult/tracing/third_party/mannwhitneyu
273 + third_party/catapult/tracing/third_party/oboe
274 + third_party/ced
275 + third_party/cld_2
276 + third_party/cld_3
277 + third_party/cros_system_api
278 + third_party/devscripts
279 + third_party/dom_distiller_js
280 + third_party/fips181
281 + third_party/flatbuffers
282 + third_party/flot
283 + third_party/freetype
284 + third_party/google_input_tools
285 + third_party/google_input_tools/third_party/closure_library
286 + third_party/google_input_tools/third_party/closure_library/third_party/closure
287 + third_party/hunspell
288 + third_party/iccjpeg
289 + third_party/inspector_protocol
290 + third_party/jinja2
291 + third_party/jstemplate
292 + third_party/khronos
293 + third_party/leveldatabase
294 + third_party/libXNVCtrl
295 + third_party/libaddressinput
296 + third_party/libjingle
297 + third_party/libphonenumber
298 + third_party/libsecret
299 + third_party/libsrtp
300 + third_party/libudev
301 + third_party/libusb
302 + third_party/libwebm
303 + third_party/libxml
304 + third_party/libyuv
305 + third_party/lss
306 + third_party/lzma_sdk
307 + third_party/markupsafe
308 + third_party/mesa
309 + third_party/modp_b64
310 + third_party/mt19937ar
311 + third_party/node
312 + third_party/node/node_modules/vulcanize/third_party/UglifyJS2
313 + third_party/openh264
314 + third_party/openmax_dl
315 + third_party/opus
316 + third_party/ots
317 + third_party/pdfium
318 + third_party/pdfium/third_party/agg23
319 + third_party/pdfium/third_party/base
320 + third_party/pdfium/third_party/build
321 + third_party/pdfium/third_party/bigint
322 + third_party/pdfium/third_party/freetype
323 + third_party/pdfium/third_party/lcms2-2.6
324 + third_party/pdfium/third_party/libopenjpeg20
325 + third_party/pdfium/third_party/libpng16
326 + third_party/pdfium/third_party/libtiff
327 + third_party/ply
328 + third_party/polymer
329 + third_party/protobuf
330 + third_party/protobuf/third_party/six
331 + third_party/qcms
332 + third_party/sfntly
333 + third_party/skia
334 + third_party/smhasher
335 + third_party/sqlite
336 + third_party/swiftshader
337 + third_party/swiftshader/third_party/llvm-subzero
338 + third_party/swiftshader/third_party/pnacl-subzero
339 + third_party/tcmalloc
340 + third_party/usrsctp
341 + third_party/web-animations-js
342 + third_party/webdriver
343 + third_party/webrtc
344 + third_party/widevine
345 + third_party/woff2
346 + third_party/zlib/google
347 + url/third_party/mozilla
348 + v8/src/third_party/valgrind
349 + v8/third_party/inspector_protocol
350 +
351 + # gyp -> gn leftovers
352 + base/third_party/libevent
353 + third_party/adobe
354 + third_party/speech-dispatcher
355 + third_party/usb_ids
356 + third_party/xdg-utils
357 + third_party/yasm/run_yasm.py
358 + )
359 + if ! use system-ffmpeg; then
360 + keeplibs+=( third_party/ffmpeg )
361 + fi
362 + if ! use system-libvpx; then
363 + keeplibs+=( third_party/libvpx )
364 + keeplibs+=( third_party/libvpx/source/libvpx/third_party/x86inc )
365 + fi
366 +
367 + # Remove most bundled libraries. Some are still needed.
368 + build/linux/unbundle/remove_bundled_libraries.py "${keeplibs[@]}" --do-remove || die
369 +}
370 +
371 +src_configure() {
372 + local myconf_gn=""
373 +
374 + # GN needs explicit config for Debug/Release as opposed to inferring it from build directory.
375 + myconf_gn+=" is_debug=false"
376 +
377 + # Component build isn't generally intended for use by end users. It's mostly useful
378 + # for development and debugging.
379 + myconf_gn+=" is_component_build=$(usex component-build true false)"
380 +
381 + myconf_gn+=" use_allocator=$(usex tcmalloc \"tcmalloc\" \"none\")"
382 +
383 + # Disable nacl, we can't build without pnacl (http://crbug.com/269560).
384 + myconf_gn+=" enable_nacl=false"
385 +
386 + # Use system-provided libraries.
387 + # TODO: use_system_hunspell (upstream changes needed).
388 + # TODO: use_system_libsrtp (bug #459932).
389 + # TODO: use_system_libusb (http://crbug.com/266149).
390 + # TODO: xml (bug #616818).
391 + # TODO: use_system_opus (https://code.google.com/p/webrtc/issues/detail?id=3077).
392 + # TODO: use_system_protobuf (bug #525560).
393 + # TODO: use_system_ssl (http://crbug.com/58087).
394 + # TODO: use_system_sqlite (http://crbug.com/22208).
395 +
396 + # libevent: https://bugs.gentoo.org/593458
397 + local gn_system_libraries=(
398 + flac
399 + harfbuzz-ng
400 + icu
401 + libdrm
402 + libjpeg
403 + libpng
404 + libwebp
405 + libxslt
406 + re2
407 + snappy
408 + yasm
409 + zlib
410 + )
411 + if use system-ffmpeg; then
412 + gn_system_libraries+=( ffmpeg )
413 + fi
414 + if use system-libvpx; then
415 + gn_system_libraries+=( libvpx )
416 + fi
417 + build/linux/unbundle/replace_gn_files.py --system-libraries "${gn_system_libraries[@]}" || die
418 +
419 + # Optional dependencies.
420 + myconf_gn+=" enable_hangout_services_extension=$(usex hangouts true false)"
421 + myconf_gn+=" enable_widevine=$(usex widevine true false)"
422 + myconf_gn+=" use_cups=$(usex cups true false)"
423 + myconf_gn+=" use_gconf=$(usex gconf true false)"
424 + myconf_gn+=" use_gnome_keyring=$(usex gnome-keyring true false)"
425 + myconf_gn+=" use_gtk3=$(usex gtk3 true false)"
426 + myconf_gn+=" use_kerberos=$(usex kerberos true false)"
427 + myconf_gn+=" use_pulseaudio=$(usex pulseaudio true false)"
428 +
429 + # TODO: link_pulseaudio=true for GN.
430 +
431 + myconf_gn+=" fieldtrial_testing_like_official_build=true"
432 +
433 + if tc-is-clang; then
434 + myconf_gn+=" is_clang=true clang_use_chrome_plugins=false"
435 + myconf_gn+=" clang_base_path=\"$(realpath $(dirname `which clang`)/..)\""
436 + else
437 + myconf_gn+=" is_clang=false"
438 + fi
439 +
440 + # Never use bundled gold binary. Disable gold linker flags for now.
441 + # Do not use bundled clang.
442 + # Trying to use gold results in linker crash.
443 + myconf_gn+=" use_gold=false use_sysroot=false linux_use_bundled_binutils=false"
444 +
445 + ffmpeg_branding="$(usex proprietary-codecs Chrome Chromium)"
446 + myconf_gn+=" proprietary_codecs=$(usex proprietary-codecs true false)"
447 + myconf_gn+=" ffmpeg_branding=\"${ffmpeg_branding}\""
448 +
449 + # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys .
450 + # Note: these are for Gentoo use ONLY. For your own distribution,
451 + # please get your own set of keys. Feel free to contact chromium@g.o
452 + # for more info.
453 + local google_api_key="AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc"
454 + local google_default_client_id="329227923882.apps.googleusercontent.com"
455 + local google_default_client_secret="vgKG0NNv7GoDpbtoFNLxCUXu"
456 + myconf_gn+=" google_api_key=\"${google_api_key}\""
457 + myconf_gn+=" google_default_client_id=\"${google_default_client_id}\""
458 + myconf_gn+=" google_default_client_secret=\"${google_default_client_secret}\""
459 +
460 + local myarch="$(tc-arch)"
461 + if [[ $myarch = amd64 ]] ; then
462 + target_arch=x64
463 + ffmpeg_target_arch=x64
464 + elif [[ $myarch = x86 ]] ; then
465 + target_arch=ia32
466 + ffmpeg_target_arch=ia32
467 + elif [[ $myarch = arm64 ]] ; then
468 + target_arch=arm64
469 + ffmpeg_target_arch=arm64
470 + elif [[ $myarch = arm ]] ; then
471 + target_arch=arm
472 + ffmpeg_target_arch=$(usex neon arm-neon arm)
473 + else
474 + die "Failed to determine target arch, got '$myarch'."
475 + fi
476 +
477 + # Make sure that -Werror doesn't get added to CFLAGS by the build system.
478 + # Depending on GCC version the warnings are different and we don't want
479 + # the build to fail because of that.
480 + myconf_gn+=" treat_warnings_as_errors=false"
481 +
482 + # Disable fatal linker warnings, bug 506268.
483 + myconf_gn+=" fatal_linker_warnings=false"
484 +
485 + # Avoid CFLAGS problems, bug #352457, bug #390147.
486 + if ! use custom-cflags; then
487 + replace-flags "-Os" "-O2"
488 + strip-flags
489 +
490 + # Prevent linker from running out of address space, bug #471810 .
491 + if use x86; then
492 + filter-flags "-g*"
493 + fi
494 +
495 + # Prevent libvpx build failures. Bug 530248, 544702, 546984.
496 + if [[ ${myarch} == amd64 || ${myarch} == x86 ]]; then
497 + filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 -mno-avx -mno-avx2
498 + fi
499 + fi
500 +
501 + # Make sure the build system will use the right tools, bug #340795.
502 + tc-export AR CC CXX NM
503 +
504 + # https://bugs.gentoo.org/588596
505 + append-cxxflags $(test-flags-CXX -fno-delete-null-pointer-checks)
506 +
507 + # Define a custom toolchain for GN
508 + myconf_gn+=" custom_toolchain=\"${FILESDIR}/toolchain:default\""
509 +
510 + # Tools for building programs to be executed on the build system, bug #410883.
511 + if tc-is-cross-compiler; then
512 + export AR_host=$(tc-getBUILD_AR)
513 + export CC_host=$(tc-getBUILD_CC)
514 + export CXX_host=$(tc-getBUILD_CXX)
515 + export NM_host=$(tc-getBUILD_NM)
516 + fi
517 +
518 + # Bug 491582.
519 + export TMPDIR="${WORKDIR}/temp"
520 + mkdir -p -m 755 "${TMPDIR}" || die
521 +
522 + if ! use system-ffmpeg; then
523 + local build_ffmpeg_args=""
524 + if use pic && [[ "${ffmpeg_target_arch}" == "ia32" ]]; then
525 + build_ffmpeg_args+=" --disable-asm"
526 + fi
527 +
528 + # Re-configure bundled ffmpeg. See bug #491378 for example reasons.
529 + einfo "Configuring bundled ffmpeg..."
530 + pushd third_party/ffmpeg > /dev/null || die
531 + chromium/scripts/build_ffmpeg.py linux ${ffmpeg_target_arch} \
532 + --branding ${ffmpeg_branding} -- ${build_ffmpeg_args} || die
533 + chromium/scripts/copy_config.sh || die
534 + chromium/scripts/generate_gn.py || die
535 + popd > /dev/null || die
536 + fi
537 +
538 + third_party/libaddressinput/chromium/tools/update-strings.py || die
539 +
540 + touch chrome/test/data/webui/i18n_process_css_test.html || die
541 +
542 + einfo "Configuring Chromium..."
543 + tools/gn/bootstrap/bootstrap.py -v --no-clean --gn-gen-args "${myconf_gn}" || die
544 + out/Release/gn gen --args="${myconf_gn}" out/Release || die
545 +}
546 +
547 +eninja() {
548 + if [[ -z ${NINJAOPTS+set} ]]; then
549 + local jobs=$(makeopts_jobs)
550 + local loadavg=$(makeopts_loadavg)
551 +
552 + if [[ ${MAKEOPTS} == *-j* && ${jobs} != 999 ]]; then
553 + NINJAOPTS+=" -j ${jobs}"
554 + fi
555 + if [[ ${MAKEOPTS} == *-l* && ${loadavg} != 999 ]]; then
556 + NINJAOPTS+=" -l ${loadavg}"
557 + fi
558 + fi
559 + set -- ninja -v ${NINJAOPTS} "$@"
560 + echo "$@"
561 + "$@"
562 +}
563 +
564 +src_compile() {
565 + local ninja_targets="chrome chromedriver"
566 + if use suid; then
567 + ninja_targets+=" chrome_sandbox"
568 + fi
569 +
570 + # Build mksnapshot and pax-mark it.
571 + eninja -C out/Release mksnapshot || die
572 + pax-mark m out/Release/mksnapshot
573 +
574 + # Even though ninja autodetects number of CPUs, we respect
575 + # user's options, for debugging with -j 1 or any other reason.
576 + eninja -C out/Release ${ninja_targets} || die
577 +
578 + pax-mark m out/Release/chrome
579 +}
580 +
581 +src_install() {
582 + local CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser"
583 + exeinto "${CHROMIUM_HOME}"
584 + doexe out/Release/chrome
585 +
586 + if use suid; then
587 + newexe out/Release/chrome_sandbox chrome-sandbox
588 + fperms 4755 "${CHROMIUM_HOME}/chrome-sandbox"
589 + fi
590 +
591 + doexe out/Release/chromedriver
592 +
593 + # if ! use arm; then
594 + # doexe out/Release/nacl_helper{,_bootstrap} || die
595 + # insinto "${CHROMIUM_HOME}"
596 + # doins out/Release/nacl_irt_*.nexe || die
597 + # doins out/Release/libppGoogleNaClPluginChrome.so || die
598 + # fi
599 +
600 + local sedargs=( -e "s:/usr/lib/:/usr/$(get_libdir)/:g" )
601 + sed "${sedargs[@]}" "${FILESDIR}/chromium-launcher-r3.sh" > chromium-launcher.sh || die
602 + doexe chromium-launcher.sh
603 +
604 + # It is important that we name the target "chromium-browser",
605 + # xdg-utils expect it; bug #355517.
606 + dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser
607 + # keep the old symlink around for consistency
608 + dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium
609 +
610 + dosym "${CHROMIUM_HOME}/chromedriver" /usr/bin/chromedriver
611 +
612 + # Allow users to override command-line options, bug #357629.
613 + insinto /etc/chromium
614 + newins "${FILESDIR}/chromium.default" "default"
615 +
616 + pushd out/Release/locales > /dev/null || die
617 + chromium_remove_language_paks
618 + popd
619 +
620 + if use widevine; then
621 + # These will be provided by chrome-binary-plugins
622 + rm out/Release/libwidevinecdm*.so || die
623 + fi
624 +
625 + insinto "${CHROMIUM_HOME}"
626 + doins out/Release/*.bin
627 + doins out/Release/*.pak
628 + doins out/Release/*.so
629 +
630 + # Needed by bundled icu
631 + # doins out/Release/icudtl.dat
632 +
633 + doins -r out/Release/locales
634 + doins -r out/Release/resources
635 +
636 + newman out/Release/chrome.1 chromium.1
637 + newman out/Release/chrome.1 chromium-browser.1
638 +
639 + # Install icons and desktop entry.
640 + local branding size
641 + for size in 16 22 24 32 48 64 128 256 ; do
642 + case ${size} in
643 + 16|32) branding="chrome/app/theme/default_100_percent/chromium" ;;
644 + *) branding="chrome/app/theme/chromium" ;;
645 + esac
646 + newicon -s ${size} "${branding}/product_logo_${size}.png" \
647 + chromium-browser.png
648 + done
649 +
650 + local mime_types="text/html;text/xml;application/xhtml+xml;"
651 + mime_types+="x-scheme-handler/http;x-scheme-handler/https;" # bug #360797
652 + mime_types+="x-scheme-handler/ftp;" # bug #412185
653 + mime_types+="x-scheme-handler/mailto;x-scheme-handler/webcal;" # bug #416393
654 + make_desktop_entry \
655 + chromium-browser \
656 + "Chromium" \
657 + chromium-browser \
658 + "Network;WebBrowser" \
659 + "MimeType=${mime_types}\nStartupWMClass=chromium-browser"
660 + sed -e "/^Exec/s/$/ %U/" -i "${ED}"/usr/share/applications/*.desktop || die
661 +
662 + # Install GNOME default application entry (bug #303100).
663 + insinto /usr/share/gnome-control-center/default-apps
664 + newins "${FILESDIR}"/chromium-browser.xml chromium-browser.xml
665 +
666 + readme.gentoo_create_doc
667 +}
668 +
669 +pkg_preinst() {
670 + gnome2_icon_savelist
671 +}
672 +
673 +pkg_postrm() {
674 + gnome2_icon_cache_update
675 + xdg_desktop_database_update
676 +}
677 +
678 +pkg_postinst() {
679 + gnome2_icon_cache_update
680 + xdg_desktop_database_update
681 + readme.gentoo_print_elog
682 +}
683
684 diff --git a/www-client/chromium/files/chromium-clang-r1.patch b/www-client/chromium/files/chromium-clang-r1.patch
685 new file mode 100644
686 index 00000000000..ea593200cf7
687 --- /dev/null
688 +++ b/www-client/chromium/files/chromium-clang-r1.patch
689 @@ -0,0 +1,11 @@
690 +--- a/base/containers/flat_set.h.orig 2017-04-28 14:39:24.143751606 +0000
691 ++++ b/base/containers/flat_set.h 2017-04-28 14:39:33.815953089 +0000
692 +@@ -5,6 +5,8 @@
693 + #ifndef BASE_CONTAINERS_FLAT_SET_H_
694 + #define BASE_CONTAINERS_FLAT_SET_H_
695 +
696 ++#include <functional>
697 ++
698 + #include "base/containers/flat_tree.h"
699 +
700 + namespace base {
701
702 diff --git a/www-client/chromium/files/chromium-dma-buf-r2.patch b/www-client/chromium/files/chromium-dma-buf-r2.patch
703 new file mode 100644
704 index 00000000000..2de680cf031
705 --- /dev/null
706 +++ b/www-client/chromium/files/chromium-dma-buf-r2.patch
707 @@ -0,0 +1,20 @@
708 +--- a/ui/gfx/linux/client_native_pixmap_dmabuf.cc.orig 2017-04-28 10:27:57.890505336 +0000
709 ++++ b/ui/gfx/linux/client_native_pixmap_dmabuf.cc 2017-04-28 10:28:17.726916569 +0000
710 +@@ -19,9 +19,6 @@
711 + #include "base/strings/stringprintf.h"
712 + #include "base/trace_event/trace_event.h"
713 +
714 +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
715 +-#include <linux/dma-buf.h>
716 +-#else
717 + #include <linux/types.h>
718 +
719 + struct dma_buf_sync {
720 +@@ -36,7 +33,6 @@
721 +
722 + #define DMA_BUF_BASE 'b'
723 + #define DMA_BUF_IOCTL_SYNC _IOW(DMA_BUF_BASE, 0, struct dma_buf_sync)
724 +-#endif
725 +
726 + namespace gfx {
727 +
728
729 diff --git a/www-client/chromium/files/chromium-gn-bootstrap-r5.patch b/www-client/chromium/files/chromium-gn-bootstrap-r5.patch
730 new file mode 100644
731 index 00000000000..5e95036086e
732 --- /dev/null
733 +++ b/www-client/chromium/files/chromium-gn-bootstrap-r5.patch
734 @@ -0,0 +1,11 @@
735 +--- a/tools/gn/bootstrap/bootstrap.py.orig 2017-04-28 11:27:52.844988762 +0000
736 ++++ b/tools/gn/bootstrap/bootstrap.py 2017-04-28 11:29:12.698642585 +0000
737 +@@ -503,6 +503,8 @@
738 + 'base/threading/thread_restrictions.cc',
739 + 'base/threading/thread_task_runner_handle.cc',
740 + 'base/threading/worker_pool.cc',
741 ++ 'base/time/default_tick_clock.cc',
742 ++ 'base/time/tick_clock.cc',
743 + 'base/time/time.cc',
744 + 'base/timer/elapsed_timer.cc',
745 + 'base/timer/timer.cc',