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