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