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: ChangeLog chromium-18.0.1025.1-r1.ebuild chromium-9999-r1.ebuild chromium-17.0.963.46-r1.ebuild chromium-17.0.963.44.ebuild chromium-18.0.1017.2.ebuild chromium-17.0.963.44-r1.ebuild
Date: Thu, 02 Feb 2012 14:44:53
Message-Id: 20120202144443.E3BD52004C@flycatcher.gentoo.org
1 phajdan.jr 12/02/02 14:44:43
2
3 Modified: ChangeLog chromium-9999-r1.ebuild
4 Added: chromium-18.0.1025.1-r1.ebuild
5 chromium-17.0.963.46-r1.ebuild
6 Removed: chromium-17.0.963.44.ebuild
7 chromium-18.0.1017.2.ebuild
8 chromium-17.0.963.44-r1.ebuild
9 Log:
10 Experimental patch to remove unconditional -msse3 -mssse3 CFLAGS (bug #401537 by Sylvain BERTRAND). 18.x now has Malay (ms) LINGUA. Remove old.
11
12 (Portage version: 2.1.10.44/cvs/Linux i686)
13
14 Revision Changes Path
15 1.552 www-client/chromium/ChangeLog
16
17 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/chromium/ChangeLog?rev=1.552&view=markup
18 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/chromium/ChangeLog?rev=1.552&content-type=text/plain
19 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/chromium/ChangeLog?r1=1.551&r2=1.552
20
21 Index: ChangeLog
22 ===================================================================
23 RCS file: /var/cvsroot/gentoo-x86/www-client/chromium/ChangeLog,v
24 retrieving revision 1.551
25 retrieving revision 1.552
26 diff -u -r1.551 -r1.552
27 --- ChangeLog 1 Feb 2012 20:11:58 -0000 1.551
28 +++ ChangeLog 2 Feb 2012 14:44:43 -0000 1.552
29 @@ -1,6 +1,17 @@
30 # ChangeLog for www-client/chromium
31 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
32 -# $Header: /var/cvsroot/gentoo-x86/www-client/chromium/ChangeLog,v 1.551 2012/02/01 20:11:58 phajdan.jr Exp $
33 +# $Header: /var/cvsroot/gentoo-x86/www-client/chromium/ChangeLog,v 1.552 2012/02/02 14:44:43 phajdan.jr Exp $
34 +
35 +*chromium-18.0.1025.1-r1 (02 Feb 2012)
36 +*chromium-17.0.963.46-r1 (02 Feb 2012)
37 +
38 + 02 Feb 2012; Pawel Hajdan jr <phajdan.jr@g.o>
39 + +files/chromium-media-no-sse-r0.patch, -chromium-17.0.963.44.ebuild,
40 + -chromium-17.0.963.44-r1.ebuild, +chromium-17.0.963.46-r1.ebuild,
41 + -chromium-18.0.1017.2.ebuild, +chromium-18.0.1025.1-r1.ebuild,
42 + chromium-9999-r1.ebuild:
43 + Experimental patch to remove unconditional -msse3 -mssse3 CFLAGS (bug #401537
44 + by Sylvain BERTRAND). 18.x now has Malay (ms) LINGUA. Remove old.
45
46 *chromium-18.0.1025.1 (01 Feb 2012)
47
48
49
50
51 1.90 www-client/chromium/chromium-9999-r1.ebuild
52
53 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/chromium/chromium-9999-r1.ebuild?rev=1.90&view=markup
54 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/chromium/chromium-9999-r1.ebuild?rev=1.90&content-type=text/plain
55 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/chromium/chromium-9999-r1.ebuild?r1=1.89&r2=1.90
56
57 Index: chromium-9999-r1.ebuild
58 ===================================================================
59 RCS file: /var/cvsroot/gentoo-x86/www-client/chromium/chromium-9999-r1.ebuild,v
60 retrieving revision 1.89
61 retrieving revision 1.90
62 diff -u -r1.89 -r1.90
63 --- chromium-9999-r1.ebuild 1 Feb 2012 20:11:58 -0000 1.89
64 +++ chromium-9999-r1.ebuild 2 Feb 2012 14:44:43 -0000 1.90
65 @@ -1,6 +1,6 @@
66 # Copyright 1999-2012 Gentoo Foundation
67 # Distributed under the terms of the GNU General Public License v2
68 -# $Header: /var/cvsroot/gentoo-x86/www-client/chromium/chromium-9999-r1.ebuild,v 1.89 2012/02/01 20:11:58 phajdan.jr Exp $
69 +# $Header: /var/cvsroot/gentoo-x86/www-client/chromium/chromium-9999-r1.ebuild,v 1.90 2012/02/02 14:44:43 phajdan.jr Exp $
70
71 EAPI="4"
72 PYTHON_DEPEND="2:2.6"
73 @@ -19,7 +19,7 @@
74
75 # en_US is ommitted on purpose from the list below. It must always be available.
76 LANGS="am ar bg bn ca cs da de el en_GB es es_LA et fa fi fil fr gu he hi hr
77 -hu id it ja kn ko lt lv ml mr nb nl pl pt_BR pt_PT ro ru sk sl sr sv sw ta te th
78 +hu id it ja kn ko lt lv ml mr ms nb nl pl pt_BR pt_PT ro ru sk sl sr sv sw ta te th
79 tr uk vi zh_CN zh_TW"
80 for lang in ${LANGS}; do
81 IUSE+=" linguas_${lang}"
82
83
84
85 1.1 www-client/chromium/chromium-18.0.1025.1-r1.ebuild
86
87 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/chromium/chromium-18.0.1025.1-r1.ebuild?rev=1.1&view=markup
88 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/chromium/chromium-18.0.1025.1-r1.ebuild?rev=1.1&content-type=text/plain
89
90 Index: chromium-18.0.1025.1-r1.ebuild
91 ===================================================================
92 # Copyright 1999-2012 Gentoo Foundation
93 # Distributed under the terms of the GNU General Public License v2
94 # $Header: /var/cvsroot/gentoo-x86/www-client/chromium/chromium-18.0.1025.1-r1.ebuild,v 1.1 2012/02/02 14:44:43 phajdan.jr Exp $
95
96 EAPI="4"
97 PYTHON_DEPEND="2:2.6"
98
99 inherit eutils fdo-mime flag-o-matic gnome2-utils linux-info multilib \
100 pax-utils portability python toolchain-funcs versionator virtualx
101
102 DESCRIPTION="Open-source version of Google Chrome web browser"
103 HOMEPAGE="http://chromium.org/"
104 SRC_URI="http://commondatastorage.googleapis.com/chromium-browser-official/${P}.tar.bz2"
105
106 LICENSE="BSD"
107 SLOT="0"
108 KEYWORDS="~amd64 ~x86"
109 IUSE="bindist cups custom-cflags gnome gnome-keyring kerberos pulseaudio"
110
111 # en_US is ommitted on purpose from the list below. It must always be available.
112 LANGS="am ar bg bn ca cs da de el en_GB es es_LA et fa fi fil fr gu he hi hr
113 hu id it ja kn ko lt lv ml mr ms nb nl pl pt_BR pt_PT ro ru sk sl sr sv sw ta te th
114 tr uk vi zh_CN zh_TW"
115 for lang in ${LANGS}; do
116 IUSE+=" linguas_${lang}"
117 done
118
119 RDEPEND="app-arch/bzip2
120 cups? (
121 dev-libs/libgcrypt
122 >=net-print/cups-1.3.11
123 )
124 >=dev-lang/v8-3.8.9.4
125 dev-libs/dbus-glib
126 dev-libs/elfutils
127 >=dev-libs/icu-4.4.1
128 >=dev-libs/libevent-1.4.13
129 dev-libs/libxml2[icu]
130 dev-libs/libxslt
131 >=dev-libs/nss-3.12.3
132 gnome? ( >=gnome-base/gconf-2.24.0 )
133 gnome-keyring? ( >=gnome-base/gnome-keyring-2.28.2 )
134 >=media-libs/alsa-lib-1.0.19
135 media-libs/flac
136 virtual/jpeg
137 media-libs/libpng
138 >=media-libs/libwebp-0.1.2
139 media-libs/speex
140 pulseaudio? ( media-sound/pulseaudio )
141 sys-fs/udev
142 sys-libs/zlib
143 x11-libs/gtk+:2
144 x11-libs/libXinerama
145 x11-libs/libXScrnSaver
146 x11-libs/libXtst
147 kerberos? ( virtual/krb5 )"
148 DEPEND="${RDEPEND}
149 >=dev-lang/nacl-toolchain-newlib-0_p7311
150 dev-lang/perl
151 dev-lang/yasm
152 dev-python/simplejson
153 >=dev-util/gperf-3.0.3
154 >=dev-util/pkgconfig-0.23
155 >=sys-devel/bison-2.4.3
156 sys-devel/flex
157 >=sys-devel/make-3.81-r2
158 test? ( dev-python/pyftpdlib )"
159 RDEPEND+="
160 !=www-client/chromium-9999
161 x11-misc/xdg-utils
162 virtual/ttf-fonts"
163
164 gyp_use() {
165 if [[ $# -lt 2 ]]; then
166 echo "!!! usage: gyp_use <USEFLAG> <GYPFLAG>" >&2
167 return 1
168 fi
169 if use "$1"; then echo "-D$2=1"; else echo "-D$2=0"; fi
170 }
171
172 egyp() {
173 set -- build/gyp_chromium --depth=. "${@}"
174 echo "${@}" >&2
175 "${@}"
176 }
177
178 # Chromium uses different names for some langs,
179 # return Chromium name corresponding to a Gentoo lang.
180 chromium_lang() {
181 if [[ "$1" == "es_LA" ]]; then
182 echo "es_419"
183 else
184 echo "$1"
185 fi
186 }
187
188 get_bundled_v8_version() {
189 "$(PYTHON -2)" "${FILESDIR}"/extract_v8_version.py v8/src/version.cc
190 }
191
192 get_installed_v8_version() {
193 best_version dev-lang/v8 | sed -e 's@dev-lang/v8-@@g'
194 }
195
196 if ! has chromium-pkg_die ${EBUILD_DEATH_HOOKS}; then
197 EBUILD_DEATH_HOOKS+=" chromium-pkg_die";
198 fi
199
200 chromium-pkg_die() {
201 if [[ "${EBUILD_PHASE}" != "compile" ]]; then
202 return
203 fi
204
205 # Prevent user problems like bug #348235.
206 eshopts_push -s extglob
207 if is-flagq '-g?(gdb)?([1-9])'; then
208 ewarn
209 ewarn "You have enabled debug info (i.e. -g or -ggdb in your CFLAGS/CXXFLAGS)."
210 ewarn "Please try removing -g{,gdb} before reporting a bug."
211 ewarn
212 fi
213 eshopts_pop
214
215 # ccache often causes bogus compile failures, especially when the cache gets
216 # corrupted.
217 if has ccache ${FEATURES}; then
218 ewarn
219 ewarn "You have enabled ccache. Please try disabling ccache"
220 ewarn "before reporting a bug."
221 ewarn
222 fi
223
224 # No ricer bugs.
225 if use custom-cflags; then
226 ewarn
227 ewarn "You have enabled the custom-cflags USE flag."
228 ewarn "Please disable it before reporting a bug."
229 ewarn
230 fi
231
232 # If the system doesn't have enough memory, the compilation is known to
233 # fail. Print info about memory to recognize this condition.
234 einfo
235 einfo "$(grep MemTotal /proc/meminfo)"
236 einfo "$(grep SwapTotal /proc/meminfo)"
237 einfo
238 }
239
240 pkg_setup() {
241 if [[ "${SLOT}" == "0" ]]; then
242 CHROMIUM_SUFFIX=""
243 else
244 CHROMIUM_SUFFIX="-${SLOT}"
245 fi
246 CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser${CHROMIUM_SUFFIX}"
247
248 # Make sure the build system will use the right tools, bug #340795.
249 tc-export AR CC CXX RANLIB
250
251 # Make sure the build system will use the right python, bug #344367.
252 python_set_active_version 2
253 python_pkg_setup
254
255 if [[ "${MERGE_TYPE}" == "source" || "${MERGE_TYPE}" == "binary" ]]; then
256 # Fail if the kernel doesn't support features needed for sandboxing,
257 # bug #363907.
258 ERROR_PID_NS="PID_NS is required for sandbox to work"
259 ERROR_NET_NS="NET_NS is required for sandbox to work"
260 CONFIG_CHECK="~PID_NS ~NET_NS"
261 check_extra_config
262 fi
263
264 if use bindist; then
265 elog "bindist enabled: H.264 video support will be disabled."
266 else
267 elog "bindist disabled: Resulting binaries may not be legal to re-distribute."
268 fi
269 }
270
271 src_prepare() {
272 ln -s /usr/$(get_libdir)/nacl-toolchain-newlib \
273 native_client/toolchain/linux_x86_newlib || die
274
275 # zlib-1.2.5.1-r1 renames the OF macro in zconf.h, bug 383371.
276 sed -i '1i#define OF(x) x' \
277 third_party/zlib/contrib/minizip/{ioapi,{,un}zip}.c \
278 chrome/common/zip*.cc || die
279
280 # Revert WebKit changeset responsible for Gentoo bug #393471.
281 epatch "${FILESDIR}/${PN}-revert-jpeg-swizzle-r2.patch"
282
283 # Prevent gyp failures caused by target type 'settings' instead of 'none'.
284 epatch "${FILESDIR}/${PN}-gyp-settings-r0.patch"
285
286 # Prevent compilation failures caused by missing zlib #include
287 # and dependency.
288 epatch "${FILESDIR}/${PN}-webkit-zlib-r0.patch"
289
290 # Fix crashes on illegal instructions, bug #401537.
291 epatch "${FILESDIR}/${PN}-media-no-sse-r0.patch"
292
293 epatch_user
294
295 # Remove most bundled libraries. Some are still needed.
296 find third_party -type f \! -iname '*.gyp*' \
297 \! -path 'third_party/WebKit/*' \
298 \! -path 'third_party/angle/*' \
299 \! -path 'third_party/cacheinvalidation/*' \
300 \! -path 'third_party/cld/*' \
301 \! -path 'third_party/expat/*' \
302 \! -path 'third_party/ffmpeg/*' \
303 \! -path 'third_party/flac/flac.h' \
304 \! -path 'third_party/gpsd/*' \
305 \! -path 'third_party/harfbuzz/*' \
306 \! -path 'third_party/hunspell/*' \
307 \! -path 'third_party/iccjpeg/*' \
308 \! -path 'third_party/jsoncpp/*' \
309 \! -path 'third_party/khronos/*' \
310 \! -path 'third_party/launchpad_translations/*' \
311 \! -path 'third_party/leveldb/*' \
312 \! -path 'third_party/leveldatabase/*' \
313 \! -path 'third_party/libjingle/*' \
314 \! -path 'third_party/libphonenumber/*' \
315 \! -path 'third_party/libsrtp/*' \
316 \! -path 'third_party/libvpx/*' \
317 \! -path 'third_party/libyuv/*' \
318 \! -path 'third_party/lss/*' \
319 \! -path 'third_party/mesa/*' \
320 \! -path 'third_party/modp_b64/*' \
321 \! -path 'third_party/mongoose/*' \
322 \! -path 'third_party/npapi/*' \
323 \! -path 'third_party/openmax/*' \
324 \! -path 'third_party/ots/*' \
325 \! -path 'third_party/protobuf/*' \
326 \! -path 'third_party/scons-2.0.1/*' \
327 \! -path 'third_party/sfntly/*' \
328 \! -path 'third_party/skia/*' \
329 \! -path 'third_party/smhasher/*' \
330 \! -path 'third_party/speex/speex.h' \
331 \! -path 'third_party/sqlite/*' \
332 \! -path 'third_party/tcmalloc/*' \
333 \! -path 'third_party/tlslite/*' \
334 \! -path 'third_party/undoview/*' \
335 \! -path 'third_party/v8-i18n/*' \
336 \! -path 'third_party/webdriver/*' \
337 \! -path 'third_party/webgl_conformance/*' \
338 \! -path 'third_party/webrtc/*' \
339 \! -path 'third_party/zlib/contrib/minizip/*' \
340 -delete || die
341
342 local v8_bundled="$(get_bundled_v8_version)"
343 local v8_installed="$(get_installed_v8_version)"
344 elog "V8 version: bundled - ${v8_bundled}; installed - ${v8_installed}"
345
346 # Remove bundled v8.
347 find v8 -type f \! -iname '*.gyp*' -delete || die
348
349 # The implementation files include v8 headers with full path,
350 # like #include "v8/include/v8.h". Make sure the system headers
351 # will be used.
352 # TODO: find a solution that can be upstreamed.
353 rmdir v8/include || die
354 ln -s /usr/include v8/include || die
355
356 # Make sure the build system will use the right python, bug #344367.
357 # Only convert directories that need it, to save time.
358 python_convert_shebangs -q -r 2 build tools
359 }
360
361 src_configure() {
362 local myconf=""
363
364 # Never tell the build system to "enable" SSE2, it has a few unexpected
365 # additions, bug #336871.
366 myconf+=" -Ddisable_sse2=1"
367
368 # Use system-provided libraries.
369 # TODO: use_system_ffmpeg
370 # TODO: use_system_hunspell (upstream changes needed).
371 # TODO: use_system_ssl (http://crbug.com/58087).
372 # TODO: use_system_sqlite (http://crbug.com/22208).
373 # TODO: use_system_vpx
374 myconf+="
375 -Duse_system_bzip2=1
376 -Duse_system_flac=1
377 -Duse_system_icu=1
378 -Duse_system_libevent=1
379 -Duse_system_libjpeg=1
380 -Duse_system_libpng=1
381 -Duse_system_libwebp=1
382 -Duse_system_libxml=1
383 -Duse_system_speex=1
384 -Duse_system_v8=1
385 -Duse_system_xdg_utils=1
386 -Duse_system_yasm=1
387 -Duse_system_zlib=1"
388
389 # Optional dependencies.
390 # TODO: linux_link_kerberos, bug #381289.
391 myconf+="
392 $(gyp_use cups 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 kerberos use_kerberos)
397 $(gyp_use pulseaudio use_pulseaudio)"
398
399 # Enable sandbox.
400 myconf+="
401 -Dlinux_sandbox_path=${CHROMIUM_HOME}/chrome_sandbox
402 -Dlinux_sandbox_chrome_path=${CHROMIUM_HOME}/chrome"
403
404 # if host-is-pax; then
405 # # Prevent the build from failing (bug #301880). The performance
406 # # difference is very small.
407 # myconf+=" -Dv8_use_snapshot=0"
408 # fi
409
410 # Our system ffmpeg should support more codecs than the bundled one
411 # for Chromium.
412 # myconf+=" -Dproprietary_codecs=1"
413
414 if ! use bindist; then
415 # Enable H.624 support in bundled ffmpeg.
416 myconf+=" -Dproprietary_codecs=1 -Dffmpeg_branding=Chrome"
417 fi
418
419 local myarch="$(tc-arch)"
420 if [[ $myarch = amd64 ]] ; then
421 myconf+=" -Dtarget_arch=x64"
422 elif [[ $myarch = x86 ]] ; then
423 myconf+=" -Dtarget_arch=ia32"
424 elif [[ $myarch = arm ]] ; then
425 # TODO: check this again after
426 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39509 is fixed.
427 append-flags -fno-tree-sink
428
429 myconf+=" -Dtarget_arch=arm -Ddisable_nacl=1 -Dlinux_use_tcmalloc=0"
430 else
431 die "Failed to determine target arch, got '$myarch'."
432 fi
433
434 # Make sure that -Werror doesn't get added to CFLAGS by the build system.
435 # Depending on GCC version the warnings are different and we don't want
436 # the build to fail because of that.
437 myconf+=" -Dwerror="
438
439 # Avoid CFLAGS problems, bug #352457, bug #390147.
440 if ! use custom-cflags; then
441 replace-flags "-Os" "-O2"
442 strip-flags
443 fi
444
445 egyp ${myconf} || die
446 }
447
448 src_compile() {
449 emake chrome chrome_sandbox chromedriver BUILDTYPE=Release V=1 || die
450 pax-mark m out/Release/chrome
451 if use test; then
452 emake {base,cacheinvalidation,crypto,googleurl,gpu,media,net,printing}_unittests BUILDTYPE=Release V=1 || die
453 pax-mark m out/Release/{base,cacheinvalidation,crypto,googleurl,gpu,media,net,printing}_unittests
454 fi
455 }
456
457 src_test() {
458 # For more info see bug #350349.
459 local mylocale='en_US.utf8'
460 if ! locale -a | grep -q "$mylocale"; then
461 eerror "${PN} requires ${mylocale} locale for tests"
462 eerror "Please read the following guides for more information:"
463 eerror " http://www.gentoo.org/doc/en/guide-localization.xml"
464 eerror " http://www.gentoo.org/doc/en/utf-8.xml"
465 die "locale ${mylocale} is not supported"
466 fi
467
468 # For more info see bug #370957.
469 if [[ $UID -eq 0 ]]; then
470 die "Tests must be run as non-root. Please use FEATURES=userpriv."
471 fi
472
473 # ICUStringConversionsTest: bug #350347.
474 # MessagePumpLibeventTest: bug #398501.
475 LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/base_unittests virtualmake \
476 '--gtest_filter=-ICUStringConversionsTest.*:MessagePumpLibeventTest.*'
477
478 LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/cacheinvalidation_unittests virtualmake
479 LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/crypto_unittests virtualmake
480 LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/googleurl_unittests virtualmake
481 LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/gpu_unittests virtualmake
482 LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/media_unittests virtualmake
483
484 # NetUtilTest: bug #361885.
485 # DnsConfigServiceTest.GetSystemConfig: bug #394883.
486 LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/net_unittests virtualmake \
487 '--gtest_filter=-NetUtilTest.IDNToUnicode*:NetUtilTest.FormatUrl*:DnsConfigServiceTest.GetSystemConfig'
488
489 LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/printing_unittests virtualmake
490 }
491
492 src_install() {
493 exeinto "${CHROMIUM_HOME}"
494 doexe out/Release/chrome || die
495 doexe out/Release/chrome_sandbox || die
496 fperms 4755 "${CHROMIUM_HOME}/chrome_sandbox"
497
498 doexe out/Release/chromedriver || die
499
500 # Install Native Client files on platforms that support it.
501 insinto "${CHROMIUM_HOME}"
502 case "$(tc-arch)" in
503 amd64)
504 doexe out/Release/nacl_helper{,_bootstrap} || die
505 doins out/Release/nacl_irt_x86_64.nexe || die
506 doins out/Release/libppGoogleNaClPluginChrome.so || die
507 ;;
508 x86)
509 doexe out/Release/nacl_helper{,_bootstrap} || die
510 doins out/Release/nacl_irt_x86_32.nexe || die
511 doins out/Release/libppGoogleNaClPluginChrome.so || die
512 ;;
513 esac
514
515 newexe "${FILESDIR}"/chromium-launcher-r2.sh chromium-launcher.sh || die
516 if [[ "${CHROMIUM_SUFFIX}" != "" ]]; then
517 sed "s:chromium-browser:chromium-browser${CHROMIUM_SUFFIX}:g" \
518 -i "${ED}"/"${CHROMIUM_HOME}"/chromium-launcher.sh || die
519 sed "s:chromium.desktop:chromium${CHROMIUM_SUFFIX}.desktop:g" \
520 -i "${ED}"/"${CHROMIUM_HOME}"/chromium-launcher.sh || die
521 sed "s:plugins:plugins --user-data-dir=\${HOME}/.config/chromium${CHROMIUM_SUFFIX}:" \
522 -i "${ED}"/"${CHROMIUM_HOME}"/chromium-launcher.sh || die
523 fi
524
525 # It is important that we name the target "chromium-browser",
526 # xdg-utils expect it; bug #355517.
527 dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser${CHROMIUM_SUFFIX} || die
528 # keep the old symlink around for consistency
529 dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium${CHROMIUM_SUFFIX} || die
530
531 # Allow users to override command-line options, bug #357629.
532 dodir /etc/chromium || die
533 insinto /etc/chromium
534 newins "${FILESDIR}/chromium.default" "default" || die
535
536 # Support LINGUAS, bug #332751.
537 local pak
538 for pak in out/Release/locales/*.pak; do
539 local pakbasename="$(basename ${pak})"
540 local pakname="${pakbasename%.pak}"
541 local langname="${pakname//-/_}"
542
543 # Do not issue warning for en_US locale. This is the fallback
544 # locale so it should always be installed.
545 if [[ "${langname}" == "en_US" ]]; then
546 continue
547 fi
548
549 local found=false
550 local lang
551 for lang in ${LANGS}; do
552 local crlang="$(chromium_lang ${lang})"
553 if [[ "${langname}" == "${crlang}" ]]; then
554 found=true
555 break
556 fi
557 done
558 if ! $found; then
559 ewarn "LINGUAS warning: no ${langname} in LANGS"
560 fi
561 done
562 local lang
563 for lang in ${LANGS}; do
564 local crlang="$(chromium_lang ${lang})"
565 local pakfile="out/Release/locales/${crlang//_/-}.pak"
566 if [ ! -f "${pakfile}" ]; then
567 ewarn "LINGUAS warning: no .pak file for ${lang} (${pakfile} not found)"
568 fi
569 if ! use linguas_${lang}; then
570 rm "${pakfile}" || die
571 fi
572 done
573
574 insinto "${CHROMIUM_HOME}"
575 doins out/Release/chrome.pak || die
576 doins out/Release/resources.pak || die
577
578 doins -r out/Release/locales || die
579 doins -r out/Release/resources || die
580
581 newman out/Release/chrome.1 chromium${CHROMIUM_SUFFIX}.1 || die
582 newman out/Release/chrome.1 chromium-browser${CHROMIUM_SUFFIX}.1 || die
583
584 # Chromium looks for these in its folder
585 # See media_posix.cc and base_paths_linux.cc
586 # dosym /usr/$(get_libdir)/libavcodec.so.52 "${CHROMIUM_HOME}" || die
587 # dosym /usr/$(get_libdir)/libavformat.so.52 "${CHROMIUM_HOME}" || die
588 # dosym /usr/$(get_libdir)/libavutil.so.50 "${CHROMIUM_HOME}" || die
589 doexe out/Release/libffmpegsumo.so || die
590
591 # Install icons and desktop entry.
592 for SIZE in 16 22 24 32 48 64 128 256 ; do
593 insinto /usr/share/icons/hicolor/${SIZE}x${SIZE}/apps
594 newins chrome/app/theme/chromium/product_logo_${SIZE}.png \
595 chromium-browser${CHROMIUM_SUFFIX}.png || die
596 done
597 local mime_types="text/html;text/xml;application/xhtml+xml;"
598 mime_types+="x-scheme-handler/http;x-scheme-handler/https;" # bug #360797
599 make_desktop_entry \
600 chromium-browser${CHROMIUM_SUFFIX} \
601 "Chromium${CHROMIUM_SUFFIX}" \
602 chromium-browser${CHROMIUM_SUFFIX} \
603 "Network;WebBrowser" \
604 "MimeType=${mime_types}\nStartupWMClass=chromium-browser"
605 sed -e "/^Exec/s/$/ %U/" -i "${ED}"/usr/share/applications/*.desktop || die
606
607 # Install GNOME default application entry (bug #303100).
608 if use gnome; then
609 dodir /usr/share/gnome-control-center/default-apps || die
610 insinto /usr/share/gnome-control-center/default-apps
611 newins "${FILESDIR}"/chromium-browser.xml chromium-browser${CHROMIUM_SUFFIX}.xml || die
612 if [[ "${CHROMIUM_SUFFIX}" != "" ]]; then
613 sed "s:chromium-browser:chromium-browser${CHROMIUM_SUFFIX}:g" -i \
614 "${ED}"/usr/share/gnome-control-center/default-apps/chromium-browser${CHROMIUM_SUFFIX}.xml
615 fi
616 fi
617 }
618
619 pkg_preinst() {
620 gnome2_icon_savelist
621 }
622
623 pkg_postinst() {
624 fdo-mime_desktop_database_update
625 gnome2_icon_cache_update
626
627 # For more info see bug #292201, bug #352263, bug #361859.
628 elog
629 elog "Depending on your desktop environment, you may need"
630 elog "to install additional packages to get icons on the Downloads page."
631 elog
632 elog "For KDE, the required package is kde-base/oxygen-icons."
633 elog
634 elog "For other desktop environments, try one of the following:"
635 elog " - x11-themes/gnome-icon-theme"
636 elog " - x11-themes/tango-icon-theme"
637
638 # For more info see bug #359153.
639 elog
640 elog "Some web pages may require additional fonts to display properly."
641 elog "Try installing some of the following packages if some characters"
642 elog "are not displayed properly:"
643 elog " - media-fonts/arphicfonts"
644 elog " - media-fonts/bitstream-cyberbit"
645 elog " - media-fonts/droid"
646 elog " - media-fonts/ipamonafont"
647 elog " - media-fonts/ja-ipafonts"
648 elog " - media-fonts/takao-fonts"
649 elog " - media-fonts/wqy-microhei"
650 elog " - media-fonts/wqy-zenhei"
651 }
652
653 pkg_postrm() {
654 gnome2_icon_cache_update
655 }
656
657
658
659 1.1 www-client/chromium/chromium-17.0.963.46-r1.ebuild
660
661 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/chromium/chromium-17.0.963.46-r1.ebuild?rev=1.1&view=markup
662 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/chromium/chromium-17.0.963.46-r1.ebuild?rev=1.1&content-type=text/plain
663
664 Index: chromium-17.0.963.46-r1.ebuild
665 ===================================================================
666 # Copyright 1999-2012 Gentoo Foundation
667 # Distributed under the terms of the GNU General Public License v2
668 # $Header: /var/cvsroot/gentoo-x86/www-client/chromium/chromium-17.0.963.46-r1.ebuild,v 1.1 2012/02/02 14:44:43 phajdan.jr Exp $
669
670 EAPI="4"
671 PYTHON_DEPEND="2:2.6"
672
673 inherit eutils fdo-mime flag-o-matic gnome2-utils linux-info multilib \
674 pax-utils portability python toolchain-funcs versionator virtualx
675
676 DESCRIPTION="Open-source version of Google Chrome web browser"
677 HOMEPAGE="http://chromium.org/"
678 SRC_URI="http://commondatastorage.googleapis.com/chromium-browser-official/${P}.tar.bz2"
679
680 LICENSE="BSD"
681 SLOT="0"
682 KEYWORDS="~amd64 ~x86"
683 IUSE="bindist cups custom-cflags gnome gnome-keyring kerberos pulseaudio"
684
685 # en_US is ommitted on purpose from the list below. It must always be available.
686 LANGS="am ar bg bn ca cs da de el en_GB es es_LA et fa fi fil fr gu he hi hr
687 hu id it ja kn ko lt lv ml mr nb nl pl pt_BR pt_PT ro ru sk sl sr sv sw ta te th
688 tr uk vi zh_CN zh_TW"
689 for lang in ${LANGS}; do
690 IUSE+=" linguas_${lang}"
691 done
692
693 RDEPEND="app-arch/bzip2
694 cups? (
695 dev-libs/libgcrypt
696 >=net-print/cups-1.3.11
697 )
698 >=dev-lang/v8-3.7.6
699 dev-libs/dbus-glib
700 dev-libs/elfutils
701 >=dev-libs/icu-4.4.1
702 >=dev-libs/libevent-1.4.13
703 dev-libs/libxml2[icu]
704 dev-libs/libxslt
705 >=dev-libs/nss-3.12.3
706 gnome? ( >=gnome-base/gconf-2.24.0 )
707 gnome-keyring? ( >=gnome-base/gnome-keyring-2.28.2 )
708 >=media-libs/alsa-lib-1.0.19
709 media-libs/flac
710 virtual/jpeg
711 media-libs/libpng
712 >=media-libs/libwebp-0.1.2
713 media-libs/speex
714 pulseaudio? ( media-sound/pulseaudio )
715 sys-libs/zlib
716 x11-libs/gtk+:2
717 x11-libs/libXinerama
718 x11-libs/libXScrnSaver
719 x11-libs/libXtst
720 kerberos? ( virtual/krb5 )"
721 DEPEND="${RDEPEND}
722 >=dev-lang/nacl-toolchain-newlib-0_p7311
723 dev-lang/perl
724 dev-lang/yasm
725 dev-python/simplejson
726 >=dev-util/gperf-3.0.3
727 >=dev-util/pkgconfig-0.23
728 >=sys-devel/bison-2.4.3
729 sys-devel/flex
730 >=sys-devel/make-3.81-r2
731 test? ( dev-python/pyftpdlib )"
732 RDEPEND+="
733 !=www-client/chromium-9999
734 x11-misc/xdg-utils
735 virtual/ttf-fonts"
736
737 gyp_use() {
738 if [[ $# -lt 2 ]]; then
739 echo "!!! usage: gyp_use <USEFLAG> <GYPFLAG>" >&2
740 return 1
741 fi
742 if use "$1"; then echo "-D$2=1"; else echo "-D$2=0"; fi
743 }
744
745 egyp() {
746 set -- build/gyp_chromium --depth=. "${@}"
747 echo "${@}" >&2
748 "${@}"
749 }
750
751 # Chromium uses different names for some langs,
752 # return Chromium name corresponding to a Gentoo lang.
753 chromium_lang() {
754 if [[ "$1" == "es_LA" ]]; then
755 echo "es_419"
756 else
757 echo "$1"
758 fi
759 }
760
761 get_bundled_v8_version() {
762 "$(PYTHON -2)" "${FILESDIR}"/extract_v8_version.py v8/src/version.cc
763 }
764
765 get_installed_v8_version() {
766 best_version dev-lang/v8 | sed -e 's@dev-lang/v8-@@g'
767 }
768
769 if ! has chromium-pkg_die ${EBUILD_DEATH_HOOKS}; then
770 EBUILD_DEATH_HOOKS+=" chromium-pkg_die";
771 fi
772
773 chromium-pkg_die() {
774 if [[ "${EBUILD_PHASE}" != "compile" ]]; then
775 return
776 fi
777
778 # Prevent user problems like bug #348235.
779 eshopts_push -s extglob
780 if is-flagq '-g?(gdb)?([1-9])'; then
781 ewarn
782 ewarn "You have enabled debug info (i.e. -g or -ggdb in your CFLAGS/CXXFLAGS)."
783 ewarn "Please try removing -g{,gdb} before reporting a bug."
784 ewarn
785 fi
786 eshopts_pop
787
788 # ccache often causes bogus compile failures, especially when the cache gets
789 # corrupted.
790 if has ccache ${FEATURES}; then
791 ewarn
792 ewarn "You have enabled ccache. Please try disabling ccache"
793 ewarn "before reporting a bug."
794 ewarn
795 fi
796
797 # No ricer bugs.
798 if use custom-cflags; then
799 ewarn
800 ewarn "You have enabled the custom-cflags USE flag."
801 ewarn "Please disable it before reporting a bug."
802 ewarn
803 fi
804
805 # If the system doesn't have enough memory, the compilation is known to
806 # fail. Print info about memory to recognize this condition.
807 einfo
808 einfo "$(grep MemTotal /proc/meminfo)"
809 einfo "$(grep SwapTotal /proc/meminfo)"
810 einfo
811 }
812
813 pkg_setup() {
814 if [[ "${SLOT}" == "0" ]]; then
815 CHROMIUM_SUFFIX=""
816 else
817 CHROMIUM_SUFFIX="-${SLOT}"
818 fi
819 CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser${CHROMIUM_SUFFIX}"
820
821 # Make sure the build system will use the right tools, bug #340795.
822 tc-export AR CC CXX RANLIB
823
824 # Make sure the build system will use the right python, bug #344367.
825 python_set_active_version 2
826 python_pkg_setup
827
828 if [[ "${MERGE_TYPE}" == "source" || "${MERGE_TYPE}" == "binary" ]]; then
829 # Fail if the kernel doesn't support features needed for sandboxing,
830 # bug #363907.
831 ERROR_PID_NS="PID_NS is required for sandbox to work"
832 ERROR_NET_NS="NET_NS is required for sandbox to work"
833 CONFIG_CHECK="~PID_NS ~NET_NS"
834 check_extra_config
835 fi
836
837 if use bindist; then
838 elog "bindist enabled: H.264 video support will be disabled."
839 else
840 elog "bindist disabled: Resulting binaries may not be legal to re-distribute."
841 fi
842 }
843
844 src_prepare() {
845 ln -s /usr/$(get_libdir)/nacl-toolchain-newlib \
846 native_client/toolchain/linux_x86_newlib || die
847
848 # zlib-1.2.5.1-r1 renames the OF macro in zconf.h, bug 383371.
849 sed -i '1i#define OF(x) x' \
850 third_party/zlib/contrib/minizip/{ioapi,{,un}zip}.c \
851 chrome/common/zip*.cc || die
852
853 # Revert WebKit changeset responsible for Gentoo bug #393471.
854 epatch "${FILESDIR}/${PN}-revert-jpeg-swizzle-r0.patch"
855
856 # Backport upstream fix for Gentoo bug #389479.
857 epatch "${FILESDIR}/${PN}-dev-shm-r0.patch"
858
859 # Fix crashes on illegal instructions, bug #401537.
860 epatch "${FILESDIR}/${PN}-media-no-sse-r0.patch"
861
862 epatch_user
863
864 # Remove most bundled libraries. Some are still needed.
865 find third_party -type f \! -iname '*.gyp*' \
866 \! -path 'third_party/WebKit/*' \
867 \! -path 'third_party/angle/*' \
868 \! -path 'third_party/cacheinvalidation/*' \
869 \! -path 'third_party/cld/*' \
870 \! -path 'third_party/expat/*' \
871 \! -path 'third_party/ffmpeg/*' \
872 \! -path 'third_party/flac/flac.h' \
873 \! -path 'third_party/gpsd/*' \
874 \! -path 'third_party/harfbuzz/*' \
875 \! -path 'third_party/hunspell/*' \
876 \! -path 'third_party/iccjpeg/*' \
877 \! -path 'third_party/jsoncpp/*' \
878 \! -path 'third_party/khronos/*' \
879 \! -path 'third_party/launchpad_translations/*' \
880 \! -path 'third_party/leveldb/*' \
881 \! -path 'third_party/leveldatabase/*' \
882 \! -path 'third_party/libjingle/*' \
883 \! -path 'third_party/libphonenumber/*' \
884 \! -path 'third_party/libvpx/*' \
885 \! -path 'third_party/lss/*' \
886 \! -path 'third_party/mesa/*' \
887 \! -path 'third_party/modp_b64/*' \
888 \! -path 'third_party/mongoose/*' \
889 \! -path 'third_party/npapi/*' \
890 \! -path 'third_party/openmax/*' \
891 \! -path 'third_party/ots/*' \
892 \! -path 'third_party/protobuf/*' \
893 \! -path 'third_party/scons-2.0.1/*' \
894 \! -path 'third_party/sfntly/*' \
895 \! -path 'third_party/skia/*' \
896 \! -path 'third_party/smhasher/*' \
897 \! -path 'third_party/speex/speex.h' \
898 \! -path 'third_party/sqlite/*' \
899 \! -path 'third_party/tcmalloc/*' \
900 \! -path 'third_party/tlslite/*' \
901 \! -path 'third_party/undoview/*' \
902 \! -path 'third_party/v8-i18n/*' \
903 \! -path 'third_party/webdriver/*' \
904 \! -path 'third_party/webgl_conformance/*' \
905 \! -path 'third_party/webrtc/*' \
906 \! -path 'third_party/zlib/contrib/minizip/*' \
907 -delete || die
908
909 local v8_bundled="$(get_bundled_v8_version)"
910 local v8_installed="$(get_installed_v8_version)"
911 elog "V8 version: bundled - ${v8_bundled}; installed - ${v8_installed}"
912
913 # Remove bundled v8.
914 find v8 -type f \! -iname '*.gyp*' -delete || die
915
916 # The implementation files include v8 headers with full path,
917 # like #include "v8/include/v8.h". Make sure the system headers
918 # will be used.
919 # TODO: find a solution that can be upstreamed.
920 rmdir v8/include || die
921 ln -s /usr/include v8/include || die
922
923 # Make sure the build system will use the right python, bug #344367.
924 # Only convert directories that need it, to save time.
925 python_convert_shebangs -q -r 2 build tools
926 }
927
928 src_configure() {
929 local myconf=""
930
931 # Never tell the build system to "enable" SSE2, it has a few unexpected
932 # additions, bug #336871.
933 myconf+=" -Ddisable_sse2=1"
934
935 # Use system-provided libraries.
936 # TODO: use_system_ffmpeg
937 # TODO: use_system_hunspell (upstream changes needed).
938 # TODO: use_system_ssl (http://crbug.com/58087).
939 # TODO: use_system_sqlite (http://crbug.com/22208).
940 # TODO: use_system_vpx
941 myconf+="
942 -Duse_system_bzip2=1
943 -Duse_system_flac=1
944 -Duse_system_icu=1
945 -Duse_system_libevent=1
946 -Duse_system_libjpeg=1
947 -Duse_system_libpng=1
948 -Duse_system_libwebp=1
949 -Duse_system_libxml=1
950 -Duse_system_speex=1
951 -Duse_system_v8=1
952 -Duse_system_xdg_utils=1
953 -Duse_system_yasm=1
954 -Duse_system_zlib=1"
955
956 # Optional dependencies.
957 # TODO: linux_link_kerberos, bug #381289.
958 myconf+="
959 $(gyp_use cups use_cups)
960 $(gyp_use gnome use_gconf)
961 $(gyp_use gnome-keyring use_gnome_keyring)
962 $(gyp_use gnome-keyring linux_link_gnome_keyring)
963 $(gyp_use kerberos use_kerberos)
964 $(gyp_use pulseaudio use_pulseaudio)"
965
966 # Enable sandbox.
967 myconf+="
968 -Dlinux_sandbox_path=${CHROMIUM_HOME}/chrome_sandbox
969 -Dlinux_sandbox_chrome_path=${CHROMIUM_HOME}/chrome"
970
971 # if host-is-pax; then
972 # # Prevent the build from failing (bug #301880). The performance
973 # # difference is very small.
974 # myconf+=" -Dv8_use_snapshot=0"
975 # fi
976
977 # Our system ffmpeg should support more codecs than the bundled one
978 # for Chromium.
979 # myconf+=" -Dproprietary_codecs=1"
980
981 if ! use bindist; then
982 # Enable H.624 support in bundled ffmpeg.
983 myconf+=" -Dproprietary_codecs=1 -Dffmpeg_branding=Chrome"
984 fi
985
986 local myarch="$(tc-arch)"
987 if [[ $myarch = amd64 ]] ; then
988 myconf+=" -Dtarget_arch=x64"
989 elif [[ $myarch = x86 ]] ; then
990 myconf+=" -Dtarget_arch=ia32"
991 elif [[ $myarch = arm ]] ; then
992 # TODO: check this again after
993 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39509 is fixed.
994 append-flags -fno-tree-sink
995
996 myconf+=" -Dtarget_arch=arm -Ddisable_nacl=1 -Dlinux_use_tcmalloc=0"
997 else
998 die "Failed to determine target arch, got '$myarch'."
999 fi
1000
1001 # Make sure that -Werror doesn't get added to CFLAGS by the build system.
1002 # Depending on GCC version the warnings are different and we don't want
1003 # the build to fail because of that.
1004 myconf+=" -Dwerror="
1005
1006 # Avoid CFLAGS problems, bug #352457, bug #390147.
1007 if ! use custom-cflags; then
1008 replace-flags "-Os" "-O2"
1009 strip-flags
1010 fi
1011
1012 egyp ${myconf} || die
1013 }
1014
1015 src_compile() {
1016 emake chrome chrome_sandbox chromedriver BUILDTYPE=Release V=1 || die
1017 pax-mark m out/Release/chrome
1018 if use test; then
1019 emake {base,cacheinvalidation,crypto,googleurl,gpu,media,net,printing}_unittests BUILDTYPE=Release V=1 || die
1020 pax-mark m out/Release/{base,cacheinvalidation,crypto,googleurl,gpu,media,net,printing}_unittests
1021 fi
1022 }
1023
1024 src_test() {
1025 # For more info see bug #350349.
1026 local mylocale='en_US.utf8'
1027 if ! locale -a | grep -q "$mylocale"; then
1028 eerror "${PN} requires ${mylocale} locale for tests"
1029 eerror "Please read the following guides for more information:"
1030 eerror " http://www.gentoo.org/doc/en/guide-localization.xml"
1031 eerror " http://www.gentoo.org/doc/en/utf-8.xml"
1032 die "locale ${mylocale} is not supported"
1033 fi
1034
1035 # For more info see bug #370957.
1036 if [[ $UID -eq 0 ]]; then
1037 die "Tests must be run as non-root. Please use FEATURES=userpriv."
1038 fi
1039
1040 # ICUStringConversionsTest: bug #350347.
1041 # MessagePumpLibeventTest: bug #398501.
1042 LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/base_unittests virtualmake \
1043 '--gtest_filter=-ICUStringConversionsTest.*:MessagePumpLibeventTest.*'
1044
1045 LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/cacheinvalidation_unittests virtualmake
1046 LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/crypto_unittests virtualmake
1047 LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/googleurl_unittests virtualmake
1048 LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/gpu_unittests virtualmake
1049 LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/media_unittests virtualmake
1050
1051 # NetUtilTest: bug #361885.
1052 # NetUtilTest.GenerateFileName: some locale-related mismatch.
1053 # UDP: unstable, active development. We should revisit this later.
1054 # CertDatabaseNSSTest.ImportCACertHierarchyTree: works in 18.x, broken here.
1055 LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/net_unittests virtualmake \
1056 '--gtest_filter=-NetUtilTest.IDNToUnicode*:NetUtilTest.FormatUrl*:NetUtilTest.GenerateFileName:*UDP*:CertDatabaseNSSTest.ImportCACertHierarchyTree'
1057
1058 LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/printing_unittests virtualmake
1059 }
1060
1061 src_install() {
1062 exeinto "${CHROMIUM_HOME}"
1063 doexe out/Release/chrome || die
1064 doexe out/Release/chrome_sandbox || die
1065 fperms 4755 "${CHROMIUM_HOME}/chrome_sandbox"
1066
1067 doexe out/Release/chromedriver || die
1068
1069 # Install Native Client files on platforms that support it.
1070 insinto "${CHROMIUM_HOME}"
1071 case "$(tc-arch)" in
1072 amd64)
1073 doexe out/Release/nacl_helper{,_bootstrap} || die
1074 doins out/Release/nacl_irt_x86_64.nexe || die
1075 doins out/Release/libppGoogleNaClPluginChrome.so || die
1076 ;;
1077 x86)
1078 doexe out/Release/nacl_helper{,_bootstrap} || die
1079 doins out/Release/nacl_irt_x86_32.nexe || die
1080 doins out/Release/libppGoogleNaClPluginChrome.so || die
1081 ;;
1082 esac
1083
1084 newexe "${FILESDIR}"/chromium-launcher-r2.sh chromium-launcher.sh || die
1085 if [[ "${CHROMIUM_SUFFIX}" != "" ]]; then
1086 sed "s:chromium-browser:chromium-browser${CHROMIUM_SUFFIX}:g" \
1087 -i "${ED}"/"${CHROMIUM_HOME}"/chromium-launcher.sh || die
1088 sed "s:chromium.desktop:chromium${CHROMIUM_SUFFIX}.desktop:g" \
1089 -i "${ED}"/"${CHROMIUM_HOME}"/chromium-launcher.sh || die
1090 sed "s:plugins:plugins --user-data-dir=\${HOME}/.config/chromium${CHROMIUM_SUFFIX}:" \
1091 -i "${ED}"/"${CHROMIUM_HOME}"/chromium-launcher.sh || die
1092 fi
1093
1094 # It is important that we name the target "chromium-browser",
1095 # xdg-utils expect it; bug #355517.
1096 dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser${CHROMIUM_SUFFIX} || die
1097 # keep the old symlink around for consistency
1098 dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium${CHROMIUM_SUFFIX} || die
1099
1100 # Allow users to override command-line options, bug #357629.
1101 dodir /etc/chromium || die
1102 insinto /etc/chromium
1103 newins "${FILESDIR}/chromium.default" "default" || die
1104
1105 # Support LINGUAS, bug #332751.
1106 local pak
1107 for pak in out/Release/locales/*.pak; do
1108 local pakbasename="$(basename ${pak})"
1109 local pakname="${pakbasename%.pak}"
1110 local langname="${pakname//-/_}"
1111
1112 # Do not issue warning for en_US locale. This is the fallback
1113 # locale so it should always be installed.
1114 if [[ "${langname}" == "en_US" ]]; then
1115 continue
1116 fi
1117
1118 local found=false
1119 local lang
1120 for lang in ${LANGS}; do
1121 local crlang="$(chromium_lang ${lang})"
1122 if [[ "${langname}" == "${crlang}" ]]; then
1123 found=true
1124 break
1125 fi
1126 done
1127 if ! $found; then
1128 ewarn "LINGUAS warning: no ${langname} in LANGS"
1129 fi
1130 done
1131 local lang
1132 for lang in ${LANGS}; do
1133 local crlang="$(chromium_lang ${lang})"
1134 local pakfile="out/Release/locales/${crlang//_/-}.pak"
1135 if [ ! -f "${pakfile}" ]; then
1136 ewarn "LINGUAS warning: no .pak file for ${lang} (${pakfile} not found)"
1137 fi
1138 if ! use linguas_${lang}; then
1139 rm "${pakfile}" || die
1140 fi
1141 done
1142
1143 insinto "${CHROMIUM_HOME}"
1144 doins out/Release/chrome.pak || die
1145 doins out/Release/resources.pak || die
1146
1147 doins -r out/Release/locales || die
1148 doins -r out/Release/resources || die
1149
1150 newman out/Release/chrome.1 chromium${CHROMIUM_SUFFIX}.1 || die
1151 newman out/Release/chrome.1 chromium-browser${CHROMIUM_SUFFIX}.1 || die
1152
1153 # Chromium looks for these in its folder
1154 # See media_posix.cc and base_paths_linux.cc
1155 # dosym /usr/$(get_libdir)/libavcodec.so.52 "${CHROMIUM_HOME}" || die
1156 # dosym /usr/$(get_libdir)/libavformat.so.52 "${CHROMIUM_HOME}" || die
1157 # dosym /usr/$(get_libdir)/libavutil.so.50 "${CHROMIUM_HOME}" || die
1158 doexe out/Release/libffmpegsumo.so || die
1159
1160 # Install icons and desktop entry.
1161 for SIZE in 16 22 24 32 48 64 128 256 ; do
1162 insinto /usr/share/icons/hicolor/${SIZE}x${SIZE}/apps
1163 newins chrome/app/theme/chromium/product_logo_${SIZE}.png \
1164 chromium-browser${CHROMIUM_SUFFIX}.png || die
1165 done
1166 local mime_types="text/html;text/xml;application/xhtml+xml;"
1167 mime_types+="x-scheme-handler/http;x-scheme-handler/https;" # bug #360797
1168 make_desktop_entry \
1169 chromium-browser${CHROMIUM_SUFFIX} \
1170 "Chromium${CHROMIUM_SUFFIX}" \
1171 chromium-browser${CHROMIUM_SUFFIX} \
1172 "Network;WebBrowser" \
1173 "MimeType=${mime_types}\nStartupWMClass=chromium-browser"
1174 sed -e "/^Exec/s/$/ %U/" -i "${ED}"/usr/share/applications/*.desktop || die
1175
1176 # Install GNOME default application entry (bug #303100).
1177 if use gnome; then
1178 dodir /usr/share/gnome-control-center/default-apps || die
1179 insinto /usr/share/gnome-control-center/default-apps
1180 newins "${FILESDIR}"/chromium-browser.xml chromium-browser${CHROMIUM_SUFFIX}.xml || die
1181 if [[ "${CHROMIUM_SUFFIX}" != "" ]]; then
1182 sed "s:chromium-browser:chromium-browser${CHROMIUM_SUFFIX}:g" -i \
1183 "${ED}"/usr/share/gnome-control-center/default-apps/chromium-browser${CHROMIUM_SUFFIX}.xml
1184 fi
1185 fi
1186 }
1187
1188 pkg_preinst() {
1189 gnome2_icon_savelist
1190 }
1191
1192 pkg_postinst() {
1193 fdo-mime_desktop_database_update
1194 gnome2_icon_cache_update
1195
1196 # For more info see bug #292201, bug #352263, bug #361859.
1197 elog
1198 elog "Depending on your desktop environment, you may need"
1199 elog "to install additional packages to get icons on the Downloads page."
1200 elog
1201 elog "For KDE, the required package is kde-base/oxygen-icons."
1202 elog
1203 elog "For other desktop environments, try one of the following:"
1204 elog " - x11-themes/gnome-icon-theme"
1205 elog " - x11-themes/tango-icon-theme"
1206
1207 # For more info see bug #359153.
1208 elog
1209 elog "Some web pages may require additional fonts to display properly."
1210 elog "Try installing some of the following packages if some characters"
1211 elog "are not displayed properly:"
1212 elog " - media-fonts/arphicfonts"
1213 elog " - media-fonts/bitstream-cyberbit"
1214 elog " - media-fonts/droid"
1215 elog " - media-fonts/ipamonafont"
1216 elog " - media-fonts/ja-ipafonts"
1217 elog " - media-fonts/takao-fonts"
1218 elog " - media-fonts/wqy-microhei"
1219 elog " - media-fonts/wqy-zenhei"
1220 }
1221
1222 pkg_postrm() {
1223 gnome2_icon_cache_update
1224 }