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/
Date: Fri, 01 Apr 2016 01:46:54
Message-Id: 1459475206.0952fe04b74c711dd9dd8437ca4708d6687b476f.floppym@gentoo
1 commit: 0952fe04b74c711dd9dd8437ca4708d6687b476f
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Fri Apr 1 01:46:21 2016 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Fri Apr 1 01:46:46 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0952fe04
7
8 www-client/chromium: beta channel bump (50.0.2661.57)
9
10 Package-Manager: portage-2.2.28_p64
11
12 www-client/chromium/Manifest | 1 +
13 www-client/chromium/chromium-50.0.2661.57.ebuild | 695 +++++++++++++++++++++++
14 2 files changed, 696 insertions(+)
15
16 diff --git a/www-client/chromium/Manifest b/www-client/chromium/Manifest
17 index 8f5ed27..52334cf 100644
18 --- a/www-client/chromium/Manifest
19 +++ b/www-client/chromium/Manifest
20 @@ -1,4 +1,5 @@
21 DIST chromium-49.0.2623.108.tar.xz 520440328 SHA256 da083a2bf17ff4c9b09b7451a81dfb41ece6b50ad363df20e918909e8cbcb1c0 SHA512 4b52bad489c21f20598c2770a4240e07e57fc127492eea6d7401214d3dbc74fdc68a8f20bbcff5c12ff5ff51cb0e76e2585ed590c2ca14fac7b99f4dd9281ee3 WHIRLPOOL cd7ec9002e1c1bd794fd1448294bd7aedd9bfe83839f4270046edab7c66d11c0d9f3223aabdc33870831592c939aff4d7fc1e73608d4cc21709f1cd523f34728
22 DIST chromium-50.0.2661.37.tar.xz 462477912 SHA256 e67a0e083a446ab57cabe8c7d8e1047aac128ee1aecaddc3d9f801b178a7be39 SHA512 e620d005a1ce2bfd0f3fe940914ac4e117feadbc8a569fa6e32be2593d540dc350c1282675a9f8cb07402a5393203eed77894531f3a9fe2cf16cbb8f70c124d3 WHIRLPOOL 97b66dbfa1824f45a038f761aa1d41852c174853b80bc8c297497ac4d549e46d84b6eb1f6732615c258f14c12aa3b02f3826bebcf2afceca27d8e04f1b311cf8
23 +DIST chromium-50.0.2661.57.tar.xz 531527864 SHA256 16f942657c746541a5e8041f4cd493d714e303260b78dd57451cd3c49bdf91a0 SHA512 7833f1617e15fe47ed108d852921acbdd4e18f58171af2ceababfd677531c523dbf2513b6b18b7bedc006bfafb4010db446d90067e6baebc3a5c64da3383b6b4 WHIRLPOOL 1d604590fe76a0d85adbafcc4f6d56a8f369b35b71988a7b01750c137988f13f0e13a0c8380c7cc66563997e8cb1ca74ad30b5472371c8bc524b7926781fd892
24 DIST chromium-51.0.2687.0.tar.xz 462664524 SHA256 2453e8c43cec937e8ec38e69714a2a18827fffbd4646c62e50f64d99fb9d32f0 SHA512 518d22e5171bc668775356878b4d949ad9e531b329b06ea29f3c909865671da55ec809c058d262e9ece23fa0def805f02d893aba80e487259722a837315e99e2 WHIRLPOOL 98cb82f412c562c16b942000fb44102356bc74bfcc7917ce33db2839caddc5d69998c6e6307c4f35bc30c95ed7e6970a2500e86e1dc34da13ccfcb0656232452
25 DIST chromium-51.0.2693.2.tar.xz 462914536 SHA256 14ce7bbdce06b1c548cd012572895ed7688d477456d354c99ad0cae8e9345010 SHA512 0b679d084f62f47d967674fd19af90d686f5aa0119ab350d167267a7b0b8acd7bdc53972292802e7987a4c52a254ef3a89d235135c48e70eac2e1282b1d92933 WHIRLPOOL f99bc9a76514ec008ee6aa5b3f739fa75cecf6148b61efdd70ac1787d3d96c308c0c5df4d8d3ca20ff374cd5560eafdbd33f1d156c5c32870b6d079ee2a51b82
26
27 diff --git a/www-client/chromium/chromium-50.0.2661.57.ebuild b/www-client/chromium/chromium-50.0.2661.57.ebuild
28 new file mode 100644
29 index 0000000..030e6f9
30 --- /dev/null
31 +++ b/www-client/chromium/chromium-50.0.2661.57.ebuild
32 @@ -0,0 +1,695 @@
33 +# Copyright 1999-2016 Gentoo Foundation
34 +# Distributed under the terms of the GNU General Public License v2
35 +# $Id$
36 +
37 +EAPI="5"
38 +PYTHON_COMPAT=( python2_7 )
39 +
40 +CHROMIUM_LANGS="am ar bg bn ca cs da de el en_GB es es_LA 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 eutils flag-o-matic multilib multiprocessing pax-utils \
45 + portability python-any-r1 readme.gentoo toolchain-funcs versionator virtualx
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 hotwording? ( no-source-code )"
52 +SLOT="0"
53 +KEYWORDS="~amd64 ~arm ~arm64 ~x86"
54 +IUSE="cups gn gnome gnome-keyring gtk3 +hangouts hidpi hotwording kerberos neon pic +proprietary-codecs pulseaudio selinux +system-ffmpeg +tcmalloc widevine"
55 +RESTRICT="!system-ffmpeg? ( proprietary-codecs? ( bindist ) )"
56 +
57 +REQUIRED_USE="gn? ( kerberos !system-ffmpeg )"
58 +
59 +# Native Client binaries are compiled with different set of flags, bug #452066.
60 +QA_FLAGS_IGNORED=".*\.nexe"
61 +
62 +# Native Client binaries may be stripped by the build system, which uses the
63 +# right tools for it, bug #469144 .
64 +QA_PRESTRIPPED=".*\.nexe"
65 +
66 +RDEPEND="
67 + app-arch/bzip2:=
68 + cups? ( >=net-print/cups-1.3.11:= )
69 + >=dev-libs/elfutils-0.149
70 + dev-libs/expat:=
71 + dev-libs/glib:=
72 + >=dev-libs/jsoncpp-0.5.0-r1:=
73 + dev-libs/nspr:=
74 + >=dev-libs/nss-3.14.3:=
75 + gnome? ( >=gnome-base/gconf-2.24.0:= )
76 + gnome-keyring? ( >=gnome-base/libgnome-keyring-3.12:= )
77 + >=media-libs/alsa-lib-1.0.19:=
78 + media-libs/fontconfig:=
79 + media-libs/freetype:=
80 + media-libs/libexif:=
81 + media-libs/speex:=
82 + pulseaudio? ( media-sound/pulseaudio:= )
83 + system-ffmpeg? ( >=media-video/ffmpeg-2.7.2:= )
84 + sys-apps/dbus:=
85 + sys-apps/pciutils:=
86 + >=sys-libs/libcap-2.22:=
87 + virtual/udev
88 + x11-libs/cairo:=
89 + x11-libs/gdk-pixbuf:=
90 + gtk3? ( x11-libs/gtk+:3= )
91 + !gtk3? ( x11-libs/gtk+:2= )
92 + x11-libs/libdrm
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/libXinerama:=
101 + x11-libs/libXrandr:=
102 + x11-libs/libXrender:=
103 + x11-libs/libXScrnSaver:=
104 + x11-libs/libXtst:=
105 + x11-libs/pango:=
106 + kerberos? ( virtual/krb5 )
107 + !gn? (
108 + >=app-accessibility/speech-dispatcher-0.8:=
109 + app-arch/snappy:=
110 + >=dev-libs/libevent-1.4.13:=
111 + dev-libs/libxml2:=[icu]
112 + dev-libs/libxslt:=
113 + media-libs/flac:=
114 + >=media-libs/harfbuzz-0.9.41:=[icu(+)]
115 + >=media-libs/libjpeg-turbo-1.2.0-r1:=
116 + media-libs/libpng:0=
117 + >=media-libs/libwebp-0.4.0:=
118 + sys-libs/zlib:=[minizip]
119 + )"
120 +DEPEND="${RDEPEND}
121 + !arm? (
122 + dev-lang/yasm
123 + )
124 + dev-lang/perl
125 + dev-perl/JSON
126 + >=dev-util/gperf-3.0.3
127 + dev-util/ninja
128 + sys-apps/hwids[usb(+)]
129 + >=sys-devel/bison-2.4.3
130 + sys-devel/flex
131 + virtual/pkgconfig"
132 +
133 +# For nvidia-drivers blocker, see bug #413637 .
134 +RDEPEND+="
135 + !=www-client/chromium-9999
136 + !<www-plugins/chrome-binary-plugins-37
137 + x11-misc/xdg-utils
138 + virtual/opengl
139 + virtual/ttf-fonts
140 + selinux? ( sec-policy/selinux-chromium )
141 + tcmalloc? ( !<x11-drivers/nvidia-drivers-331.20 )
142 + widevine? ( www-plugins/chrome-binary-plugins[widevine(-)] )"
143 +
144 +# Python dependencies. The DEPEND part needs to be kept in sync
145 +# with python_check_deps.
146 +DEPEND+=" $(python_gen_any_dep '
147 + dev-python/beautifulsoup:python-2[${PYTHON_USEDEP}]
148 + dev-python/beautifulsoup:4[${PYTHON_USEDEP}]
149 + dev-python/html5lib[${PYTHON_USEDEP}]
150 + dev-python/jinja[${PYTHON_USEDEP}]
151 + dev-python/ply[${PYTHON_USEDEP}]
152 + dev-python/simplejson[${PYTHON_USEDEP}]
153 +')"
154 +python_check_deps() {
155 + has_version --host-root "dev-python/beautifulsoup:python-2[${PYTHON_USEDEP}]" &&
156 + has_version --host-root "dev-python/beautifulsoup:4[${PYTHON_USEDEP}]" &&
157 + has_version --host-root "dev-python/html5lib[${PYTHON_USEDEP}]" &&
158 + has_version --host-root "dev-python/jinja[${PYTHON_USEDEP}]" &&
159 + has_version --host-root "dev-python/ply[${PYTHON_USEDEP}]" &&
160 + has_version --host-root "dev-python/simplejson[${PYTHON_USEDEP}]"
161 +}
162 +
163 +if ! has chromium_pkg_die ${EBUILD_DEATH_HOOKS}; then
164 + EBUILD_DEATH_HOOKS+=" chromium_pkg_die";
165 +fi
166 +
167 +DISABLE_AUTOFORMATTING="yes"
168 +DOC_CONTENTS="
169 +Some web pages may require additional fonts to display properly.
170 +Try installing some of the following packages if some characters
171 +are not displayed properly:
172 +- media-fonts/arphicfonts
173 +- media-fonts/bitstream-cyberbit
174 +- media-fonts/droid
175 +- media-fonts/ipamonafont
176 +- media-fonts/ja-ipafonts
177 +- media-fonts/takao-fonts
178 +- media-fonts/wqy-microhei
179 +- media-fonts/wqy-zenhei
180 +
181 +Depending on your desktop environment, you may need
182 +to install additional packages to get icons on the Downloads page.
183 +
184 +For KDE, the required package is kde-frameworks/oxygen-icons.
185 +
186 +For other desktop environments, try one of the following:
187 +- x11-themes/gnome-icon-theme
188 +- x11-themes/tango-icon-theme
189 +"
190 +
191 +pkg_pretend() {
192 + if [[ $(tc-getCC)$ == *gcc* ]] && \
193 + [[ $(gcc-major-version)$(gcc-minor-version) -lt 48 ]]; then
194 + die 'At least gcc 4.8 is required, see bugs: #535730, #525374, #518668.'
195 + fi
196 +
197 + # Check build requirements, bug #541816 and bug #471810 .
198 + CHECKREQS_MEMORY="3G"
199 + CHECKREQS_DISK_BUILD="5G"
200 + eshopts_push -s extglob
201 + if is-flagq '-g?(gdb)?([1-9])'; then
202 + CHECKREQS_DISK_BUILD="25G"
203 + fi
204 + eshopts_pop
205 + check-reqs_pkg_pretend
206 +}
207 +
208 +pkg_setup() {
209 + if [[ "${SLOT}" == "0" ]]; then
210 + CHROMIUM_SUFFIX=""
211 + else
212 + CHROMIUM_SUFFIX="-${SLOT}"
213 + fi
214 + CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser${CHROMIUM_SUFFIX}"
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 + epatch "${FILESDIR}/${PN}-system-ffmpeg-r2.patch"
224 + epatch "${FILESDIR}/${PN}-system-jinja-r8.patch"
225 + epatch "${FILESDIR}/${PN}-widevine-r1.patch"
226 + epatch "${FILESDIR}/${PN}-last-commit-position-r0.patch"
227 + epatch "${FILESDIR}/${PN}-snapshot-toolchain-r1.patch"
228 + epatch "${FILESDIR}/chromium-whitelist-arm64-syscalls.patch"
229 +
230 + epatch_user
231 +
232 + local conditional_bundled_libraries=""
233 + if ! use system-ffmpeg; then
234 + conditional_bundled_libraries+=" third_party/ffmpeg"
235 + fi
236 + if use gn; then
237 + conditional_bundled_libraries+="
238 + base/third_party/libevent
239 + third_party/adobe
240 + third_party/ffmpeg
241 + third_party/flac
242 + third_party/harfbuzz-ng
243 + third_party/icu
244 + third_party/jinja2
245 + third_party/libjpeg_turbo
246 + third_party/libpng
247 + third_party/libwebp
248 + third_party/libxml
249 + third_party/libxslt
250 + third_party/markupsafe
251 + third_party/snappy
252 + third_party/speech-dispatcher
253 + third_party/usb_ids
254 + third_party/xdg-utils
255 + third_party/yasm
256 + third_party/zlib
257 + "
258 + fi
259 +
260 + # Remove most bundled libraries. Some are still needed.
261 + build/linux/unbundle/remove_bundled_libraries.py \
262 + ${conditional_bundled_libraries} \
263 + 'base/third_party/dmg_fp' \
264 + 'base/third_party/dynamic_annotations' \
265 + 'base/third_party/icu' \
266 + 'base/third_party/nspr' \
267 + 'base/third_party/superfasthash' \
268 + 'base/third_party/symbolize' \
269 + 'base/third_party/valgrind' \
270 + 'base/third_party/xdg_mime' \
271 + 'base/third_party/xdg_user_dirs' \
272 + 'breakpad/src/third_party/curl' \
273 + 'chrome/third_party/mozilla_security_manager' \
274 + 'courgette/third_party' \
275 + 'crypto/third_party/nss' \
276 + 'net/third_party/mozilla_security_manager' \
277 + 'net/third_party/nss' \
278 + 'third_party/WebKit' \
279 + 'third_party/analytics' \
280 + 'third_party/angle' \
281 + 'third_party/angle/src/third_party/compiler' \
282 + 'third_party/angle/src/third_party/murmurhash' \
283 + 'third_party/angle/src/third_party/trace_event' \
284 + 'third_party/boringssl' \
285 + 'third_party/brotli' \
286 + 'third_party/cacheinvalidation' \
287 + 'third_party/catapult' \
288 + 'third_party/catapult/third_party/py_vulcanize' \
289 + 'third_party/catapult/third_party/py_vulcanize/third_party/rcssmin' \
290 + 'third_party/catapult/third_party/py_vulcanize/third_party/rjsmin' \
291 + 'third_party/catapult/tracing/third_party/components/polymer' \
292 + 'third_party/catapult/tracing/third_party/d3' \
293 + 'third_party/catapult/tracing/third_party/gl-matrix' \
294 + 'third_party/catapult/tracing/third_party/jszip' \
295 + 'third_party/cld_2' \
296 + 'third_party/cros_system_api' \
297 + 'third_party/cython/python_flags.py' \
298 + 'third_party/devscripts' \
299 + 'third_party/dom_distiller_js' \
300 + 'third_party/dom_distiller_js/dist/proto_gen/third_party/dom_distiller_js' \
301 + 'third_party/fips181' \
302 + 'third_party/flot' \
303 + 'third_party/google_input_tools' \
304 + 'third_party/google_input_tools/third_party/closure_library' \
305 + 'third_party/google_input_tools/third_party/closure_library/third_party/closure' \
306 + 'third_party/hunspell' \
307 + 'third_party/iccjpeg' \
308 + 'third_party/icu' \
309 + 'third_party/jstemplate' \
310 + 'third_party/khronos' \
311 + 'third_party/leveldatabase' \
312 + 'third_party/libXNVCtrl' \
313 + 'third_party/libaddressinput' \
314 + 'third_party/libjingle' \
315 + 'third_party/libphonenumber' \
316 + 'third_party/libsecret' \
317 + 'third_party/libsrtp' \
318 + 'third_party/libudev' \
319 + 'third_party/libusb' \
320 + 'third_party/libvpx_new' \
321 + 'third_party/libvpx_new/source/libvpx/third_party/x86inc' \
322 + 'third_party/libxml/chromium' \
323 + 'third_party/libwebm' \
324 + 'third_party/libyuv' \
325 + 'third_party/lss' \
326 + 'third_party/lzma_sdk' \
327 + 'third_party/mesa' \
328 + 'third_party/modp_b64' \
329 + 'third_party/mt19937ar' \
330 + 'third_party/npapi' \
331 + 'third_party/openh264' \
332 + 'third_party/openmax_dl' \
333 + 'third_party/opus' \
334 + 'third_party/ots' \
335 + 'third_party/pdfium' \
336 + 'third_party/pdfium/third_party/agg23' \
337 + 'third_party/pdfium/third_party/base' \
338 + 'third_party/pdfium/third_party/bigint' \
339 + 'third_party/pdfium/third_party/freetype' \
340 + 'third_party/pdfium/third_party/lcms2-2.6' \
341 + 'third_party/pdfium/third_party/libjpeg' \
342 + 'third_party/pdfium/third_party/libopenjpeg20' \
343 + 'third_party/pdfium/third_party/zlib_v128' \
344 + 'third_party/polymer' \
345 + 'third_party/protobuf' \
346 + 'third_party/qcms' \
347 + 'third_party/re2' \
348 + 'third_party/sfntly' \
349 + 'third_party/skia' \
350 + 'third_party/smhasher' \
351 + 'third_party/sqlite' \
352 + 'third_party/tcmalloc' \
353 + 'third_party/usrsctp' \
354 + 'third_party/web-animations-js' \
355 + 'third_party/webdriver' \
356 + 'third_party/webrtc' \
357 + 'third_party/widevine' \
358 + 'third_party/woff2' \
359 + 'third_party/x86inc' \
360 + 'third_party/zlib/google' \
361 + 'url/third_party/mozilla' \
362 + 'v8/src/third_party/fdlibm' \
363 + 'v8/src/third_party/valgrind' \
364 + --do-remove || die
365 +}
366 +
367 +src_configure() {
368 + local myconf_gyp=""
369 + local myconf_gn=""
370 +
371 + # GN needs explicit config for Debug/Release as opposed to inferring it from build directory.
372 + myconf_gn+=" is_debug=false"
373 +
374 + # Never tell the build system to "enable" SSE2, it has a few unexpected
375 + # additions, bug #336871.
376 + myconf_gyp+=" -Ddisable_sse2=1"
377 +
378 + # Disable nacl, we can't build without pnacl (http://crbug.com/269560).
379 + myconf_gyp+=" -Ddisable_nacl=1"
380 + myconf_gn+=" enable_nacl=false"
381 +
382 + # Make it possible to remove third_party/adobe.
383 + echo > "${T}/flapper_version.h" || die
384 + myconf_gyp+=" -Dflapper_version_h_file=${T}/flapper_version.h"
385 +
386 + # Use system-provided libraries.
387 + # TODO: use_system_hunspell (upstream changes needed).
388 + # TODO: use_system_icu (bug #576370).
389 + # TODO: use_system_libsrtp (bug #459932).
390 + # TODO: use_system_libusb (http://crbug.com/266149).
391 + # TODO: use_system_libvpx (http://crbug.com/494939).
392 + # TODO: use_system_opus (https://code.google.com/p/webrtc/issues/detail?id=3077).
393 + # TODO: use_system_protobuf (bug #525560).
394 + # TODO: use_system_re2 (bug #571156).
395 + # TODO: use_system_ssl (http://crbug.com/58087).
396 + # TODO: use_system_sqlite (http://crbug.com/22208).
397 + myconf_gyp+="
398 + -Duse_system_bzip2=1
399 + -Duse_system_ffmpeg=$(usex system-ffmpeg 1 0)
400 + -Duse_system_flac=1
401 + -Duse_system_harfbuzz=1
402 + -Duse_system_jsoncpp=1
403 + -Duse_system_libevent=1
404 + -Duse_system_libjpeg=1
405 + -Duse_system_libpng=1
406 + -Duse_system_libwebp=1
407 + -Duse_system_libxml=1
408 + -Duse_system_libxslt=1
409 + -Duse_system_minizip=1
410 + -Duse_system_nspr=1
411 + -Duse_system_snappy=1
412 + -Duse_system_speex=1
413 + -Duse_system_xdg_utils=1
414 + -Duse_system_zlib=1"
415 +
416 + # Needed for system icu - we don't need additional data files.
417 + # myconf_gyp+=" -Dicu_use_data_file_flag=0"
418 +
419 + # TODO: patch gyp so that this arm conditional is not needed.
420 + if ! use arm; then
421 + myconf_gyp+="
422 + -Duse_system_yasm=1"
423 + fi
424 +
425 + # Optional dependencies.
426 + # TODO: linux_link_kerberos, bug #381289.
427 + myconf_gyp+="
428 + $(gyp_use cups)
429 + $(gyp_use gnome use_gconf)
430 + $(gyp_use gnome-keyring use_gnome_keyring)
431 + $(gyp_use gnome-keyring linux_link_gnome_keyring)
432 + $(gyp_use gtk3)
433 + $(gyp_use hangouts enable_hangout_services_extension)
434 + $(gyp_use hidpi enable_hidpi)
435 + $(gyp_use hotwording enable_hotwording)
436 + $(gyp_use kerberos)
437 + $(gyp_use pulseaudio)
438 + $(gyp_use tcmalloc use_allocator tcmalloc none)
439 + $(gyp_use widevine enable_widevine)"
440 +
441 + myconf_gn+=" use_cups=$(usex cups true false)"
442 +
443 + # Use explicit library dependencies instead of dlopen.
444 + # This makes breakages easier to detect by revdep-rebuild.
445 + myconf_gyp+="
446 + -Dlinux_link_gsettings=1
447 + -Dlinux_link_libpci=1
448 + -Dlinux_link_libspeechd=1
449 + -Dlibspeechd_h_prefix=speech-dispatcher/"
450 +
451 + # TODO: use the file at run time instead of effectively compiling it in.
452 + myconf_gyp+="
453 + -Dusb_ids_path=/usr/share/misc/usb.ids"
454 +
455 + # Save space by removing DLOG and DCHECK messages (about 6% reduction).
456 + myconf_gyp+="
457 + -Dlogging_like_official_build=1"
458 +
459 + if [[ $(tc-getCC) == *clang* ]]; then
460 + myconf_gyp+=" -Dclang=1"
461 + myconf_gn+=" is_clang=true"
462 + else
463 + myconf_gyp+=" -Dclang=0"
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 + myconf_gyp+="
470 + -Dclang_use_chrome_plugins=0
471 + -Dhost_clang=0
472 + -Dlinux_use_bundled_binutils=0
473 + -Dlinux_use_bundled_gold=0
474 + -Dlinux_use_gold_flags=0
475 + -Dsysroot="
476 + myconf_gn+=" use_sysroot=false"
477 +
478 + ffmpeg_branding="$(usex proprietary-codecs Chrome Chromium)"
479 + myconf_gyp+=" -Dproprietary_codecs=1 -Dffmpeg_branding=${ffmpeg_branding}"
480 +
481 + # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys .
482 + # Note: these are for Gentoo use ONLY. For your own distribution,
483 + # please get your own set of keys. Feel free to contact chromium@g.o
484 + # for more info.
485 + myconf_gyp+=" -Dgoogle_api_key=AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc
486 + -Dgoogle_default_client_id=329227923882.apps.googleusercontent.com
487 + -Dgoogle_default_client_secret=vgKG0NNv7GoDpbtoFNLxCUXu"
488 +
489 + local myarch="$(tc-arch)"
490 + if [[ $myarch = amd64 ]] ; then
491 + target_arch=x64
492 + ffmpeg_target_arch=x64
493 + elif [[ $myarch = x86 ]] ; then
494 + target_arch=ia32
495 + ffmpeg_target_arch=ia32
496 + elif [[ $myarch = arm64 ]] ; then
497 + target_arch=arm64
498 + ffmpeg_target_arch=arm64
499 + elif [[ $myarch = arm ]] ; then
500 + target_arch=arm
501 + ffmpeg_target_arch=$(usex neon arm-neon arm)
502 + # TODO: re-enable NaCl (NativeClient).
503 + local CTARGET=${CTARGET:-${CHOST}}
504 + if [[ $(tc-is-softfloat) == "no" ]]; then
505 +
506 + myconf_gyp+=" -Darm_float_abi=hard"
507 + fi
508 + filter-flags "-mfpu=*"
509 + use neon || myconf_gyp+=" -Darm_fpu=${ARM_FPU:-vfpv3-d16}"
510 +
511 + if [[ ${CTARGET} == armv[78]* ]]; then
512 + myconf_gyp+=" -Darmv7=1"
513 + else
514 + myconf_gyp+=" -Darmv7=0"
515 + fi
516 + myconf_gyp+=" -Dsysroot=
517 + $(gyp_use neon arm_neon)
518 + -Ddisable_nacl=1"
519 + else
520 + die "Failed to determine target arch, got '$myarch'."
521 + fi
522 +
523 + myconf_gyp+=" -Dtarget_arch=${target_arch}"
524 +
525 + # Make sure that -Werror doesn't get added to CFLAGS by the build system.
526 + # Depending on GCC version the warnings are different and we don't want
527 + # the build to fail because of that.
528 + myconf_gyp+=" -Dwerror="
529 + myconf_gn+=" treat_warnings_as_errors=false"
530 +
531 + # Disable fatal linker warnings, bug 506268.
532 + myconf_gyp+=" -Ddisable_fatal_linker_warnings=1"
533 +
534 + # Avoid CFLAGS problems, bug #352457, bug #390147.
535 + if ! use custom-cflags; then
536 + replace-flags "-Os" "-O2"
537 + strip-flags
538 +
539 + # Prevent linker from running out of address space, bug #471810 .
540 + if use x86; then
541 + filter-flags "-g*"
542 + fi
543 +
544 + # Prevent libvpx build failures. Bug 530248, 544702, 546984.
545 + if [[ ${myarch} == amd64 || ${myarch} == x86 ]]; then
546 + filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 -mno-avx -mno-avx2
547 + fi
548 + fi
549 +
550 + # Make sure the build system will use the right tools, bug #340795.
551 + tc-export AR CC CXX NM
552 +
553 + # Tools for building programs to be executed on the build system, bug #410883.
554 + if tc-is-cross-compiler; then
555 + export AR_host=$(tc-getBUILD_AR)
556 + export CC_host=$(tc-getBUILD_CC)
557 + export CXX_host=$(tc-getBUILD_CXX)
558 + export NM_host=$(tc-getBUILD_NM)
559 + fi
560 +
561 + # Bug 491582.
562 + export TMPDIR="${WORKDIR}/temp"
563 + mkdir -p -m 755 "${TMPDIR}" || die
564 +
565 + # TODO: also do this for GN bundled ffmpeg build.
566 + if ! use system-ffmpeg && ! use gn; then
567 + local build_ffmpeg_args=""
568 + if use pic && [[ "${ffmpeg_target_arch}" == "ia32" ]]; then
569 + build_ffmpeg_args+=" --disable-asm"
570 + fi
571 +
572 + # Re-configure bundled ffmpeg. See bug #491378 for example reasons.
573 + einfo "Configuring bundled ffmpeg..."
574 + pushd third_party/ffmpeg > /dev/null || die
575 + chromium/scripts/build_ffmpeg.py linux ${ffmpeg_target_arch} \
576 + --branding ${ffmpeg_branding} -- ${build_ffmpeg_args} || die
577 + chromium/scripts/copy_config.sh || die
578 + chromium/scripts/generate_gyp.py || die
579 + popd > /dev/null || die
580 + fi
581 +
582 + third_party/libaddressinput/chromium/tools/update-strings.py || die
583 +
584 + touch chrome/test/data/webui/i18n_process_css_test.html || die
585 +
586 + einfo "Configuring Chromium..."
587 + if use gn; then
588 + tools/gn/bootstrap/bootstrap.py -v --gn-gen-args "${myconf_gn}" || die
589 + out/Release/gn gen --args="${myconf_gn}" out/Release || die
590 + else
591 + build/linux/unbundle/replace_gyp_files.py ${myconf_gyp} || die
592 + egyp_chromium ${myconf_gyp} || die
593 + fi
594 +}
595 +
596 +eninja() {
597 + if [[ -z ${NINJAOPTS+set} ]]; then
598 + local jobs=$(makeopts_jobs)
599 + local loadavg=$(makeopts_loadavg)
600 +
601 + if [[ ${MAKEOPTS} == *-j* && ${jobs} != 999 ]]; then
602 + NINJAOPTS+=" -j ${jobs}"
603 + fi
604 + if [[ ${MAKEOPTS} == *-l* && ${loadavg} != 999 ]]; then
605 + NINJAOPTS+=" -l ${loadavg}"
606 + fi
607 + fi
608 + set -- ninja -v ${NINJAOPTS} "$@"
609 + echo "$@"
610 + "$@"
611 +}
612 +
613 +src_compile() {
614 + local ninja_targets="chrome chrome_sandbox chromedriver"
615 +
616 + if ! use gn; then
617 + # Build mksnapshot and pax-mark it.
618 + eninja -C out/Release mksnapshot || die
619 + pax-mark m out/Release/mksnapshot
620 + fi
621 +
622 + # Even though ninja autodetects number of CPUs, we respect
623 + # user's options, for debugging with -j 1 or any other reason.
624 + eninja -C out/Release ${ninja_targets} || die
625 +
626 + pax-mark m out/Release/chrome
627 +}
628 +
629 +src_install() {
630 + exeinto "${CHROMIUM_HOME}"
631 + doexe out/Release/chrome || die
632 +
633 + newexe out/Release/chrome_sandbox chrome-sandbox || die
634 + fperms 4755 "${CHROMIUM_HOME}/chrome-sandbox"
635 +
636 + doexe out/Release/chromedriver || die
637 + use widevine && doexe out/Release/libwidevinecdmadapter.so
638 +
639 + # if ! use arm; then
640 + # doexe out/Release/nacl_helper{,_bootstrap} || die
641 + # insinto "${CHROMIUM_HOME}"
642 + # doins out/Release/nacl_irt_*.nexe || die
643 + # doins out/Release/libppGoogleNaClPluginChrome.so || die
644 + # fi
645 +
646 + local sedargs=( -e "s:/usr/lib/:/usr/$(get_libdir)/:g" )
647 + if [[ -n ${CHROMIUM_SUFFIX} ]]; then
648 + sedargs+=(
649 + -e "s:chromium-browser:chromium-browser${CHROMIUM_SUFFIX}:g"
650 + -e "s:chromium.desktop:chromium${CHROMIUM_SUFFIX}.desktop:g"
651 + -e "s:plugins:plugins --user-data-dir=\${HOME}/.config/chromium${CHROMIUM_SUFFIX}:"
652 + )
653 + fi
654 + sed "${sedargs[@]}" "${FILESDIR}/chromium-launcher-r3.sh" > chromium-launcher.sh || die
655 + doexe chromium-launcher.sh
656 +
657 + # It is important that we name the target "chromium-browser",
658 + # xdg-utils expect it; bug #355517.
659 + dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser${CHROMIUM_SUFFIX} || die
660 + # keep the old symlink around for consistency
661 + dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium${CHROMIUM_SUFFIX} || die
662 +
663 + dosym "${CHROMIUM_HOME}/chromedriver" /usr/bin/chromedriver${CHROMIUM_SUFFIX} || die
664 +
665 + # Allow users to override command-line options, bug #357629.
666 + dodir /etc/chromium || die
667 + insinto /etc/chromium
668 + newins "${FILESDIR}/chromium.default" "default" || die
669 +
670 + pushd out/Release/locales > /dev/null || die
671 + chromium_remove_language_paks
672 + popd
673 +
674 + insinto "${CHROMIUM_HOME}"
675 + doins out/Release/*.bin || die
676 + doins out/Release/*.pak || die
677 +
678 + doins out/Release/icudtl.dat || die
679 +
680 + doins -r out/Release/locales || die
681 + doins -r out/Release/resources || die
682 +
683 + newman out/Release/chrome.1 chromium${CHROMIUM_SUFFIX}.1 || die
684 + newman out/Release/chrome.1 chromium-browser${CHROMIUM_SUFFIX}.1 || die
685 +
686 + # Install icons and desktop entry.
687 + local branding size
688 + for size in 16 22 24 32 48 64 128 256 ; do
689 + case ${size} in
690 + 16|32) branding="chrome/app/theme/default_100_percent/chromium" ;;
691 + *) branding="chrome/app/theme/chromium" ;;
692 + esac
693 + newicon -s ${size} "${branding}/product_logo_${size}.png" \
694 + chromium-browser${CHROMIUM_SUFFIX}.png
695 + done
696 +
697 + local mime_types="text/html;text/xml;application/xhtml+xml;"
698 + mime_types+="x-scheme-handler/http;x-scheme-handler/https;" # bug #360797
699 + mime_types+="x-scheme-handler/ftp;" # bug #412185
700 + mime_types+="x-scheme-handler/mailto;x-scheme-handler/webcal;" # bug #416393
701 + make_desktop_entry \
702 + chromium-browser${CHROMIUM_SUFFIX} \
703 + "Chromium${CHROMIUM_SUFFIX}" \
704 + chromium-browser${CHROMIUM_SUFFIX} \
705 + "Network;WebBrowser" \
706 + "MimeType=${mime_types}\nStartupWMClass=chromium-browser"
707 + sed -e "/^Exec/s/$/ %U/" -i "${ED}"/usr/share/applications/*.desktop || die
708 +
709 + # Install GNOME default application entry (bug #303100).
710 + if use gnome; then
711 + dodir /usr/share/gnome-control-center/default-apps || die
712 + insinto /usr/share/gnome-control-center/default-apps
713 + newins "${FILESDIR}"/chromium-browser.xml chromium-browser${CHROMIUM_SUFFIX}.xml || die
714 + if [[ "${CHROMIUM_SUFFIX}" != "" ]]; then
715 + sed "s:chromium-browser:chromium-browser${CHROMIUM_SUFFIX}:g" -i \
716 + "${ED}"/usr/share/gnome-control-center/default-apps/chromium-browser${CHROMIUM_SUFFIX}.xml
717 + fi
718 + fi
719 +
720 + readme.gentoo_create_doc
721 +}
722 +
723 +pkg_postinst() {
724 + fdo-mime_desktop_database_update
725 + gnome2_icon_cache_update
726 + readme.gentoo_print_elog
727 +}