Gentoo Archives: gentoo-commits

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