Gentoo Archives: gentoo-commits

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