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: Mon, 13 Nov 2017 18:19:26
Message-Id: 1510597160.d41c39bc3e8521813a8f83b85fc8d9b4dbe27c0b.floppym@gentoo
1 commit: d41c39bc3e8521813a8f83b85fc8d9b4dbe27c0b
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Mon Nov 13 18:18:45 2017 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Mon Nov 13 18:19:20 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d41c39bc
7
8 www-client/chromium: dev channel bump (64.0.3260.2)
9
10 Package-Manager: Portage-2.3.13_p7, Repoman-2.3.3_p87
11
12 www-client/chromium/Manifest | 1 +
13 www-client/chromium/chromium-64.0.3260.2.ebuild | 661 +++++++++++++++++++++
14 .../chromium/files/chromium-gn-bootstrap-r22.patch | 10 +
15 3 files changed, 672 insertions(+)
16
17 diff --git a/www-client/chromium/Manifest b/www-client/chromium/Manifest
18 index 977faca5494..fe7811af081 100644
19 --- a/www-client/chromium/Manifest
20 +++ b/www-client/chromium/Manifest
21 @@ -2,3 +2,4 @@ DIST chromium-62.0.3202.89.tar.xz 517100784 SHA256 9f79760dc22f7183602a07af3d37d
22 DIST chromium-63.0.3239.30.tar.xz 561111084 SHA256 ab210326029213eda0290db71f6ddbdf5c42e2d94c3461dee094637a34571219 SHA512 b6b89e3464b4dbef54cfe5971255bf4cf96b8c984a2a82d7f4f66e3aecaf5a0a3c72ad827127223b3448c2c2ffad3fe1b1546266ec9544838b758ac3d9b454c8 WHIRLPOOL 1a673b4060cc757e190ea376bb0cff2e8222c91f30a3627ba39b3fed0c534bced213fa3bba06614aacf2814996fb949bb55bd06d549e74f70af7002aa5796ee7
23 DIST chromium-63.0.3239.40.tar.xz 561115132 SHA256 d1063027ff1d2e17f3076fe00abebad4a3e43d5fd3291a8c9bace298b7d666de SHA512 a6a2db0d472df0cbe54ead3f3da2b3fd0608ee3099f46772561146a5ac19ef2702800ac4a601228ae90431dce1e1021707ad397339f6cad99c0f38d667816de7 WHIRLPOOL de5cd4ebaaaa509a370ffb4967bc74c616ea5f195277c5079b6d1e22f1252679c417d6f52959a745b4c3881d6dff1fd44079eda1bc04580a3696445f99e128aa
24 DIST chromium-64.0.3253.3.tar.xz 567976356 SHA256 6abe5b8ea147953c9d8bae72e52b4984f1a0f718e97bc578f0250055815ec4cd SHA512 fd0307337eec5513d73c14a0d8bf494d87e1a658c48585afbf7d0c08314297bf28825ee99bbeab95ccaae8a0e5b1536794c3b4c94f996ba0a4a217cdbc224267 WHIRLPOOL 78a44979475fda90087a164a5fa7e082576d344a103536c4c62cc4f1e4d3b6a4681005b9165ff020aff179bd3b58195c518c1fa32fb5f1e7b95548c5ae28e9cb
25 +DIST chromium-64.0.3260.2.tar.xz 568772508 SHA256 1d54669f1ff0ea37d1095e8934d307f1dc5e93119f1ea621ee93ca8d032ff64e SHA512 f7003976c8c5449569e0017fae5e1f2f7150a297a4bb4ad2a9bafe69e9fb4e931c76efeecbe07cc11a00af5a49591655734f21892e69e3ac523fc4d3faa2795f WHIRLPOOL b6c3538d06d8df9b97eed57b11e1c6129d4663e607ccc82e17270a1bcd249a73ecc2436c1e0728f1fc90579b30b5946f8b88a98566e231761b90f2c4c9c751c5
26
27 diff --git a/www-client/chromium/chromium-64.0.3260.2.ebuild b/www-client/chromium/chromium-64.0.3260.2.ebuild
28 new file mode 100644
29 index 00000000000..21dc2c0ff22
30 --- /dev/null
31 +++ b/www-client/chromium/chromium-64.0.3260.2.ebuild
32 @@ -0,0 +1,661 @@
33 +# Copyright 1999-2017 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 ~arm ~arm64 ~x86"
52 +IUSE="component-build cups gnome-keyring +hangouts kerberos neon pic +proprietary-codecs pulseaudio selinux +suid +system-ffmpeg +system-icu +system-libvpx +tcmalloc widevine"
53 +RESTRICT="!system-ffmpeg? ( proprietary-codecs? ( bindist ) )"
54 +
55 +COMMON_DEPEND="
56 + app-arch/bzip2:=
57 + cups? ( >=net-print/cups-1.3.11:= )
58 + dev-libs/expat:=
59 + dev-libs/glib:2
60 + system-icu? ( >=dev-libs/icu-59:= )
61 + >=dev-libs/libxml2-2.9.4-r3:=[icu]
62 + dev-libs/libxslt:=
63 + dev-libs/nspr:=
64 + >=dev-libs/nss-3.14.3:=
65 + >=dev-libs/re2-0.2016.05.01:=
66 + gnome-keyring? ( >=gnome-base/libgnome-keyring-3.12:= )
67 + >=media-libs/alsa-lib-1.0.19:=
68 + media-libs/fontconfig:=
69 + media-libs/freetype:=
70 + >=media-libs/harfbuzz-1.5.0:=[icu(-)]
71 + media-libs/libjpeg-turbo:=
72 + media-libs/libpng:=
73 + system-libvpx? ( media-libs/libvpx:=[postproc,svc] )
74 + >=media-libs/openh264-1.6.0:=
75 + pulseaudio? ( media-sound/pulseaudio:= )
76 + system-ffmpeg? (
77 + >=media-video/ffmpeg-3:=
78 + || (
79 + media-video/ffmpeg[-samba]
80 + >=net-fs/samba-4.5.10-r1[-debug(-)]
81 + )
82 + !=net-fs/samba-4.5.12
83 + media-libs/opus:=
84 + )
85 + sys-apps/dbus:=
86 + sys-apps/pciutils:=
87 + virtual/udev
88 + x11-libs/cairo:=
89 + x11-libs/gdk-pixbuf:2
90 + x11-libs/gtk+:3[X]
91 + x11-libs/libX11:=
92 + x11-libs/libXcomposite:=
93 + x11-libs/libXcursor:=
94 + x11-libs/libXdamage:=
95 + x11-libs/libXext:=
96 + x11-libs/libXfixes:=
97 + >=x11-libs/libXi-1.6.0:=
98 + x11-libs/libXrandr:=
99 + x11-libs/libXrender:=
100 + x11-libs/libXScrnSaver:=
101 + x11-libs/libXtst:=
102 + x11-libs/pango:=
103 + app-arch/snappy:=
104 + media-libs/flac:=
105 + >=media-libs/libwebp-0.4.0:=
106 + sys-libs/zlib:=[minizip]
107 + kerberos? ( virtual/krb5 )
108 +"
109 +# For nvidia-drivers blocker, see bug #413637 .
110 +RDEPEND="${COMMON_DEPEND}
111 + !=www-client/chromium-9999
112 + !<www-plugins/chrome-binary-plugins-57
113 + x11-misc/xdg-utils
114 + virtual/opengl
115 + virtual/ttf-fonts
116 + selinux? ( sec-policy/selinux-chromium )
117 + tcmalloc? ( !<x11-drivers/nvidia-drivers-331.20 )
118 + widevine? ( www-plugins/chrome-binary-plugins[widevine(-)] )
119 +"
120 +# dev-vcs/git - https://bugs.gentoo.org/593476
121 +# sys-apps/sandbox - https://crbug.com/586444
122 +DEPEND="${COMMON_DEPEND}
123 + >=app-arch/gzip-1.7
124 + !arm? (
125 + dev-lang/yasm
126 + )
127 + dev-lang/perl
128 + >=dev-util/gperf-3.0.3
129 + >=dev-util/ninja-1.7.2
130 + >=net-libs/nodejs-6.9.4
131 + sys-apps/hwids[usb(+)]
132 + >=sys-devel/bison-2.4.3
133 + sys-devel/flex
134 + virtual/pkgconfig
135 + dev-vcs/git
136 + $(python_gen_any_dep '
137 + dev-python/beautifulsoup:python-2[${PYTHON_USEDEP}]
138 + >=dev-python/beautifulsoup-4.3.2:4[${PYTHON_USEDEP}]
139 + dev-python/html5lib[${PYTHON_USEDEP}]
140 + dev-python/simplejson[${PYTHON_USEDEP}]
141 + ')
142 +"
143 +
144 +# Keep this in sync with the python_gen_any_dep call.
145 +python_check_deps() {
146 + has_version --host-root "dev-python/beautifulsoup:python-2[${PYTHON_USEDEP}]" &&
147 + has_version --host-root ">=dev-python/beautifulsoup-4.3.2:4[${PYTHON_USEDEP}]" &&
148 + has_version --host-root "dev-python/html5lib[${PYTHON_USEDEP}]" &&
149 + has_version --host-root "dev-python/simplejson[${PYTHON_USEDEP}]"
150 +}
151 +
152 +if ! has chromium_pkg_die ${EBUILD_DEATH_HOOKS}; then
153 + EBUILD_DEATH_HOOKS+=" chromium_pkg_die";
154 +fi
155 +
156 +DISABLE_AUTOFORMATTING="yes"
157 +DOC_CONTENTS="
158 +Some web pages may require additional fonts to display properly.
159 +Try installing some of the following packages if some characters
160 +are not displayed properly:
161 +- media-fonts/arphicfonts
162 +- media-fonts/bitstream-cyberbit
163 +- media-fonts/droid
164 +- media-fonts/ipamonafont
165 +- media-fonts/noto
166 +- media-fonts/ja-ipafonts
167 +- media-fonts/takao-fonts
168 +- media-fonts/wqy-microhei
169 +- media-fonts/wqy-zenhei
170 +
171 +To fix broken icons on the Downloads page, you should install an icon
172 +theme that covers the appropriate MIME types, and configure this as your
173 +GTK+ icon theme.
174 +"
175 +
176 +PATCHES=(
177 + "${FILESDIR}/chromium-widevine-r1.patch"
178 + "${FILESDIR}/chromium-FORTIFY_SOURCE-r2.patch"
179 + "${FILESDIR}/chromium-webrtc-r0.patch"
180 + "${FILESDIR}/chromium-math-includes-r0.patch"
181 + "${FILESDIR}/chromium-gcc5-r5.patch"
182 + "${FILESDIR}/chromium-gn-bootstrap-r22.patch"
183 +)
184 +
185 +pre_build_checks() {
186 + if [[ ${MERGE_TYPE} != binary ]]; then
187 + local -x CPP="$(tc-getCXX) -E"
188 + if tc-is-clang && ! version_is_at_least "3.9.1" "$(clang-fullversion)"; then
189 + # bugs: #601654
190 + die "At least clang 3.9.1 is required"
191 + fi
192 + if tc-is-gcc && ! version_is_at_least 5.0 "$(gcc-version)"; then
193 + # bugs: #535730, #525374, #518668, #600288, #627356
194 + die "At least gcc 5.0 is required"
195 + fi
196 + fi
197 +
198 + # Check build requirements, bug #541816 and bug #471810 .
199 + CHECKREQS_MEMORY="3G"
200 + CHECKREQS_DISK_BUILD="5G"
201 + eshopts_push -s extglob
202 + if is-flagq '-g?(gdb)?([1-9])'; then
203 + CHECKREQS_DISK_BUILD="25G"
204 + if ! use component-build; then
205 + CHECKREQS_MEMORY="16G"
206 + fi
207 + fi
208 + eshopts_pop
209 + check-reqs_pkg_setup
210 +}
211 +
212 +pkg_pretend() {
213 + pre_build_checks
214 +}
215 +
216 +pkg_setup() {
217 + pre_build_checks
218 +
219 + chromium_suid_sandbox_check_kernel_config
220 +}
221 +
222 +src_prepare() {
223 + default
224 +
225 + mkdir -p third_party/node/linux/node-linux-x64/bin || die
226 + ln -s "${EPREFIX}"/usr/bin/node third_party/node/linux/node-linux-x64/bin/node || die
227 +
228 + local keeplibs=(
229 + base/third_party/dmg_fp
230 + base/third_party/dynamic_annotations
231 + base/third_party/icu
232 + base/third_party/nspr
233 + base/third_party/superfasthash
234 + base/third_party/symbolize
235 + base/third_party/valgrind
236 + base/third_party/xdg_mime
237 + base/third_party/xdg_user_dirs
238 + chrome/third_party/mozilla_security_manager
239 + courgette/third_party
240 + net/third_party/mozilla_security_manager
241 + net/third_party/nss
242 + third_party/WebKit
243 + third_party/analytics
244 + third_party/angle
245 + third_party/angle/src/common/third_party/base
246 + third_party/angle/src/common/third_party/smhasher
247 + third_party/angle/src/third_party/compiler
248 + third_party/angle/src/third_party/libXNVCtrl
249 + third_party/angle/src/third_party/trace_event
250 + third_party/blink
251 + third_party/boringssl
252 + third_party/breakpad
253 + third_party/breakpad/breakpad/src/third_party/curl
254 + third_party/brotli
255 + third_party/cacheinvalidation
256 + third_party/catapult
257 + third_party/catapult/common/py_vulcanize/third_party/rcssmin
258 + third_party/catapult/common/py_vulcanize/third_party/rjsmin
259 + third_party/catapult/third_party/polymer
260 + third_party/catapult/tracing/third_party/d3
261 + third_party/catapult/tracing/third_party/gl-matrix
262 + third_party/catapult/tracing/third_party/jszip
263 + third_party/catapult/tracing/third_party/mannwhitneyu
264 + third_party/catapult/tracing/third_party/oboe
265 + third_party/catapult/tracing/third_party/pako
266 + third_party/ced
267 + third_party/cld_2
268 + third_party/cld_3
269 + third_party/crc32c
270 + third_party/cros_system_api
271 + third_party/devscripts
272 + third_party/dom_distiller_js
273 + third_party/fips181
274 + third_party/flatbuffers
275 + third_party/flot
276 + third_party/freetype
277 + third_party/glslang-angle
278 + third_party/google_input_tools
279 + third_party/google_input_tools/third_party/closure_library
280 + third_party/google_input_tools/third_party/closure_library/third_party/closure
281 + third_party/googletest
282 + third_party/hunspell
283 + third_party/iccjpeg
284 + third_party/inspector_protocol
285 + third_party/jinja2
286 + third_party/jstemplate
287 + third_party/khronos
288 + third_party/leveldatabase
289 + third_party/libXNVCtrl
290 + third_party/libaddressinput
291 + third_party/libjingle
292 + third_party/libphonenumber
293 + third_party/libsecret
294 + third_party/libsrtp
295 + third_party/libudev
296 + third_party/libwebm
297 + third_party/libxml/chromium
298 + third_party/libyuv
299 + third_party/lss
300 + third_party/lzma_sdk
301 + third_party/markupsafe
302 + third_party/mesa
303 + third_party/metrics_proto
304 + third_party/modp_b64
305 + third_party/mt19937ar
306 + third_party/node
307 + third_party/node/node_modules/polymer-bundler/lib/third_party/UglifyJS2
308 + third_party/openmax_dl
309 + third_party/ots
310 + third_party/pdfium
311 + third_party/pdfium/third_party/agg23
312 + third_party/pdfium/third_party/base
313 + third_party/pdfium/third_party/build
314 + third_party/pdfium/third_party/bigint
315 + third_party/pdfium/third_party/freetype
316 + third_party/pdfium/third_party/lcms
317 + third_party/pdfium/third_party/libopenjpeg20
318 + third_party/pdfium/third_party/libpng16
319 + third_party/pdfium/third_party/libtiff
320 + third_party/ply
321 + third_party/polymer
322 + third_party/protobuf
323 + third_party/protobuf/third_party/six
324 + third_party/qcms
325 + third_party/sfntly
326 + third_party/skia
327 + third_party/skia/third_party/gif
328 + third_party/skia/third_party/vulkan
329 + third_party/smhasher
330 + third_party/spirv-headers
331 + third_party/spirv-tools-angle
332 + third_party/sqlite
333 + third_party/swiftshader
334 + third_party/swiftshader/third_party/llvm-subzero
335 + third_party/swiftshader/third_party/subzero
336 + third_party/usrsctp
337 + third_party/vulkan
338 + third_party/vulkan-validation-layers
339 + third_party/web-animations-js
340 + third_party/webdriver
341 + third_party/webrtc
342 + third_party/widevine
343 + third_party/woff2
344 + third_party/zlib/google
345 + url/third_party/mozilla
346 + v8/src/third_party/valgrind
347 + v8/third_party/inspector_protocol
348 +
349 + # gyp -> gn leftovers
350 + base/third_party/libevent
351 + third_party/adobe
352 + third_party/speech-dispatcher
353 + third_party/usb_ids
354 + third_party/xdg-utils
355 + third_party/yasm/run_yasm.py
356 + )
357 + if ! use system-ffmpeg; then
358 + keeplibs+=( third_party/ffmpeg third_party/opus )
359 + fi
360 + if ! use system-icu; then
361 + keeplibs+=( third_party/icu )
362 + fi
363 + if ! use system-libvpx; then
364 + keeplibs+=( third_party/libvpx )
365 + keeplibs+=( third_party/libvpx/source/libvpx/third_party/x86inc )
366 + fi
367 + if use tcmalloc; then
368 + keeplibs+=( third_party/tcmalloc )
369 + fi
370 +
371 + # Remove most bundled libraries. Some are still needed.
372 + build/linux/unbundle/remove_bundled_libraries.py "${keeplibs[@]}" --do-remove || die
373 +}
374 +
375 +bootstrap_gn() {
376 + if tc-is-cross-compiler; then
377 + local -x AR=${BUILD_AR}
378 + local -x CC=${BUILD_CC}
379 + local -x CXX=${BUILD_CXX}
380 + local -x NM=${BUILD_NM}
381 + local -x CFLAGS=${BUILD_CFLAGS}
382 + local -x CXXFLAGS=${BUILD_CXXFLAGS}
383 + local -x LDFLAGS=${BUILD_LDFLAGS}
384 + fi
385 + einfo "Building GN..."
386 + set -- tools/gn/bootstrap/bootstrap.py -s -v --no-clean
387 + echo "$@"
388 + "$@" || die
389 +}
390 +
391 +src_configure() {
392 + # Calling this here supports resumption via FEATURES=keepwork
393 + python_setup
394 +
395 + local myconf_gn=""
396 +
397 + # GN needs explicit config for Debug/Release as opposed to inferring it from build directory.
398 + myconf_gn+=" is_debug=false"
399 +
400 + # Component build isn't generally intended for use by end users. It's mostly useful
401 + # for development and debugging.
402 + myconf_gn+=" is_component_build=$(usex component-build true false)"
403 +
404 + myconf_gn+=" use_allocator=$(usex tcmalloc \"tcmalloc\" \"none\")"
405 +
406 + # Disable nacl, we can't build without pnacl (http://crbug.com/269560).
407 + myconf_gn+=" enable_nacl=false"
408 +
409 + # Use system-provided libraries.
410 + # TODO: freetype (https://bugs.chromium.org/p/pdfium/issues/detail?id=733).
411 + # TODO: use_system_hunspell (upstream changes needed).
412 + # TODO: use_system_libsrtp (bug #459932).
413 + # TODO: use_system_protobuf (bug #525560).
414 + # TODO: use_system_ssl (http://crbug.com/58087).
415 + # TODO: use_system_sqlite (http://crbug.com/22208).
416 +
417 + # libevent: https://bugs.gentoo.org/593458
418 + local gn_system_libraries=(
419 + flac
420 + # Need harfbuzz_from_pkgconfig target
421 + #harfbuzz-ng
422 + libdrm
423 + libjpeg
424 + libpng
425 + libwebp
426 + libxml
427 + libxslt
428 + openh264
429 + re2
430 + snappy
431 + yasm
432 + zlib
433 + )
434 + if use system-ffmpeg; then
435 + gn_system_libraries+=( ffmpeg opus )
436 + fi
437 + if use system-icu; then
438 + gn_system_libraries+=( icu )
439 + fi
440 + if use system-libvpx; then
441 + gn_system_libraries+=( libvpx )
442 + fi
443 + build/linux/unbundle/replace_gn_files.py --system-libraries "${gn_system_libraries[@]}" || die
444 +
445 + # See dependency logic in third_party/BUILD.gn
446 + myconf_gn+=" use_system_harfbuzz=true"
447 +
448 + # Optional dependencies.
449 + myconf_gn+=" enable_hangout_services_extension=$(usex hangouts true false)"
450 + myconf_gn+=" enable_widevine=$(usex widevine true false)"
451 + myconf_gn+=" use_cups=$(usex cups true false)"
452 + myconf_gn+=" use_gconf=false"
453 + myconf_gn+=" use_gnome_keyring=$(usex gnome-keyring true false)"
454 + myconf_gn+=" use_kerberos=$(usex kerberos true false)"
455 + myconf_gn+=" use_pulseaudio=$(usex pulseaudio true false)"
456 +
457 + # TODO: link_pulseaudio=true for GN.
458 +
459 + myconf_gn+=" fieldtrial_testing_like_official_build=true"
460 +
461 + if tc-is-clang; then
462 + myconf_gn+=" is_clang=true clang_use_chrome_plugins=false"
463 + else
464 + myconf_gn+=" is_clang=false"
465 + fi
466 +
467 + # Never use bundled gold binary. Disable gold linker flags for now.
468 + # Do not use bundled clang.
469 + # Trying to use gold results in linker crash.
470 + myconf_gn+=" use_gold=false use_sysroot=false linux_use_bundled_binutils=false use_custom_libcxx=false"
471 +
472 + ffmpeg_branding="$(usex proprietary-codecs Chrome Chromium)"
473 + myconf_gn+=" proprietary_codecs=$(usex proprietary-codecs true false)"
474 + myconf_gn+=" ffmpeg_branding=\"${ffmpeg_branding}\""
475 +
476 + # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys .
477 + # Note: these are for Gentoo use ONLY. For your own distribution,
478 + # please get your own set of keys. Feel free to contact chromium@g.o
479 + # for more info.
480 + local google_api_key="AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc"
481 + local google_default_client_id="329227923882.apps.googleusercontent.com"
482 + local google_default_client_secret="vgKG0NNv7GoDpbtoFNLxCUXu"
483 + myconf_gn+=" google_api_key=\"${google_api_key}\""
484 + myconf_gn+=" google_default_client_id=\"${google_default_client_id}\""
485 + myconf_gn+=" google_default_client_secret=\"${google_default_client_secret}\""
486 +
487 + local myarch="$(tc-arch)"
488 + if [[ $myarch = amd64 ]] ; then
489 + myconf_gn+=" target_cpu=\"x64\""
490 + ffmpeg_target_arch=x64
491 + elif [[ $myarch = x86 ]] ; then
492 + myconf_gn+=" target_cpu=\"x86\""
493 + ffmpeg_target_arch=ia32
494 + elif [[ $myarch = arm64 ]] ; then
495 + myconf_gn+=" target_cpu=\"arm64\""
496 + ffmpeg_target_arch=arm64
497 + elif [[ $myarch = arm ]] ; then
498 + myconf_gn+=" target_cpu=\"arm\""
499 + ffmpeg_target_arch=$(usex neon arm-neon arm)
500 + else
501 + die "Failed to determine target arch, got '$myarch'."
502 + fi
503 +
504 + # Make sure that -Werror doesn't get added to CFLAGS by the build system.
505 + # Depending on GCC version the warnings are different and we don't want
506 + # the build to fail because of that.
507 + myconf_gn+=" treat_warnings_as_errors=false"
508 +
509 + # Disable fatal linker warnings, bug 506268.
510 + myconf_gn+=" fatal_linker_warnings=false"
511 +
512 + # Avoid CFLAGS problems, bug #352457, bug #390147.
513 + if ! use custom-cflags; then
514 + replace-flags "-Os" "-O2"
515 + strip-flags
516 +
517 + # Prevent linker from running out of address space, bug #471810 .
518 + if use x86; then
519 + filter-flags "-g*"
520 + fi
521 +
522 + # Prevent libvpx build failures. Bug 530248, 544702, 546984.
523 + if [[ ${myarch} == amd64 || ${myarch} == x86 ]]; then
524 + filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 -mno-avx -mno-avx2
525 + fi
526 + fi
527 +
528 + # Make sure the build system will use the right tools, bug #340795.
529 + tc-export AR CC CXX NM
530 +
531 + # Define a custom toolchain for GN
532 + myconf_gn+=" custom_toolchain=\"//build/toolchain/linux/unbundle:default\""
533 +
534 + if tc-is-cross-compiler; then
535 + tc-export BUILD_{AR,CC,CXX,NM}
536 + myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:host\""
537 + myconf_gn+=" v8_snapshot_toolchain=\"//build/toolchain/linux/unbundle:host\""
538 + else
539 + myconf_gn+=" host_toolchain=\"//build/toolchain/linux/unbundle:default\""
540 + fi
541 +
542 + # https://bugs.gentoo.org/588596
543 + append-cxxflags $(test-flags-CXX -fno-delete-null-pointer-checks)
544 +
545 + # Bug 491582.
546 + export TMPDIR="${WORKDIR}/temp"
547 + mkdir -p -m 755 "${TMPDIR}" || die
548 +
549 + if ! use system-ffmpeg; then
550 + local build_ffmpeg_args=""
551 + if use pic && [[ "${ffmpeg_target_arch}" == "ia32" ]]; then
552 + build_ffmpeg_args+=" --disable-asm"
553 + fi
554 +
555 + # Re-configure bundled ffmpeg. See bug #491378 for example reasons.
556 + einfo "Configuring bundled ffmpeg..."
557 + pushd third_party/ffmpeg > /dev/null || die
558 + chromium/scripts/build_ffmpeg.py linux ${ffmpeg_target_arch} \
559 + --branding ${ffmpeg_branding} -- ${build_ffmpeg_args} || die
560 + chromium/scripts/copy_config.sh || die
561 + chromium/scripts/generate_gn.py || die
562 + popd > /dev/null || die
563 + fi
564 +
565 + bootstrap_gn
566 +
567 + einfo "Configuring Chromium..."
568 + set -- out/Release/gn gen --args="${myconf_gn}" out/Release
569 + echo "$@"
570 + "$@" || die
571 +}
572 +
573 +src_compile() {
574 + # Calling this here supports resumption via FEATURES=keepwork
575 + python_setup
576 +
577 + local ninja_targets="chrome chromedriver"
578 + if use suid; then
579 + ninja_targets+=" chrome_sandbox"
580 + fi
581 +
582 + # Build mksnapshot and pax-mark it.
583 + if tc-is-cross-compiler; then
584 + eninja -C out/Release host/mksnapshot || die
585 + pax-mark m out/Release/host/mksnapshot
586 + else
587 + eninja -C out/Release mksnapshot || die
588 + pax-mark m out/Release/mksnapshot
589 + fi
590 +
591 + # Even though ninja autodetects number of CPUs, we respect
592 + # user's options, for debugging with -j 1 or any other reason.
593 + eninja -C out/Release ${ninja_targets} || die
594 +
595 + pax-mark m out/Release/chrome
596 +}
597 +
598 +src_install() {
599 + local CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser"
600 + exeinto "${CHROMIUM_HOME}"
601 + doexe out/Release/chrome
602 +
603 + if use suid; then
604 + newexe out/Release/chrome_sandbox chrome-sandbox
605 + fperms 4755 "${CHROMIUM_HOME}/chrome-sandbox"
606 + fi
607 +
608 + doexe out/Release/chromedriver
609 +
610 + local sedargs=( -e "s:/usr/lib/:/usr/$(get_libdir)/:g" )
611 + sed "${sedargs[@]}" "${FILESDIR}/chromium-launcher-r3.sh" > chromium-launcher.sh || die
612 + doexe chromium-launcher.sh
613 +
614 + # It is important that we name the target "chromium-browser",
615 + # xdg-utils expect it; bug #355517.
616 + dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser
617 + # keep the old symlink around for consistency
618 + dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium
619 +
620 + dosym "${CHROMIUM_HOME}/chromedriver" /usr/bin/chromedriver
621 +
622 + # Allow users to override command-line options, bug #357629.
623 + insinto /etc/chromium
624 + newins "${FILESDIR}/chromium.default" "default"
625 +
626 + pushd out/Release/locales > /dev/null || die
627 + chromium_remove_language_paks
628 + popd
629 +
630 + if use widevine; then
631 + # These will be provided by chrome-binary-plugins
632 + rm out/Release/libwidevinecdm*.so || die
633 + fi
634 +
635 + insinto "${CHROMIUM_HOME}"
636 + doins out/Release/*.bin
637 + doins out/Release/*.pak
638 + doins out/Release/*.so
639 +
640 + if ! use system-icu; then
641 + doins out/Release/icudtl.dat
642 + fi
643 +
644 + doins -r out/Release/locales
645 + doins -r out/Release/resources
646 +
647 + insinto "${CHROMIUM_HOME}/swiftshader"
648 + doins out/Release/swiftshader/*.so
649 +
650 + # Install icons and desktop entry.
651 + local branding size
652 + for size in 16 22 24 32 48 64 128 256 ; do
653 + case ${size} in
654 + 16|32) branding="chrome/app/theme/default_100_percent/chromium" ;;
655 + *) branding="chrome/app/theme/chromium" ;;
656 + esac
657 + newicon -s ${size} "${branding}/product_logo_${size}.png" \
658 + chromium-browser.png
659 + done
660 +
661 + local mime_types="text/html;text/xml;application/xhtml+xml;"
662 + mime_types+="x-scheme-handler/http;x-scheme-handler/https;" # bug #360797
663 + mime_types+="x-scheme-handler/ftp;" # bug #412185
664 + mime_types+="x-scheme-handler/mailto;x-scheme-handler/webcal;" # bug #416393
665 + make_desktop_entry \
666 + chromium-browser \
667 + "Chromium" \
668 + chromium-browser \
669 + "Network;WebBrowser" \
670 + "MimeType=${mime_types}\nStartupWMClass=chromium-browser"
671 + sed -e "/^Exec/s/$/ %U/" -i "${ED}"/usr/share/applications/*.desktop || die
672 +
673 + # Install GNOME default application entry (bug #303100).
674 + insinto /usr/share/gnome-control-center/default-apps
675 + newins "${FILESDIR}"/chromium-browser.xml chromium-browser.xml
676 +
677 + readme.gentoo_create_doc
678 +}
679 +
680 +pkg_preinst() {
681 + gnome2_icon_savelist
682 +}
683 +
684 +pkg_postrm() {
685 + gnome2_icon_cache_update
686 + xdg_desktop_database_update
687 +}
688 +
689 +pkg_postinst() {
690 + gnome2_icon_cache_update
691 + xdg_desktop_database_update
692 + readme.gentoo_print_elog
693 +}
694
695 diff --git a/www-client/chromium/files/chromium-gn-bootstrap-r22.patch b/www-client/chromium/files/chromium-gn-bootstrap-r22.patch
696 new file mode 100644
697 index 00000000000..5723281cc7d
698 --- /dev/null
699 +++ b/www-client/chromium/files/chromium-gn-bootstrap-r22.patch
700 @@ -0,0 +1,10 @@
701 +--- a/tools/gn/bootstrap/bootstrap.py
702 ++++ b/tools/gn/bootstrap/bootstrap.py
703 +@@ -481,6 +481,7 @@
704 + 'base/metrics/sample_vector.cc',
705 + 'base/metrics/sparse_histogram.cc',
706 + 'base/metrics/statistics_recorder.cc',
707 ++ 'base/observer_list_threadsafe.cc',
708 + 'base/path_service.cc',
709 + 'base/pending_task.cc',
710 + 'base/pickle.cc',