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