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, 05 May 2017 18:27:27
Message-Id: 1494008819.631dd7a209d994a2f1a57823e0da3b572d12da25.phajdan.jr@gentoo
1 commit: 631dd7a209d994a2f1a57823e0da3b572d12da25
2 Author: Pawel Hajdan, Jr <phajdan.jr <AT> gentoo <DOT> org>
3 AuthorDate: Fri May 5 18:26:59 2017 +0000
4 Commit: Paweł Hajdan <phajdan.jr <AT> gentoo <DOT> org>
5 CommitDate: Fri May 5 18:26:59 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=631dd7a2
7
8 www-client/chromium: dev channel bump (60.0.3088.3)
9
10 Package-Manager: Portage-2.3.5, Repoman-2.3.1
11
12 www-client/chromium/Manifest | 1 +
13 www-client/chromium/chromium-60.0.3088.3.ebuild | 649 +++++++++++++++++++++
14 .../chromium/files/chromium-gn-bootstrap-r6.patch | 18 +
15 .../chromium/files/chromium-system-opus-r1.patch | 20 +
16 4 files changed, 688 insertions(+)
17
18 diff --git a/www-client/chromium/Manifest b/www-client/chromium/Manifest
19 index 90025ec9a1a..03f78db33ed 100644
20 --- a/www-client/chromium/Manifest
21 +++ b/www-client/chromium/Manifest
22 @@ -2,3 +2,4 @@ DIST chromium-58.0.3029.81.tar.xz 509252204 SHA256 5ab61b7025a5143fa1b21713479b3
23 DIST chromium-59.0.3067.0.tar.xz 519365816 SHA256 a8edc9aaa2cb24fc227740f4bc3585980c6e01c3a1117b7a77a7802b6c92767f SHA512 877f53f288ec865f623ad2cdbe70d4e2a3728d5af05252275931697041a86fff7e0a0a3ef228d9169ffd2edda7ed636f8dbe1bf1abed0b9900a857a0b86455fc WHIRLPOOL 98d816351e0e3f3ddad3fd11d57e70e9c9dd82d40376e08b6a8416dbf4500aa9eec9c0ad7ee760d7db85697863bd5834223c205273f37e0900d32c1aa7b7c237
24 DIST chromium-59.0.3071.29.tar.xz 531699488 SHA256 8a727561e4d9892d99d93cdbed29bdc97aa597c3e0ff819100eb822bae35e79d SHA512 e364aa088f812b919043f3ef70bbc3505f383146f5736599eb982e36eddc6440703c77f6416f76eafa5e2a9ae3b3e954e8acd2457d28666b06a9ca6c8a655e4d WHIRLPOOL 99ac0719890d901c43dcbd392ee26ffaa959e9d8fe09a4eba64d51a921ca0371e913ed34c7e720fb81d42e6fc16d439548eb01afa128a0707a1788b70bcb32a8
25 DIST chromium-60.0.3080.5.tar.xz 529799584 SHA256 7d6cc16eba14b4417b02f8533707b6ea910574402b2f92463f831eb7c19eb536 SHA512 da4ad6820d080549c694d5ef2cdaf380004f19630c4caf3c5cdb73863685751cc278c81f846d30c3ebee1be4608dad3cfe1598af31f10b4e6c47bffab4c91431 WHIRLPOOL b9f48d1fccf7914463572d857cb0e552d3178114a20d4f83d486037d9b55c3277a2f93c6fea245d136ae5b59a14a8bf0c1bc923e4395e5619a043ef0655601ec
26 +DIST chromium-60.0.3088.3.tar.xz 530979712 SHA256 f47aa0f8a3a1280f1df548a31a0560f32f205716bbd4b72866c101a78842fc1f SHA512 a80684d8b941fe6c91cd3b9d558f1a8b6a61ee1292424d5c2ca67d8e8b46df2291d4f95f40d02e393a83ea0f3e3f99274e8a86473e8c1c7702ace50ad26e79f9 WHIRLPOOL 227045a6c130ddd12b0bef00e7886e8435cb58e988e02a6320f0ba32f8c78203de88ad31df0fc2ef80e9c5f88449513e5fd6fd6279dd360070c94830038a6859
27
28 diff --git a/www-client/chromium/chromium-60.0.3088.3.ebuild b/www-client/chromium/chromium-60.0.3088.3.ebuild
29 new file mode 100644
30 index 00000000000..2d8e4832028
31 --- /dev/null
32 +++ b/www-client/chromium/chromium-60.0.3088.3.ebuild
33 @@ -0,0 +1,649 @@
34 +# Copyright 1999-2017 Gentoo Foundation
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 multiprocessing pax-utils portability python-any-r1 readme.gentoo-r1 toolchain-funcs versionator virtualx 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 ~arm ~arm64 ~x86"
53 +IUSE="component-build cups gconf gnome-keyring +gtk3 +hangouts kerberos neon pic +proprietary-codecs pulseaudio selinux +suid +system-ffmpeg +system-libvpx +tcmalloc widevine"
54 +RESTRICT="!system-ffmpeg? ( proprietary-codecs? ( bindist ) )"
55 +
56 +# Native Client binaries are compiled with different set of flags, bug #452066.
57 +QA_FLAGS_IGNORED=".*\.nexe"
58 +
59 +# Native Client binaries may be stripped by the build system, which uses the
60 +# right tools for it, bug #469144 .
61 +QA_PRESTRIPPED=".*\.nexe"
62 +
63 +COMMON_DEPEND="
64 + app-arch/bzip2:=
65 + cups? ( >=net-print/cups-1.3.11:= )
66 + dev-libs/expat:=
67 + dev-libs/glib:2
68 + dev-libs/icu:=
69 + dev-libs/libxslt:=
70 + dev-libs/nspr:=
71 + >=dev-libs/nss-3.14.3:=
72 + >=dev-libs/re2-0.2016.05.01:=
73 + gconf? ( >=gnome-base/gconf-2.24.0:= )
74 + gnome-keyring? ( >=gnome-base/libgnome-keyring-3.12:= )
75 + >=media-libs/alsa-lib-1.0.19:=
76 + media-libs/fontconfig:=
77 + media-libs/freetype:=
78 + >=media-libs/harfbuzz-1.4.2:=
79 + media-libs/libjpeg-turbo:=
80 + media-libs/libpng:=
81 + system-libvpx? ( media-libs/libvpx:=[postproc,svc] )
82 + media-libs/opus:=
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-clang && ! version_is_at_least "3.9.1" "$(clang-fullversion)"; then
182 + # bugs: #601654
183 + die "At least clang 3.9.1 is required"
184 + fi
185 + if tc-is-gcc && ! version_is_at_least 4.8 "$(gcc-version)"; then
186 + # bugs: #535730, #525374, #518668, #600288
187 + die "At least gcc 4.8 is required"
188 + fi
189 + fi
190 +
191 + # Check build requirements, bug #541816 and bug #471810 .
192 + CHECKREQS_MEMORY="3G"
193 + CHECKREQS_DISK_BUILD="5G"
194 + eshopts_push -s extglob
195 + if is-flagq '-g?(gdb)?([1-9])'; then
196 + CHECKREQS_DISK_BUILD="25G"
197 + if ! use component-build; then
198 + CHECKREQS_MEMORY="16G"
199 + fi
200 + fi
201 + eshopts_pop
202 + check-reqs_pkg_setup
203 +}
204 +
205 +pkg_pretend() {
206 + pre_build_checks
207 +}
208 +
209 +pkg_setup() {
210 + pre_build_checks
211 +
212 + # Make sure the build system will use the right python, bug #344367.
213 + python-any-r1_pkg_setup
214 +
215 + chromium_suid_sandbox_check_kernel_config
216 +}
217 +
218 +src_prepare() {
219 + local PATCHES=(
220 + "${FILESDIR}/${PN}-widevine-r1.patch"
221 + "${FILESDIR}/${PN}-FORTIFY_SOURCE.patch"
222 + "${FILESDIR}/skia-avx2.patch"
223 + "${FILESDIR}/${PN}-system-ffmpeg-r6.patch"
224 + "${FILESDIR}/${PN}-gn-bootstrap-r6.patch"
225 + "${FILESDIR}/${PN}-system-opus-r1.patch"
226 + )
227 +
228 + default
229 +
230 + mkdir -p third_party/node/linux/node-linux-x64/bin || die
231 + ln -s "${EPREFIX}"/usr/bin/node third_party/node/linux/node-linux-x64/bin/node || die
232 +
233 + local keeplibs=(
234 + base/third_party/dmg_fp
235 + base/third_party/dynamic_annotations
236 + base/third_party/icu
237 + base/third_party/nspr
238 + base/third_party/superfasthash
239 + base/third_party/symbolize
240 + base/third_party/valgrind
241 + base/third_party/xdg_mime
242 + base/third_party/xdg_user_dirs
243 + breakpad/src/third_party/curl
244 + chrome/third_party/mozilla_security_manager
245 + courgette/third_party
246 + net/third_party/mozilla_security_manager
247 + net/third_party/nss
248 + third_party/WebKit
249 + third_party/analytics
250 + third_party/angle
251 + third_party/angle/src/common/third_party/numerics
252 + third_party/angle/src/third_party/compiler
253 + third_party/angle/src/third_party/libXNVCtrl
254 + third_party/angle/src/third_party/murmurhash
255 + third_party/angle/src/third_party/trace_event
256 + third_party/boringssl
257 + third_party/brotli
258 + third_party/cacheinvalidation
259 + third_party/catapult
260 + third_party/catapult/third_party/polymer
261 + third_party/catapult/third_party/py_vulcanize
262 + third_party/catapult/third_party/py_vulcanize/third_party/rcssmin
263 + third_party/catapult/third_party/py_vulcanize/third_party/rjsmin
264 + third_party/catapult/tracing/third_party/d3
265 + third_party/catapult/tracing/third_party/gl-matrix
266 + third_party/catapult/tracing/third_party/jszip
267 + third_party/catapult/tracing/third_party/mannwhitneyu
268 + third_party/catapult/tracing/third_party/oboe
269 + third_party/ced
270 + third_party/cld_2
271 + third_party/cld_3
272 + third_party/cros_system_api
273 + third_party/devscripts
274 + third_party/dom_distiller_js
275 + third_party/fips181
276 + third_party/flatbuffers
277 + third_party/flot
278 + third_party/freetype
279 + third_party/glslang-angle
280 + third_party/google_input_tools
281 + third_party/google_input_tools/third_party/closure_library
282 + third_party/google_input_tools/third_party/closure_library/third_party/closure
283 + third_party/hunspell
284 + third_party/iccjpeg
285 + third_party/inspector_protocol
286 + third_party/jinja2
287 + third_party/jstemplate
288 + third_party/khronos
289 + third_party/leveldatabase
290 + third_party/libXNVCtrl
291 + third_party/libaddressinput
292 + third_party/libjingle
293 + third_party/libphonenumber
294 + third_party/libsecret
295 + third_party/libsrtp
296 + third_party/libudev
297 + third_party/libusb
298 + third_party/libwebm
299 + third_party/libxml
300 + third_party/libyuv
301 + third_party/lss
302 + third_party/lzma_sdk
303 + third_party/markupsafe
304 + third_party/mesa
305 + third_party/modp_b64
306 + third_party/mt19937ar
307 + third_party/node
308 + third_party/node/node_modules/vulcanize/third_party/UglifyJS2
309 + third_party/openh264
310 + third_party/openmax_dl
311 + third_party/ots
312 + third_party/pdfium
313 + third_party/pdfium/third_party/agg23
314 + third_party/pdfium/third_party/base
315 + third_party/pdfium/third_party/build
316 + third_party/pdfium/third_party/bigint
317 + third_party/pdfium/third_party/freetype
318 + third_party/pdfium/third_party/lcms2-2.6
319 + third_party/pdfium/third_party/libopenjpeg20
320 + third_party/pdfium/third_party/libpng16
321 + third_party/pdfium/third_party/libtiff
322 + third_party/ply
323 + third_party/polymer
324 + third_party/protobuf
325 + third_party/protobuf/third_party/six
326 + third_party/qcms
327 + third_party/sfntly
328 + third_party/skia
329 + third_party/skia/third_party/vulkan
330 + third_party/smhasher
331 + third_party/spirv-headers
332 + third_party/spirv-tools-angle
333 + third_party/sqlite
334 + third_party/swiftshader
335 + third_party/swiftshader/third_party/llvm-subzero
336 + third_party/swiftshader/third_party/pnacl-subzero
337 + third_party/tcmalloc
338 + third_party/usrsctp
339 + third_party/vulkan
340 + third_party/vulkan-validation-layers
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_protobuf (bug #525560).
392 + # TODO: use_system_ssl (http://crbug.com/58087).
393 + # TODO: use_system_sqlite (http://crbug.com/22208).
394 +
395 + # libevent: https://bugs.gentoo.org/593458
396 + local gn_system_libraries=(
397 + flac
398 + harfbuzz-ng
399 + icu
400 + libdrm
401 + libjpeg
402 + libpng
403 + libwebp
404 + libxslt
405 + opus
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-gn-bootstrap-r6.patch b/www-client/chromium/files/chromium-gn-bootstrap-r6.patch
685 new file mode 100644
686 index 00000000000..ef450ae7c0d
687 --- /dev/null
688 +++ b/www-client/chromium/files/chromium-gn-bootstrap-r6.patch
689 @@ -0,0 +1,18 @@
690 +--- a/tools/gn/bootstrap/bootstrap.py.orig 2017-05-05 10:28:25.450118804 +0000
691 ++++ b/tools/gn/bootstrap/bootstrap.py 2017-05-05 10:29:39.339673530 +0000
692 +@@ -546,6 +546,7 @@
693 + 'base/trace_event/memory_infra_background_whitelist.cc',
694 + 'base/trace_event/memory_peak_detector.cc',
695 + 'base/trace_event/memory_tracing_observer.cc',
696 ++ 'base/trace_event/memory_usage_estimator.cc',
697 + 'base/trace_event/process_memory_dump.cc',
698 + 'base/trace_event/process_memory_maps.cc',
699 + 'base/trace_event/process_memory_totals.cc',
700 +@@ -629,6 +630,7 @@
701 + 'tool': 'cxx',
702 + }
703 + static_libraries['base']['sources'].extend([
704 ++ 'base/memory/shared_memory_handle_posix.cc',
705 + 'base/memory/shared_memory_posix.cc',
706 + 'base/memory/shared_memory_tracker.cc',
707 + 'base/nix/xdg_util.cc',
708
709 diff --git a/www-client/chromium/files/chromium-system-opus-r1.patch b/www-client/chromium/files/chromium-system-opus-r1.patch
710 new file mode 100644
711 index 00000000000..d1a9a131a32
712 --- /dev/null
713 +++ b/www-client/chromium/files/chromium-system-opus-r1.patch
714 @@ -0,0 +1,20 @@
715 +--- a/build/linux/unbundle/opus.gn.orig 2017-05-05 13:40:51.267582823 +0000
716 ++++ b/build/linux/unbundle/opus.gn 2017-05-05 13:41:38.156561667 +0000
717 +@@ -5,7 +5,7 @@
718 + import("//build/config/linux/pkg_config.gni")
719 + import("//build/shim_headers.gni")
720 +
721 +-pkg_config("system_opus") {
722 ++pkg_config("opus_config") {
723 + packages = [ "opus" ]
724 + }
725 +
726 +@@ -23,7 +23,7 @@
727 + deps = [
728 + ":opus_shim",
729 + ]
730 +- public_configs = [ ":system_opus" ]
731 ++ public_configs = [ ":opus_config" ]
732 + }
733 +
734 + source_set("opus_compare") {