Gentoo Archives: gentoo-commits

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