Gentoo Archives: gentoo-commits

From: "Paweł Hajdan" <phajdan.jr@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-client/chromium/
Date: Wed, 16 Dec 2015 07:29:37
Message-Id: 1450250964.956f8708fb56270ef0cc062be1f5b42752d382e3.phajdan.jr@gentoo
1 commit: 956f8708fb56270ef0cc062be1f5b42752d382e3
2 Author: Pawel Hajdan, Jr <phajdan.jr <AT> gentoo <DOT> org>
3 AuthorDate: Wed Dec 16 07:28:46 2015 +0000
4 Commit: Paweł Hajdan <phajdan.jr <AT> gentoo <DOT> org>
5 CommitDate: Wed Dec 16 07:29:24 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=956f8708
7
8 www-client/chromium: dev channel bump (49.0.2587.3)
9
10 Package-Manager: portage-2.2.20.1
11
12 www-client/chromium/Manifest | 1 +
13 www-client/chromium/chromium-49.0.2587.3.ebuild | 693 ++++++++++++++++++++++++
14 2 files changed, 694 insertions(+)
15
16 diff --git a/www-client/chromium/Manifest b/www-client/chromium/Manifest
17 index c72d389..4269623 100644
18 --- a/www-client/chromium/Manifest
19 +++ b/www-client/chromium/Manifest
20 @@ -2,3 +2,4 @@ DIST chromium-47.0.2526.80-lite.tar.xz 376352828 SHA256 680165441f909f5bac6cbbef
21 DIST chromium-48.0.2564.10.tar.xz 432060420 SHA256 1902d75d49d46c32a8c33f6de53c9253a63a364b85eb4ada1e8a9ba7c0f523d0 SHA512 7753dc19a50c862211c10975b3ad64a0408e3645df7b0ea548f8437c4c5380ad0bb350920eb8c6791e0685ae7ec921c6be720e337a17dffe4b73c56b74a2bc9a WHIRLPOOL a9ccb2872ad639886288581e1c7d9244f16965ef924395531701289cc69c5a9dfdc4a25175151d27b150acc8e4398c8d91ca5f8f3e623c3c85c8b99d913c4f00
22 DIST chromium-48.0.2564.23.tar.xz 1099898120 SHA256 e9a5eeaedb1975a93d37bc865d3122cf28b7e3a246c06ba19204edaefbce1266 SHA512 72b253f39b561e53c0ef2220402ae15e8d2cdd1af8eab4d5fa8480316919df9059dddf4f4c0d027f78fd0db924b7cbd23d29d406808d18fa047ccddffb6701b3 WHIRLPOOL c133e8e389b560efcc239e2f24bb3befd3fe8731bb2529aeee3f2ae04bf09e5d815ef805750c48dd549fb0b94c1ab77d94b03a0b8245cd537bdb204c79393761
23 DIST chromium-48.0.2564.41.tar.xz 1470877528 SHA256 b265ecb945fcf27dd9d856e18632ea6fa4f88aed7ed32cb5eefb6515b6dc651a SHA512 5d91c603a99ac092c9cc1d1300c826d0eab62092a961dde8dd2c6bcbb342120ff97aa76231407227563fb65c0791c69274d044ab81e261b66cfce76811b428d5 WHIRLPOOL 584638131774053511974722973f28b75f99ceb8241948af91e3de247ccee631c8dbbedac9bfd66b4f5f505bcef194970c361f60a0c9cae7179ad6af0ea55c35
24 +DIST chromium-49.0.2587.3.tar.xz 1487544844 SHA256 425292b10e645f5b6812bb901e0905300969405d197d7936c9818f81be69b016 SHA512 5fb793385665256c9dddce1766cbce2335baf2744591f532baf720a7097a21451ff0d22c1734100874e984debd05a5e061a46b0d0571ac3804a9ad4a763cdb5c WHIRLPOOL a2f33b75239fa6748d82082ad86bb7e16971d3b01c36cb3f5f5a3e5087c2ef93bc7c1b4665215401ef05f5403adabf33dde3c5d3921626211c01b7e0607ae920
25
26 diff --git a/www-client/chromium/chromium-49.0.2587.3.ebuild b/www-client/chromium/chromium-49.0.2587.3.ebuild
27 new file mode 100644
28 index 0000000..ca78f85
29 --- /dev/null
30 +++ b/www-client/chromium/chromium-49.0.2587.3.ebuild
31 @@ -0,0 +1,693 @@
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="10G"
201 + eshopts_push -s extglob
202 + if is-flagq '-g?(gdb)?([1-9])'; then
203 + CHECKREQS_DISK_BUILD="30G"
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 +
231 + epatch_user
232 +
233 + local conditional_bundled_libraries=""
234 + if ! use system-ffmpeg; then
235 + conditional_bundled_libraries+=" third_party/ffmpeg"
236 + fi
237 + if use gn; then
238 + conditional_bundled_libraries+="
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/libevent
246 + third_party/libjpeg_turbo
247 + third_party/libpng
248 + third_party/libwebp
249 + third_party/libxml
250 + third_party/libxslt
251 + third_party/markupsafe
252 + third_party/re2
253 + third_party/snappy
254 + third_party/speech-dispatcher
255 + third_party/usb_ids
256 + third_party/xdg-utils
257 + third_party/yasm
258 + third_party/zlib
259 + "
260 + fi
261 +
262 + # Remove most bundled libraries. Some are still needed.
263 + build/linux/unbundle/remove_bundled_libraries.py \
264 + ${conditional_bundled_libraries} \
265 + 'base/third_party/dmg_fp' \
266 + 'base/third_party/dynamic_annotations' \
267 + 'base/third_party/icu' \
268 + 'base/third_party/nspr' \
269 + 'base/third_party/superfasthash' \
270 + 'base/third_party/symbolize' \
271 + 'base/third_party/valgrind' \
272 + 'base/third_party/xdg_mime' \
273 + 'base/third_party/xdg_user_dirs' \
274 + 'breakpad/src/third_party/curl' \
275 + 'chrome/third_party/mozilla_security_manager' \
276 + 'courgette/third_party' \
277 + 'crypto/third_party/nss' \
278 + 'net/third_party/mozilla_security_manager' \
279 + 'net/third_party/nss' \
280 + 'third_party/WebKit' \
281 + 'third_party/analytics' \
282 + 'third_party/angle' \
283 + 'third_party/angle/src/third_party/compiler' \
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/jstemplate' \
309 + 'third_party/khronos' \
310 + 'third_party/leveldatabase' \
311 + 'third_party/libXNVCtrl' \
312 + 'third_party/libaddressinput' \
313 + 'third_party/libjingle' \
314 + 'third_party/libphonenumber' \
315 + 'third_party/libsecret' \
316 + 'third_party/libsrtp' \
317 + 'third_party/libudev' \
318 + 'third_party/libusb' \
319 + 'third_party/libvpx_new' \
320 + 'third_party/libvpx_new/source/libvpx/third_party/x86inc' \
321 + 'third_party/libxml/chromium' \
322 + 'third_party/libwebm' \
323 + 'third_party/libyuv' \
324 + 'third_party/lss' \
325 + 'third_party/lzma_sdk' \
326 + 'third_party/mesa' \
327 + 'third_party/modp_b64' \
328 + 'third_party/mojo' \
329 + 'third_party/mt19937ar' \
330 + 'third_party/npapi' \
331 + 'third_party/openmax_dl' \
332 + 'third_party/opus' \
333 + 'third_party/ots' \
334 + 'third_party/pdfium' \
335 + 'third_party/pdfium/third_party/agg23' \
336 + 'third_party/pdfium/third_party/base' \
337 + 'third_party/pdfium/third_party/bigint' \
338 + 'third_party/pdfium/third_party/freetype' \
339 + 'third_party/pdfium/third_party/lcms2-2.6' \
340 + 'third_party/pdfium/third_party/libjpeg' \
341 + 'third_party/pdfium/third_party/libopenjpeg20' \
342 + 'third_party/pdfium/third_party/zlib_v128' \
343 + 'third_party/polymer' \
344 + 'third_party/protobuf' \
345 + 'third_party/qcms' \
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_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 + -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 +}