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