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: Fri, 30 Sep 2016 03:50:17
Message-Id: 1475207410.acfb20cd737ada78d20b1c7c97cdc474789d2674.floppym@gentoo
1 commit: acfb20cd737ada78d20b1c7c97cdc474789d2674
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Fri Sep 30 03:49:47 2016 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Fri Sep 30 03:50:10 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=acfb20cd
7
8 www-client/chromium: stable channel bump (53.0.2785.143)
9
10 Package-Manager: portage-2.3.1_p4_p507647
11
12 www-client/chromium/Manifest | 1 +
13 www-client/chromium/chromium-53.0.2785.143.ebuild | 722 ++++++++++++++++++++++
14 2 files changed, 723 insertions(+)
15
16 diff --git a/www-client/chromium/Manifest b/www-client/chromium/Manifest
17 index 295f59c..483001f 100644
18 --- a/www-client/chromium/Manifest
19 +++ b/www-client/chromium/Manifest
20 @@ -1,4 +1,5 @@
21 DIST chromium-53.0.2785.116.tar.xz 460903264 SHA256 7a87629504346f64122ca7754574d187a4c1bf5736dea672ff3e247a0af16062 SHA512 3a88b5b61642c4b947ae9cd9faa6d9d75fecfd6058982e705d36f1da2e94b902fb6d0af5289e00bbd0e5e7d096d5f5a788132c6e4374978620d6f7a1e2fb00da WHIRLPOOL fa067c68b217d494e16dfc78d63482a31006234ebae1c686426f011afde41a58d6939e3c5ee3a340ee099d5d88016f425b97e9f68957bb60d9b846d471702ac3
22 +DIST chromium-53.0.2785.143.tar.xz 460878628 SHA256 c52a58b79bfb27bb87e4a0a6ff213001485fbc747657b290f75d39ddce07dcc3 SHA512 d51ee1bd60d9ac0ae2dfa66b7ba10cae479002f32995d169c181e7ef1170953069531ec786e8031d3fc4777f002b213471213b4ed3e6f1e89f851547305456b9 WHIRLPOOL a9e75f905d7529aa0ed2ff3af9a7273c1b53dcb4c8a393d0fb34361b4cfa46e6e3691abf6fedc36dd6c375ab43038f76c981678d1988054d3fdb04b33b79d4a8
23 DIST chromium-54.0.2840.27.tar.xz 479647448 SHA256 75e195afbb9f0c3e69b637ef4fa34ba7e5b3e62e871ba1b60638d9e9c5eee088 SHA512 3ba86ec5418aa0d338e8cfd935e8e6664679721ee208dd560d00ff011610094bed03ed0d76e1bc478d6bb92db5074e71f3e4bbeb1a41bb0ae21927b4dd74865c WHIRLPOOL 383de90421b1d23eee7bc7030e9e9bfeeeccf2639681b5219a3b3d865ef1568a65d8fae41a0864ddbe7c7980cd90df11a5d2bb8e93f705f906ec8a742b158fa6
24 DIST chromium-54.0.2840.34.tar.xz 479636320 SHA256 b46c26a9e773b2c620acd2f96d69408f14a279aefaedfefed002ecf898a1ecf2 SHA512 23732e02ed30eaf36a4a4ee7bbb1af72c4202e061444004b515f0c49a578907719de3588f6d1e8dbb756cffa0220b677c920dc2f5ad6e8ec70a82168c094c99d WHIRLPOOL 822b41231a41aaeb8fc45ddc927c731535640a844ad25256a3f3daa86916c7cd9a5b79b30324c22efff03ef16a033b77d93df24f1ebf64df9373f77a8669fb41
25 DIST chromium-55.0.2868.3.tar.xz 505338268 SHA256 bec801332cdfb784d06a08da3936f5b9719e5b6a3bbaee88c3829651799077d1 SHA512 918c53f7380f889450b0e97e085f8d28af0ef4c25a5dd7b1ae0b2467ccc564747915c64d3bc6f64d31798ea4ef76f7a5cd7f64c06830ed9775756a495d9bb319 WHIRLPOOL df1fc03ebbc0ce4697e5aae6199c970d55b3cfdf78a00e18e47206dfc4f1995b3bae34216ea1d1023f7619febc87e9bfe738d015cee24123be386d6d41bec572
26
27 diff --git a/www-client/chromium/chromium-53.0.2785.143.ebuild b/www-client/chromium/chromium-53.0.2785.143.ebuild
28 new file mode 100644
29 index 00000000..1fa5fbb
30 --- /dev/null
31 +++ b/www-client/chromium/chromium-53.0.2785.143.ebuild
32 @@ -0,0 +1,722 @@
33 +# Copyright 1999-2016 Gentoo Foundation
34 +# Distributed under the terms of the GNU General Public License v2
35 +# $Id$
36 +
37 +EAPI="5"
38 +PYTHON_COMPAT=( python2_7 )
39 +
40 +CHROMIUM_LANGS="am ar bg bn ca cs da de el en-GB es es-419 et fa fi fil fr gu he
41 + 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
42 + sv sw ta te th tr uk vi zh-CN zh-TW"
43 +
44 +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
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"
51 +SLOT="0"
52 +KEYWORDS="~amd64 ~arm ~arm64 ~x86"
53 +IUSE="cups gn gnome gnome-keyring gtk3 +hangouts kerberos neon pic +proprietary-codecs pulseaudio selinux +system-ffmpeg +tcmalloc widevine"
54 +RESTRICT="!system-ffmpeg? ( proprietary-codecs? ( bindist ) )"
55 +
56 +# TODO: bootstrapped gn binary hangs when using tcmalloc with portage's sandbox.
57 +REQUIRED_USE="gn? ( gnome gnome-keyring !tcmalloc )"
58 +
59 +# Native Client binaries are compiled with different set of flags, bug #452066.
60 +QA_FLAGS_IGNORED=".*\.nexe"
61 +
62 +# Native Client binaries may be stripped by the build system, which uses the
63 +# right tools for it, bug #469144 .
64 +QA_PRESTRIPPED=".*\.nexe"
65 +
66 +RDEPEND="
67 + app-arch/bzip2:=
68 + cups? ( >=net-print/cups-1.3.11:= )
69 + >=dev-libs/elfutils-0.149
70 + dev-libs/expat:=
71 + dev-libs/glib:=
72 + >=dev-libs/jsoncpp-0.5.0-r1:=
73 + dev-libs/nspr:=
74 + >=dev-libs/nss-3.14.3:=
75 + gnome? ( >=gnome-base/gconf-2.24.0:= )
76 + gnome-keyring? ( >=gnome-base/libgnome-keyring-3.12:= )
77 + >=media-libs/alsa-lib-1.0.19:=
78 + media-libs/fontconfig:=
79 + media-libs/freetype:=
80 + media-libs/libexif:=
81 + media-libs/speex:=
82 + pulseaudio? ( media-sound/pulseaudio:= )
83 + system-ffmpeg? ( >=media-video/ffmpeg-2.7.2:= )
84 + sys-apps/dbus:=
85 + sys-apps/pciutils:=
86 + >=sys-libs/libcap-2.22:=
87 + virtual/udev
88 + x11-libs/cairo:=
89 + x11-libs/gdk-pixbuf:=
90 + gtk3? ( x11-libs/gtk+:3= )
91 + !gtk3? ( x11-libs/gtk+:2= )
92 + x11-libs/libdrm
93 + x11-libs/libX11:=
94 + x11-libs/libXcomposite:=
95 + x11-libs/libXcursor:=
96 + x11-libs/libXdamage:=
97 + x11-libs/libXext:=
98 + x11-libs/libXfixes:=
99 + >=x11-libs/libXi-1.6.0:=
100 + x11-libs/libXinerama:=
101 + x11-libs/libXrandr:=
102 + x11-libs/libXrender:=
103 + x11-libs/libXScrnSaver:=
104 + x11-libs/libXtst:=
105 + x11-libs/pango:=
106 + kerberos? ( virtual/krb5 )
107 + !gn? (
108 + >=app-accessibility/speech-dispatcher-0.8:=
109 + app-arch/snappy:=
110 + >=dev-libs/libevent-1.4.13:=
111 + dev-libs/libxml2:=[icu]
112 + dev-libs/libxslt:=
113 + media-libs/flac:=
114 + >=media-libs/harfbuzz-0.9.41:=[icu(+)]
115 + >=media-libs/libwebp-0.4.0:=
116 + sys-libs/zlib:=[minizip]
117 + )"
118 +DEPEND="${RDEPEND}
119 + >=app-arch/gzip-1.7
120 + !arm? (
121 + dev-lang/yasm
122 + )
123 + dev-lang/perl
124 + dev-perl/JSON
125 + >=dev-util/gperf-3.0.3
126 + dev-util/ninja
127 + sys-apps/hwids[usb(+)]
128 + >=sys-devel/bison-2.4.3
129 + sys-devel/flex
130 + virtual/pkgconfig"
131 +
132 +# For nvidia-drivers blocker, see bug #413637 .
133 +RDEPEND+="
134 + !=www-client/chromium-9999
135 + !<www-plugins/chrome-binary-plugins-37
136 + x11-misc/xdg-utils
137 + virtual/opengl
138 + virtual/ttf-fonts
139 + selinux? ( sec-policy/selinux-chromium )
140 + tcmalloc? ( !<x11-drivers/nvidia-drivers-331.20 )
141 + widevine? ( www-plugins/chrome-binary-plugins[widevine(-)] )"
142 +
143 +# Python dependencies. The DEPEND part needs to be kept in sync
144 +# with python_check_deps.
145 +DEPEND+=" $(python_gen_any_dep '
146 + dev-python/beautifulsoup:python-2[${PYTHON_USEDEP}]
147 + >=dev-python/beautifulsoup-4.3.2:4[${PYTHON_USEDEP}]
148 + dev-python/html5lib[${PYTHON_USEDEP}]
149 + dev-python/jinja[${PYTHON_USEDEP}]
150 + dev-python/ply[${PYTHON_USEDEP}]
151 + dev-python/simplejson[${PYTHON_USEDEP}]
152 +')"
153 +python_check_deps() {
154 + has_version --host-root "dev-python/beautifulsoup:python-2[${PYTHON_USEDEP}]" &&
155 + has_version --host-root ">=dev-python/beautifulsoup-4.3.2:4[${PYTHON_USEDEP}]" &&
156 + has_version --host-root "dev-python/html5lib[${PYTHON_USEDEP}]" &&
157 + has_version --host-root "dev-python/jinja[${PYTHON_USEDEP}]" &&
158 + has_version --host-root "dev-python/ply[${PYTHON_USEDEP}]" &&
159 + has_version --host-root "dev-python/simplejson[${PYTHON_USEDEP}]"
160 +}
161 +
162 +if ! has chromium_pkg_die ${EBUILD_DEATH_HOOKS}; then
163 + EBUILD_DEATH_HOOKS+=" chromium_pkg_die";
164 +fi
165 +
166 +DISABLE_AUTOFORMATTING="yes"
167 +DOC_CONTENTS="
168 +Some web pages may require additional fonts to display properly.
169 +Try installing some of the following packages if some characters
170 +are not displayed properly:
171 +- media-fonts/arphicfonts
172 +- media-fonts/bitstream-cyberbit
173 +- media-fonts/droid
174 +- media-fonts/ipamonafont
175 +- media-fonts/ja-ipafonts
176 +- media-fonts/takao-fonts
177 +- media-fonts/wqy-microhei
178 +- media-fonts/wqy-zenhei
179 +
180 +Depending on your desktop environment, you may need
181 +to install additional packages to get icons on the Downloads page.
182 +
183 +For KDE, the required package is kde-frameworks/oxygen-icons.
184 +
185 +For other desktop environments, try one of the following:
186 +- x11-themes/gnome-icon-theme
187 +- x11-themes/tango-icon-theme
188 +"
189 +
190 +pkg_pretend() {
191 + if [[ $(tc-getCC) == *gcc* ]] && \
192 + [[ $(gcc-major-version)$(gcc-minor-version) -lt 48 ]]; then
193 + die 'At least gcc 4.8 is required, see bugs: #535730, #525374, #518668.'
194 + fi
195 +
196 + # Check build requirements, bug #541816 and bug #471810 .
197 + CHECKREQS_MEMORY="3G"
198 + CHECKREQS_DISK_BUILD="5G"
199 + eshopts_push -s extglob
200 + if is-flagq '-g?(gdb)?([1-9])'; then
201 + CHECKREQS_DISK_BUILD="25G"
202 + fi
203 + eshopts_pop
204 + check-reqs_pkg_pretend
205 +}
206 +
207 +pkg_setup() {
208 + if [[ "${SLOT}" == "0" ]]; then
209 + CHROMIUM_SUFFIX=""
210 + else
211 + CHROMIUM_SUFFIX="-${SLOT}"
212 + fi
213 + CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser${CHROMIUM_SUFFIX}"
214 +
215 + # Make sure the build system will use the right python, bug #344367.
216 + python-any-r1_pkg_setup
217 +
218 + chromium_suid_sandbox_check_kernel_config
219 +}
220 +
221 +src_prepare() {
222 + epatch "${FILESDIR}/${PN}-system-ffmpeg-r2.patch"
223 + epatch "${FILESDIR}/${PN}-system-jinja-r11.patch"
224 + epatch "${FILESDIR}/${PN}-widevine-r1.patch"
225 + epatch "${FILESDIR}/${PN}-last-commit-position-r0.patch"
226 + epatch "${FILESDIR}/${PN}-system-zlib-r0.patch"
227 +
228 + epatch_user
229 +
230 + local conditional_bundled_libraries=""
231 + if ! use system-ffmpeg; then
232 + conditional_bundled_libraries+=" third_party/ffmpeg"
233 + fi
234 + if use gn; then
235 + conditional_bundled_libraries+="
236 + base/third_party/libevent
237 + third_party/adobe
238 + third_party/speech-dispatcher
239 + third_party/usb_ids
240 + third_party/xdg-utils
241 + third_party/yasm/run_yasm.py
242 + "
243 + fi
244 +
245 + # Remove most bundled libraries. Some are still needed.
246 + build/linux/unbundle/remove_bundled_libraries.py \
247 + ${conditional_bundled_libraries} \
248 + 'base/third_party/dmg_fp' \
249 + 'base/third_party/dynamic_annotations' \
250 + 'base/third_party/icu' \
251 + 'base/third_party/nspr' \
252 + 'base/third_party/superfasthash' \
253 + 'base/third_party/symbolize' \
254 + 'base/third_party/valgrind' \
255 + 'base/third_party/xdg_mime' \
256 + 'base/third_party/xdg_user_dirs' \
257 + 'breakpad/src/third_party/curl' \
258 + 'chrome/third_party/mozilla_security_manager' \
259 + 'courgette/third_party' \
260 + 'net/third_party/mozilla_security_manager' \
261 + 'net/third_party/nss' \
262 + 'third_party/WebKit' \
263 + 'third_party/analytics' \
264 + 'third_party/angle' \
265 + 'third_party/angle/src/common/third_party/numerics' \
266 + 'third_party/angle/src/third_party/compiler' \
267 + 'third_party/angle/src/third_party/libXNVCtrl' \
268 + 'third_party/angle/src/third_party/murmurhash' \
269 + 'third_party/angle/src/third_party/trace_event' \
270 + 'third_party/boringssl' \
271 + 'third_party/brotli' \
272 + 'third_party/cacheinvalidation' \
273 + 'third_party/catapult' \
274 + 'third_party/catapult/third_party/py_vulcanize' \
275 + 'third_party/catapult/third_party/py_vulcanize/third_party/rcssmin' \
276 + 'third_party/catapult/third_party/py_vulcanize/third_party/rjsmin' \
277 + 'third_party/catapult/tracing/third_party/components/polymer' \
278 + 'third_party/catapult/tracing/third_party/d3' \
279 + 'third_party/catapult/tracing/third_party/gl-matrix' \
280 + 'third_party/catapult/tracing/third_party/jszip' \
281 + 'third_party/catapult/tracing/third_party/mannwhitneyu' \
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 kerberos)
441 + $(gyp_use pulseaudio)
442 + $(gyp_use tcmalloc use_allocator tcmalloc none)
443 + $(gyp_use widevine enable_widevine)"
444 +
445 + # TODO: support USE=gnome-keyring for GN
446 + myconf_gn+=" enable_hangout_services_extension=$(usex hangouts true false)"
447 + myconf_gn+=" enable_widevine=$(usex widevine true false)"
448 + myconf_gn+=" use_allocator=$(usex tcmalloc \"tcmalloc\" \"none\")"
449 + myconf_gn+=" use_cups=$(usex cups true false)"
450 + myconf_gn+=" use_gconf=$(usex gnome true false)"
451 + myconf_gn+=" use_gtk3=$(usex gtk3 true false)"
452 + myconf_gn+=" use_kerberos=$(usex kerberos true false)"
453 + myconf_gn+=" use_pulseaudio=$(usex pulseaudio true false)"
454 +
455 + # Use explicit library dependencies instead of dlopen.
456 + # This makes breakages easier to detect by revdep-rebuild.
457 + myconf_gyp+="
458 + -Dlinux_link_gsettings=1
459 + -Dlinux_link_libpci=1
460 + -Dlinux_link_libspeechd=1
461 + -Dlibspeechd_h_prefix=speech-dispatcher/"
462 +
463 + # TODO: link_pulseaudio=true for GN.
464 +
465 + # TODO: use the file at run time instead of effectively compiling it in.
466 + myconf_gyp+="
467 + -Dusb_ids_path=/usr/share/misc/usb.ids"
468 +
469 + myconf_gyp+=" -Dfieldtrial_testing_like_official_build=1"
470 + myconf_gn+=" fieldtrial_testing_like_official_build=true"
471 +
472 + if [[ $(tc-getCC) == *clang* ]]; then
473 + myconf_gyp+=" -Dclang=1"
474 + myconf_gn+=" is_clang=true clang_base_path=\"/usr\" clang_use_chrome_plugins=false"
475 + else
476 + myconf_gyp+=" -Dclang=0"
477 + myconf_gn+=" is_clang=false"
478 + fi
479 +
480 + # Never use bundled gold binary. Disable gold linker flags for now.
481 + # Do not use bundled clang.
482 + myconf_gyp+="
483 + -Dclang_use_chrome_plugins=0
484 + -Dhost_clang=0
485 + -Dlinux_use_bundled_binutils=0
486 + -Dlinux_use_bundled_gold=0
487 + -Dlinux_use_gold_flags=0
488 + -Dsysroot="
489 + myconf_gn+=" use_sysroot=false"
490 +
491 + ffmpeg_branding="$(usex proprietary-codecs Chrome Chromium)"
492 + myconf_gyp+=" -Dproprietary_codecs=1 -Dffmpeg_branding=${ffmpeg_branding}"
493 + myconf_gn+=" proprietary_codecs=true ffmpeg_branding=\"${ffmpeg_branding}\""
494 +
495 + # Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys .
496 + # Note: these are for Gentoo use ONLY. For your own distribution,
497 + # please get your own set of keys. Feel free to contact chromium@g.o
498 + # for more info.
499 + local google_api_key="AIzaSyDEAOvatFo0eTgsV_ZlEzx0ObmepsMzfAc"
500 + local google_default_client_id="329227923882.apps.googleusercontent.com"
501 + local google_default_client_secret="vgKG0NNv7GoDpbtoFNLxCUXu"
502 + myconf_gyp+=" -Dgoogle_api_key=${google_api_key}
503 + -Dgoogle_default_client_id=${google_default_client_id}
504 + -Dgoogle_default_client_secret=${google_default_client_secret}"
505 + myconf_gn+=" google_api_key=\"${google_api_key}\""
506 + myconf_gn+=" google_default_client_id=\"${google_default_client_id}\""
507 + myconf_gn+=" google_default_client_secret=\"${google_default_client_secret}\""
508 +
509 + local myarch="$(tc-arch)"
510 + if [[ $myarch = amd64 ]] ; then
511 + target_arch=x64
512 + ffmpeg_target_arch=x64
513 + elif [[ $myarch = x86 ]] ; then
514 + target_arch=ia32
515 + ffmpeg_target_arch=ia32
516 + elif [[ $myarch = arm64 ]] ; then
517 + target_arch=arm64
518 + ffmpeg_target_arch=arm64
519 + elif [[ $myarch = arm ]] ; then
520 + target_arch=arm
521 + ffmpeg_target_arch=$(usex neon arm-neon arm)
522 + # TODO: re-enable NaCl (NativeClient).
523 + local CTARGET=${CTARGET:-${CHOST}}
524 + if [[ $(tc-is-softfloat) == "no" ]]; then
525 +
526 + myconf_gyp+=" -Darm_float_abi=hard"
527 + fi
528 + filter-flags "-mfpu=*"
529 + use neon || myconf_gyp+=" -Darm_fpu=${ARM_FPU:-vfpv3-d16}"
530 +
531 + if [[ ${CTARGET} == armv[78]* ]]; then
532 + myconf_gyp+=" -Darmv7=1"
533 + else
534 + myconf_gyp+=" -Darmv7=0"
535 + fi
536 + myconf_gyp+=" -Dsysroot=
537 + $(gyp_use neon arm_neon)
538 + -Ddisable_nacl=1"
539 + else
540 + die "Failed to determine target arch, got '$myarch'."
541 + fi
542 +
543 + myconf_gyp+=" -Dtarget_arch=${target_arch}"
544 +
545 + # Make sure that -Werror doesn't get added to CFLAGS by the build system.
546 + # Depending on GCC version the warnings are different and we don't want
547 + # the build to fail because of that.
548 + myconf_gyp+=" -Dwerror="
549 + myconf_gn+=" treat_warnings_as_errors=false"
550 +
551 + # Disable fatal linker warnings, bug 506268.
552 + myconf_gyp+=" -Ddisable_fatal_linker_warnings=1"
553 + myconf_gn+=" fatal_linker_warnings=false"
554 +
555 + # Avoid CFLAGS problems, bug #352457, bug #390147.
556 + if ! use custom-cflags; then
557 + replace-flags "-Os" "-O2"
558 + strip-flags
559 +
560 + # Prevent linker from running out of address space, bug #471810 .
561 + if use x86; then
562 + filter-flags "-g*"
563 + fi
564 +
565 + # Prevent libvpx build failures. Bug 530248, 544702, 546984.
566 + if [[ ${myarch} == amd64 || ${myarch} == x86 ]]; then
567 + filter-flags -mno-mmx -mno-sse2 -mno-ssse3 -mno-sse4.1 -mno-avx -mno-avx2
568 + fi
569 + fi
570 +
571 + # Make sure the build system will use the right tools, bug #340795.
572 + tc-export AR CC CXX NM
573 +
574 + # Tools for building programs to be executed on the build system, bug #410883.
575 + if tc-is-cross-compiler; then
576 + export AR_host=$(tc-getBUILD_AR)
577 + export CC_host=$(tc-getBUILD_CC)
578 + export CXX_host=$(tc-getBUILD_CXX)
579 + export NM_host=$(tc-getBUILD_NM)
580 + fi
581 +
582 + # Bug 491582.
583 + export TMPDIR="${WORKDIR}/temp"
584 + mkdir -p -m 755 "${TMPDIR}" || die
585 +
586 + if ! use system-ffmpeg; then
587 + local build_ffmpeg_args=""
588 + if use pic && [[ "${ffmpeg_target_arch}" == "ia32" ]]; then
589 + build_ffmpeg_args+=" --disable-asm"
590 + fi
591 +
592 + # Re-configure bundled ffmpeg. See bug #491378 for example reasons.
593 + einfo "Configuring bundled ffmpeg..."
594 + pushd third_party/ffmpeg > /dev/null || die
595 + chromium/scripts/build_ffmpeg.py linux ${ffmpeg_target_arch} \
596 + --branding ${ffmpeg_branding} -- ${build_ffmpeg_args} || die
597 + chromium/scripts/copy_config.sh || die
598 + chromium/scripts/generate_gyp.py || die
599 + popd > /dev/null || die
600 + fi
601 +
602 + third_party/libaddressinput/chromium/tools/update-strings.py || die
603 +
604 + touch chrome/test/data/webui/i18n_process_css_test.html || die
605 +
606 + einfo "Configuring Chromium..."
607 + if use gn; then
608 + tools/gn/bootstrap/bootstrap.py -v --gn-gen-args "${myconf_gn}" || die
609 + out/Release/gn gen --args="${myconf_gn}" out/Release || die
610 + else
611 + build/linux/unbundle/replace_gyp_files.py ${myconf_gyp} || die
612 + egyp_chromium ${myconf_gyp} || die
613 + fi
614 +}
615 +
616 +eninja() {
617 + if [[ -z ${NINJAOPTS+set} ]]; then
618 + local jobs=$(makeopts_jobs)
619 + local loadavg=$(makeopts_loadavg)
620 +
621 + if [[ ${MAKEOPTS} == *-j* && ${jobs} != 999 ]]; then
622 + NINJAOPTS+=" -j ${jobs}"
623 + fi
624 + if [[ ${MAKEOPTS} == *-l* && ${loadavg} != 999 ]]; then
625 + NINJAOPTS+=" -l ${loadavg}"
626 + fi
627 + fi
628 + set -- ninja -v ${NINJAOPTS} "$@"
629 + echo "$@"
630 + "$@"
631 +}
632 +
633 +src_compile() {
634 + local ninja_targets="chrome chrome_sandbox chromedriver"
635 +
636 + # Build mksnapshot and pax-mark it.
637 + eninja -C out/Release mksnapshot || die
638 + pax-mark m out/Release/mksnapshot
639 +
640 + # Even though ninja autodetects number of CPUs, we respect
641 + # user's options, for debugging with -j 1 or any other reason.
642 + eninja -C out/Release ${ninja_targets} || die
643 +
644 + pax-mark m out/Release/chrome
645 +}
646 +
647 +src_install() {
648 + exeinto "${CHROMIUM_HOME}"
649 + doexe out/Release/chrome || die
650 +
651 + newexe out/Release/chrome_sandbox chrome-sandbox || die
652 + fperms 4755 "${CHROMIUM_HOME}/chrome-sandbox"
653 +
654 + doexe out/Release/chromedriver || die
655 + use widevine && doexe out/Release/libwidevinecdmadapter.so
656 +
657 + # if ! use arm; then
658 + # doexe out/Release/nacl_helper{,_bootstrap} || die
659 + # insinto "${CHROMIUM_HOME}"
660 + # doins out/Release/nacl_irt_*.nexe || die
661 + # doins out/Release/libppGoogleNaClPluginChrome.so || die
662 + # fi
663 +
664 + local sedargs=( -e "s:/usr/lib/:/usr/$(get_libdir)/:g" )
665 + if [[ -n ${CHROMIUM_SUFFIX} ]]; then
666 + sedargs+=(
667 + -e "s:chromium-browser:chromium-browser${CHROMIUM_SUFFIX}:g"
668 + -e "s:chromium.desktop:chromium${CHROMIUM_SUFFIX}.desktop:g"
669 + -e "s:plugins:plugins --user-data-dir=\${HOME}/.config/chromium${CHROMIUM_SUFFIX}:"
670 + )
671 + fi
672 + sed "${sedargs[@]}" "${FILESDIR}/chromium-launcher-r3.sh" > chromium-launcher.sh || die
673 + doexe chromium-launcher.sh
674 +
675 + # It is important that we name the target "chromium-browser",
676 + # xdg-utils expect it; bug #355517.
677 + dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser${CHROMIUM_SUFFIX} || die
678 + # keep the old symlink around for consistency
679 + dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium${CHROMIUM_SUFFIX} || die
680 +
681 + dosym "${CHROMIUM_HOME}/chromedriver" /usr/bin/chromedriver${CHROMIUM_SUFFIX} || die
682 +
683 + # Allow users to override command-line options, bug #357629.
684 + dodir /etc/chromium || die
685 + insinto /etc/chromium
686 + newins "${FILESDIR}/chromium.default" "default" || die
687 +
688 + pushd out/Release/locales > /dev/null || die
689 + chromium_remove_language_paks
690 + popd
691 +
692 + insinto "${CHROMIUM_HOME}"
693 + doins out/Release/*.bin || die
694 + doins out/Release/*.pak || die
695 +
696 + doins out/Release/icudtl.dat || die
697 +
698 + doins -r out/Release/locales || die
699 + doins -r out/Release/resources || die
700 +
701 + newman out/Release/chrome.1 chromium${CHROMIUM_SUFFIX}.1 || die
702 + newman out/Release/chrome.1 chromium-browser${CHROMIUM_SUFFIX}.1 || die
703 +
704 + # Install icons and desktop entry.
705 + local branding size
706 + for size in 16 22 24 32 48 64 128 256 ; do
707 + case ${size} in
708 + 16|32) branding="chrome/app/theme/default_100_percent/chromium" ;;
709 + *) branding="chrome/app/theme/chromium" ;;
710 + esac
711 + newicon -s ${size} "${branding}/product_logo_${size}.png" \
712 + chromium-browser${CHROMIUM_SUFFIX}.png
713 + done
714 +
715 + local mime_types="text/html;text/xml;application/xhtml+xml;"
716 + mime_types+="x-scheme-handler/http;x-scheme-handler/https;" # bug #360797
717 + mime_types+="x-scheme-handler/ftp;" # bug #412185
718 + mime_types+="x-scheme-handler/mailto;x-scheme-handler/webcal;" # bug #416393
719 + make_desktop_entry \
720 + chromium-browser${CHROMIUM_SUFFIX} \
721 + "Chromium${CHROMIUM_SUFFIX}" \
722 + chromium-browser${CHROMIUM_SUFFIX} \
723 + "Network;WebBrowser" \
724 + "MimeType=${mime_types}\nStartupWMClass=chromium-browser"
725 + sed -e "/^Exec/s/$/ %U/" -i "${ED}"/usr/share/applications/*.desktop || die
726 +
727 + # Install GNOME default application entry (bug #303100).
728 + if use gnome; then
729 + dodir /usr/share/gnome-control-center/default-apps || die
730 + insinto /usr/share/gnome-control-center/default-apps
731 + newins "${FILESDIR}"/chromium-browser.xml chromium-browser${CHROMIUM_SUFFIX}.xml || die
732 + if [[ "${CHROMIUM_SUFFIX}" != "" ]]; then
733 + sed "s:chromium-browser:chromium-browser${CHROMIUM_SUFFIX}:g" -i \
734 + "${ED}"/usr/share/gnome-control-center/default-apps/chromium-browser${CHROMIUM_SUFFIX}.xml
735 + fi
736 + fi
737 +
738 + readme.gentoo_create_doc
739 +}
740 +
741 +pkg_preinst() {
742 + gnome2_icon_savelist
743 +}
744 +
745 +pkg_postrm() {
746 + gnome2_icon_cache_update
747 + xdg_desktop_database_update
748 +}
749 +
750 +pkg_postinst() {
751 + gnome2_icon_cache_update
752 + xdg_desktop_database_update
753 + readme.gentoo_print_elog
754 +}