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