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: Sun, 13 Dec 2015 15:02:28
Message-Id: 1450018926.726500e3654c4e299d442fa904bb40fbd773d91b.floppym@gentoo
1 commit: 726500e3654c4e299d442fa904bb40fbd773d91b
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Sun Dec 13 15:01:56 2015 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Sun Dec 13 15:02:06 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=726500e3
7
8 www-client/chromium: Beta channel bump (48.0.2564.41)
9
10 Package-Manager: portage-2.2.26_p27
11
12 www-client/chromium/Manifest | 1 +
13 www-client/chromium/chromium-48.0.2564.41.ebuild | 691 +++++++++++++++++++++++
14 2 files changed, 692 insertions(+)
15
16 diff --git a/www-client/chromium/Manifest b/www-client/chromium/Manifest
17 index c7eb1a3..c72d389 100644
18 --- a/www-client/chromium/Manifest
19 +++ b/www-client/chromium/Manifest
20 @@ -1,3 +1,4 @@
21 DIST chromium-47.0.2526.80-lite.tar.xz 376352828 SHA256 680165441f909f5bac6cbbefeaf7050f76d815d8a1de7f02d89892127274cd86 SHA512 c62639d46867d4db440f8e1a17be295245c1ae74ffbac31285b95e113112de4f4a1441364941a027c2acdbc5a001e1667fa7653caa1e15d08f279e729e6ead86 WHIRLPOOL 20fdb9d97e4fc03cbe4d44d84296c2ab4c11d210da82699f640b00443920c361b3238294b603b99ba53fab541637bf50d4789aacc356f0ac0fd294875c881dc1
22 DIST chromium-48.0.2564.10.tar.xz 432060420 SHA256 1902d75d49d46c32a8c33f6de53c9253a63a364b85eb4ada1e8a9ba7c0f523d0 SHA512 7753dc19a50c862211c10975b3ad64a0408e3645df7b0ea548f8437c4c5380ad0bb350920eb8c6791e0685ae7ec921c6be720e337a17dffe4b73c56b74a2bc9a WHIRLPOOL a9ccb2872ad639886288581e1c7d9244f16965ef924395531701289cc69c5a9dfdc4a25175151d27b150acc8e4398c8d91ca5f8f3e623c3c85c8b99d913c4f00
23 DIST chromium-48.0.2564.23.tar.xz 1099898120 SHA256 e9a5eeaedb1975a93d37bc865d3122cf28b7e3a246c06ba19204edaefbce1266 SHA512 72b253f39b561e53c0ef2220402ae15e8d2cdd1af8eab4d5fa8480316919df9059dddf4f4c0d027f78fd0db924b7cbd23d29d406808d18fa047ccddffb6701b3 WHIRLPOOL c133e8e389b560efcc239e2f24bb3befd3fe8731bb2529aeee3f2ae04bf09e5d815ef805750c48dd549fb0b94c1ab77d94b03a0b8245cd537bdb204c79393761
24 +DIST chromium-48.0.2564.41.tar.xz 1470877528 SHA256 b265ecb945fcf27dd9d856e18632ea6fa4f88aed7ed32cb5eefb6515b6dc651a SHA512 5d91c603a99ac092c9cc1d1300c826d0eab62092a961dde8dd2c6bcbb342120ff97aa76231407227563fb65c0791c69274d044ab81e261b66cfce76811b428d5 WHIRLPOOL 584638131774053511974722973f28b75f99ceb8241948af91e3de247ccee631c8dbbedac9bfd66b4f5f505bcef194970c361f60a0c9cae7179ad6af0ea55c35
25
26 diff --git a/www-client/chromium/chromium-48.0.2564.41.ebuild b/www-client/chromium/chromium-48.0.2564.41.ebuild
27 new file mode 100644
28 index 0000000..49ea972
29 --- /dev/null
30 +++ b/www-client/chromium/chromium-48.0.2564.41.ebuild
31 @@ -0,0 +1,691 @@
32 +# Copyright 1999-2015 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:=[opus,vorbis,vpx] )
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 + dev-libs/re2:=
114 + media-libs/flac:=
115 + media-libs/harfbuzz:=[icu(+)]
116 + >=media-libs/libjpeg-turbo-1.2.0-r1:=
117 + media-libs/libpng:0=
118 + >=media-libs/libwebp-0.4.0:=
119 + sys-libs/zlib:=[minizip]
120 + )"
121 +DEPEND="${RDEPEND}
122 + !arm? (
123 + dev-lang/yasm
124 + )
125 + dev-lang/perl
126 + dev-perl/JSON
127 + >=dev-util/gperf-3.0.3
128 + dev-util/ninja
129 + sys-apps/hwids[usb(+)]
130 + >=sys-devel/bison-2.4.3
131 + sys-devel/flex
132 + virtual/pkgconfig"
133 +
134 +# For nvidia-drivers blocker, see bug #413637 .
135 +RDEPEND+="
136 + !=www-client/chromium-9999
137 + !<www-plugins/chrome-binary-plugins-37
138 + x11-misc/xdg-utils
139 + virtual/opengl
140 + virtual/ttf-fonts
141 + selinux? ( sec-policy/selinux-chromium )
142 + tcmalloc? ( !<x11-drivers/nvidia-drivers-331.20 )
143 + widevine? ( www-plugins/chrome-binary-plugins[widevine(-)] )"
144 +
145 +# Python dependencies. The DEPEND part needs to be kept in sync
146 +# with python_check_deps.
147 +DEPEND+=" $(python_gen_any_dep '
148 + dev-python/beautifulsoup:python-2[${PYTHON_USEDEP}]
149 + dev-python/beautifulsoup:4[${PYTHON_USEDEP}]
150 + dev-python/html5lib[${PYTHON_USEDEP}]
151 + dev-python/jinja[${PYTHON_USEDEP}]
152 + dev-python/ply[${PYTHON_USEDEP}]
153 + dev-python/simplejson[${PYTHON_USEDEP}]
154 +')"
155 +python_check_deps() {
156 + has_version "dev-python/beautifulsoup:python-2[${PYTHON_USEDEP}]" && \
157 + has_version "dev-python/beautifulsoup:4[${PYTHON_USEDEP}]" && \
158 + has_version "dev-python/html5lib[${PYTHON_USEDEP}]" && \
159 + has_version "dev-python/jinja[${PYTHON_USEDEP}]" && \
160 + has_version "dev-python/ply[${PYTHON_USEDEP}]" && \
161 + has_version "dev-python/simplejson[${PYTHON_USEDEP}]"
162 +}
163 +
164 +if ! has chromium_pkg_die ${EBUILD_DEATH_HOOKS}; then
165 + EBUILD_DEATH_HOOKS+=" chromium_pkg_die";
166 +fi
167 +
168 +DISABLE_AUTOFORMATTING="yes"
169 +DOC_CONTENTS="
170 +Some web pages may require additional fonts to display properly.
171 +Try installing some of the following packages if some characters
172 +are not displayed properly:
173 +- media-fonts/arphicfonts
174 +- media-fonts/bitstream-cyberbit
175 +- media-fonts/droid
176 +- media-fonts/ipamonafont
177 +- media-fonts/ja-ipafonts
178 +- media-fonts/takao-fonts
179 +- media-fonts/wqy-microhei
180 +- media-fonts/wqy-zenhei
181 +
182 +Depending on your desktop environment, you may need
183 +to install additional packages to get icons on the Downloads page.
184 +
185 +For KDE, the required package is kde-frameworks/oxygen-icons.
186 +
187 +For other desktop environments, try one of the following:
188 +- x11-themes/gnome-icon-theme
189 +- x11-themes/tango-icon-theme
190 +"
191 +
192 +pkg_pretend() {
193 + if [[ $(tc-getCC)$ == *gcc* ]] && \
194 + [[ $(gcc-major-version)$(gcc-minor-version) -lt 48 ]]; then
195 + die 'At least gcc 4.8 is required, see bugs: #535730, #525374, #518668.'
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 + fi
205 + eshopts_pop
206 + check-reqs_pkg_pretend
207 +}
208 +
209 +pkg_setup() {
210 + if [[ "${SLOT}" == "0" ]]; then
211 + CHROMIUM_SUFFIX=""
212 + else
213 + CHROMIUM_SUFFIX="-${SLOT}"
214 + fi
215 + CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser${CHROMIUM_SUFFIX}"
216 +
217 + # Make sure the build system will use the right python, bug #344367.
218 + python-any-r1_pkg_setup
219 +
220 + chromium_suid_sandbox_check_kernel_config
221 +}
222 +
223 +src_prepare() {
224 + epatch "${FILESDIR}/${PN}-system-ffmpeg-r1.patch"
225 + epatch "${FILESDIR}/${PN}-system-jinja-r7.patch"
226 + epatch "${FILESDIR}/${PN}-widevine-r1.patch"
227 + epatch "${FILESDIR}/${PN}-last-commit-position-r0.patch"
228 + epatch "${FILESDIR}/${PN}-snapshot-toolchain-r0.patch"
229 + epatch "${FILESDIR}/${PN}-rpath-r0.patch"
230 + epatch "${FILESDIR}/${PN}-system-icu-r0.patch"
231 +
232 + epatch_user
233 +
234 + local conditional_bundled_libraries=""
235 + if ! use system-ffmpeg; then
236 + conditional_bundled_libraries+=" third_party/ffmpeg"
237 + fi
238 + if use gn; then
239 + conditional_bundled_libraries+="
240 + third_party/adobe
241 + third_party/ffmpeg
242 + third_party/flac
243 + third_party/harfbuzz-ng
244 + third_party/icu
245 + third_party/jinja2
246 + third_party/libevent
247 + third_party/libjpeg_turbo
248 + third_party/libpng
249 + third_party/libwebp
250 + third_party/libxml
251 + third_party/libxslt
252 + third_party/markupsafe
253 + third_party/re2
254 + third_party/snappy
255 + third_party/speech-dispatcher
256 + third_party/usb_ids
257 + third_party/xdg-utils
258 + third_party/yasm
259 + third_party/zlib
260 + "
261 + fi
262 +
263 + # Remove most bundled libraries. Some are still needed.
264 + build/linux/unbundle/remove_bundled_libraries.py \
265 + ${conditional_bundled_libraries} \
266 + 'base/third_party/dmg_fp' \
267 + 'base/third_party/dynamic_annotations' \
268 + 'base/third_party/icu' \
269 + 'base/third_party/nspr' \
270 + 'base/third_party/superfasthash' \
271 + 'base/third_party/symbolize' \
272 + 'base/third_party/valgrind' \
273 + 'base/third_party/xdg_mime' \
274 + 'base/third_party/xdg_user_dirs' \
275 + 'breakpad/src/third_party/curl' \
276 + 'chrome/third_party/mozilla_security_manager' \
277 + 'courgette/third_party' \
278 + 'crypto/third_party/nss' \
279 + 'net/third_party/mozilla_security_manager' \
280 + 'net/third_party/nss' \
281 + 'third_party/WebKit' \
282 + 'third_party/analytics' \
283 + 'third_party/angle' \
284 + 'third_party/angle/src/third_party/compiler' \
285 + 'third_party/boringssl' \
286 + 'third_party/brotli' \
287 + 'third_party/cacheinvalidation' \
288 + 'third_party/catapult' \
289 + 'third_party/catapult/third_party/py_vulcanize' \
290 + 'third_party/catapult/third_party/py_vulcanize/third_party/rcssmin' \
291 + 'third_party/catapult/third_party/py_vulcanize/third_party/rjsmin' \
292 + 'third_party/catapult/tracing/third_party/components/polymer' \
293 + 'third_party/catapult/tracing/third_party/d3' \
294 + 'third_party/catapult/tracing/third_party/gl-matrix' \
295 + 'third_party/catapult/tracing/third_party/jszip' \
296 + 'third_party/cld_2' \
297 + 'third_party/cros_system_api' \
298 + 'third_party/cython/python_flags.py' \
299 + 'third_party/devscripts' \
300 + 'third_party/dom_distiller_js' \
301 + 'third_party/dom_distiller_js/dist/proto_gen/third_party/dom_distiller_js' \
302 + 'third_party/fips181' \
303 + 'third_party/flot' \
304 + 'third_party/google_input_tools' \
305 + 'third_party/google_input_tools/third_party/closure_library' \
306 + 'third_party/google_input_tools/third_party/closure_library/third_party/closure' \
307 + 'third_party/hunspell' \
308 + 'third_party/iccjpeg' \
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/mojo' \
330 + 'third_party/mt19937ar' \
331 + 'third_party/npapi' \
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/sfntly' \
348 + 'third_party/skia' \
349 + 'third_party/smhasher' \
350 + 'third_party/sqlite' \
351 + 'third_party/tcmalloc' \
352 + 'third_party/usrsctp' \
353 + 'third_party/web-animations-js' \
354 + 'third_party/webdriver' \
355 + 'third_party/webrtc' \
356 + 'third_party/widevine' \
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_ssl (http://crbug.com/58087).
392 + # TODO: use_system_sqlite (http://crbug.com/22208).
393 + myconf_gyp+="
394 + -Duse_system_bzip2=1
395 + -Duse_system_ffmpeg=$(usex system-ffmpeg 1 0)
396 + -Duse_system_flac=1
397 + -Duse_system_harfbuzz=1
398 + -Duse_system_icu=1
399 + -Duse_system_jsoncpp=1
400 + -Duse_system_libevent=1
401 + -Duse_system_libjpeg=1
402 + -Duse_system_libpng=1
403 + -Duse_system_libwebp=1
404 + -Duse_system_libxml=1
405 + -Duse_system_libxslt=1
406 + -Duse_system_minizip=1
407 + -Duse_system_nspr=1
408 + -Duse_system_re2=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 +
474 + ffmpeg_branding="$(usex proprietary-codecs Chrome Chromium)"
475 + myconf_gyp+=" -Dproprietary_codecs=1 -Dffmpeg_branding=${ffmpeg_branding}"
476 +
477 + # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys .
478 + # Note: these are for Gentoo use ONLY. For your own distribution,
479 + # please get your own set of keys. Feel free to contact chromium@g.o
480 + # for more info.
481 + myconf_gyp+=" -Dgoogle_api_key=AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc
482 + -Dgoogle_default_client_id=329227923882.apps.googleusercontent.com
483 + -Dgoogle_default_client_secret=vgKG0NNv7GoDpbtoFNLxCUXu"
484 +
485 + local myarch="$(tc-arch)"
486 + if [[ $myarch = amd64 ]] ; then
487 + target_arch=x64
488 + ffmpeg_target_arch=x64
489 + elif [[ $myarch = x86 ]] ; then
490 + target_arch=ia32
491 + ffmpeg_target_arch=ia32
492 + elif [[ $myarch = arm ]] ; then
493 + target_arch=arm
494 + ffmpeg_target_arch=$(usex neon arm-neon arm)
495 + # TODO: re-enable NaCl (NativeClient).
496 + local CTARGET=${CTARGET:-${CHOST}}
497 + if [[ $(tc-is-softfloat) == "no" ]]; then
498 +
499 + myconf_gyp+=" -Darm_float_abi=hard"
500 + fi
501 + filter-flags "-mfpu=*"
502 + use neon || myconf_gyp+=" -Darm_fpu=${ARM_FPU:-vfpv3-d16}"
503 +
504 + if [[ ${CTARGET} == armv[78]* ]]; then
505 + myconf_gyp+=" -Darmv7=1"
506 + else
507 + myconf_gyp+=" -Darmv7=0"
508 + fi
509 + myconf_gyp+=" -Dsysroot=
510 + $(gyp_use neon arm_neon)
511 + -Ddisable_nacl=1"
512 + else
513 + die "Failed to determine target arch, got '$myarch'."
514 + fi
515 +
516 + myconf_gyp+=" -Dtarget_arch=${target_arch}"
517 +
518 + # Make sure that -Werror doesn't get added to CFLAGS by the build system.
519 + # Depending on GCC version the warnings are different and we don't want
520 + # the build to fail because of that.
521 + myconf_gyp+=" -Dwerror="
522 + myconf_gn+=" treat_warnings_as_errors=false"
523 +
524 + # Disable fatal linker warnings, bug 506268.
525 + myconf_gyp+=" -Ddisable_fatal_linker_warnings=1"
526 +
527 + # Avoid CFLAGS problems, bug #352457, bug #390147.
528 + if ! use custom-cflags; then
529 + replace-flags "-Os" "-O2"
530 + strip-flags
531 +
532 + # Prevent linker from running out of address space, bug #471810 .
533 + if use x86; then
534 + filter-flags "-g*"
535 + fi
536 +
537 + # Prevent libvpx build failures. Bug 530248, 544702, 546984.
538 + if [[ ${myarch} == amd64 || ${myarch} == x86 ]]; then
539 + filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 -mno-avx -mno-avx2
540 + fi
541 + fi
542 +
543 + # Make sure the build system will use the right tools, bug #340795.
544 + tc-export AR CC CXX NM
545 +
546 + # Tools for building programs to be executed on the build system, bug #410883.
547 + if tc-is-cross-compiler; then
548 + export AR_host=$(tc-getBUILD_AR)
549 + export CC_host=$(tc-getBUILD_CC)
550 + export CXX_host=$(tc-getBUILD_CXX)
551 + export NM_host=$(tc-getBUILD_NM)
552 + fi
553 +
554 + # Bug 491582.
555 + export TMPDIR="${WORKDIR}/temp"
556 + mkdir -p -m 755 "${TMPDIR}" || die
557 +
558 + # TODO: also do this for GN bundled ffmpeg build.
559 + if ! use system-ffmpeg && ! use gn; then
560 + local build_ffmpeg_args=""
561 + if use pic && [[ "${ffmpeg_target_arch}" == "ia32" ]]; then
562 + build_ffmpeg_args+=" --disable-asm"
563 + fi
564 +
565 + # Re-configure bundled ffmpeg. See bug #491378 for example reasons.
566 + einfo "Configuring bundled ffmpeg..."
567 + pushd third_party/ffmpeg > /dev/null || die
568 + chromium/scripts/build_ffmpeg.py linux ${ffmpeg_target_arch} \
569 + --branding ${ffmpeg_branding} -- ${build_ffmpeg_args} || die
570 + chromium/scripts/copy_config.sh || die
571 + chromium/scripts/generate_gyp.py || die
572 + popd > /dev/null || die
573 + fi
574 +
575 + third_party/libaddressinput/chromium/tools/update-strings.py || die
576 +
577 + touch chrome/test/data/webui/i18n_process_css_test.html || die
578 +
579 + einfo "Configuring Chromium..."
580 + if use gn; then
581 + tools/gn/bootstrap/bootstrap.py -v --gn-gen-args "${myconf_gn}" || die
582 + out/Release/gn gen --args="${myconf_gn}" out/Release || die
583 + else
584 + build/linux/unbundle/replace_gyp_files.py ${myconf_gyp} || die
585 + egyp_chromium ${myconf_gyp} || die
586 + fi
587 +}
588 +
589 +eninja() {
590 + if [[ -z ${NINJAOPTS+set} ]]; then
591 + local jobs=$(makeopts_jobs)
592 + local loadavg=$(makeopts_loadavg)
593 +
594 + if [[ ${MAKEOPTS} == *-j* && ${jobs} != 999 ]]; then
595 + NINJAOPTS+=" -j ${jobs}"
596 + fi
597 + if [[ ${MAKEOPTS} == *-l* && ${loadavg} != 999 ]]; then
598 + NINJAOPTS+=" -l ${loadavg}"
599 + fi
600 + fi
601 + set -- ninja -v ${NINJAOPTS} "$@"
602 + echo "$@"
603 + "$@"
604 +}
605 +
606 +src_compile() {
607 + local ninja_targets="chrome chrome_sandbox chromedriver"
608 +
609 + if ! use gn; then
610 + # Build mksnapshot and pax-mark it.
611 + eninja -C out/Release mksnapshot || die
612 + pax-mark m out/Release/mksnapshot
613 + fi
614 +
615 + # Even though ninja autodetects number of CPUs, we respect
616 + # user's options, for debugging with -j 1 or any other reason.
617 + eninja -C out/Release ${ninja_targets} || die
618 +
619 + pax-mark m out/Release/chrome
620 +}
621 +
622 +src_install() {
623 + exeinto "${CHROMIUM_HOME}"
624 + doexe out/Release/chrome || die
625 +
626 + newexe out/Release/chrome_sandbox chrome-sandbox || die
627 + fperms 4755 "${CHROMIUM_HOME}/chrome-sandbox"
628 +
629 + doexe out/Release/chromedriver || die
630 + use widevine && doexe out/Release/libwidevinecdmadapter.so
631 +
632 + # if ! use arm; then
633 + # doexe out/Release/nacl_helper{,_bootstrap} || die
634 + # insinto "${CHROMIUM_HOME}"
635 + # doins out/Release/nacl_irt_*.nexe || die
636 + # doins out/Release/libppGoogleNaClPluginChrome.so || die
637 + # fi
638 +
639 + local sedargs=( -e "s:/usr/lib/:/usr/$(get_libdir)/:g" )
640 + if [[ -n ${CHROMIUM_SUFFIX} ]]; then
641 + sedargs+=(
642 + -e "s:chromium-browser:chromium-browser${CHROMIUM_SUFFIX}:g"
643 + -e "s:chromium.desktop:chromium${CHROMIUM_SUFFIX}.desktop:g"
644 + -e "s:plugins:plugins --user-data-dir=\${HOME}/.config/chromium${CHROMIUM_SUFFIX}:"
645 + )
646 + fi
647 + sed "${sedargs[@]}" "${FILESDIR}/chromium-launcher-r3.sh" > chromium-launcher.sh || die
648 + doexe chromium-launcher.sh
649 +
650 + # It is important that we name the target "chromium-browser",
651 + # xdg-utils expect it; bug #355517.
652 + dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser${CHROMIUM_SUFFIX} || die
653 + # keep the old symlink around for consistency
654 + dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium${CHROMIUM_SUFFIX} || die
655 +
656 + dosym "${CHROMIUM_HOME}/chromedriver" /usr/bin/chromedriver${CHROMIUM_SUFFIX} || die
657 +
658 + # Allow users to override command-line options, bug #357629.
659 + dodir /etc/chromium || die
660 + insinto /etc/chromium
661 + newins "${FILESDIR}/chromium.default" "default" || die
662 +
663 + pushd out/Release/locales > /dev/null || die
664 + chromium_remove_language_paks
665 + popd
666 +
667 + insinto "${CHROMIUM_HOME}"
668 + doins out/Release/*.bin || die
669 + doins out/Release/*.pak || die
670 +
671 + if use gn; then
672 + doins out/Release/icudtl.dat || die
673 + fi
674 +
675 + doins -r out/Release/locales || die
676 + doins -r out/Release/resources || die
677 +
678 + newman out/Release/chrome.1 chromium${CHROMIUM_SUFFIX}.1 || die
679 + newman out/Release/chrome.1 chromium-browser${CHROMIUM_SUFFIX}.1 || die
680 +
681 + # Install icons and desktop entry.
682 + local branding size
683 + for size in 16 22 24 32 48 64 128 256 ; do
684 + case ${size} in
685 + 16|32) branding="chrome/app/theme/default_100_percent/chromium" ;;
686 + *) branding="chrome/app/theme/chromium" ;;
687 + esac
688 + newicon -s ${size} "${branding}/product_logo_${size}.png" \
689 + chromium-browser${CHROMIUM_SUFFIX}.png
690 + done
691 +
692 + local mime_types="text/html;text/xml;application/xhtml+xml;"
693 + mime_types+="x-scheme-handler/http;x-scheme-handler/https;" # bug #360797
694 + mime_types+="x-scheme-handler/ftp;" # bug #412185
695 + mime_types+="x-scheme-handler/mailto;x-scheme-handler/webcal;" # bug #416393
696 + make_desktop_entry \
697 + chromium-browser${CHROMIUM_SUFFIX} \
698 + "Chromium${CHROMIUM_SUFFIX}" \
699 + chromium-browser${CHROMIUM_SUFFIX} \
700 + "Network;WebBrowser" \
701 + "MimeType=${mime_types}\nStartupWMClass=chromium-browser"
702 + sed -e "/^Exec/s/$/ %U/" -i "${ED}"/usr/share/applications/*.desktop || die
703 +
704 + # Install GNOME default application entry (bug #303100).
705 + if use gnome; then
706 + dodir /usr/share/gnome-control-center/default-apps || die
707 + insinto /usr/share/gnome-control-center/default-apps
708 + newins "${FILESDIR}"/chromium-browser.xml chromium-browser${CHROMIUM_SUFFIX}.xml || die
709 + if [[ "${CHROMIUM_SUFFIX}" != "" ]]; then
710 + sed "s:chromium-browser:chromium-browser${CHROMIUM_SUFFIX}:g" -i \
711 + "${ED}"/usr/share/gnome-control-center/default-apps/chromium-browser${CHROMIUM_SUFFIX}.xml
712 + fi
713 + fi
714 +
715 + readme.gentoo_create_doc
716 +}
717 +
718 +pkg_postinst() {
719 + fdo-mime_desktop_database_update
720 + gnome2_icon_cache_update
721 + readme.gentoo_print_elog
722 +}