Gentoo Archives: gentoo-commits

From: "Mike Gilbert (floppym)" <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in www-client/chromium: chromium-18.0.1025.45.ebuild ChangeLog chromium-18.0.1025.33.ebuild
Date: Thu, 01 Mar 2012 02:46:47
Message-Id: 20120301024633.796962004B@flycatcher.gentoo.org
1 floppym 12/03/01 02:46:33
2
3 Modified: ChangeLog
4 Added: chromium-18.0.1025.45.ebuild
5 Removed: chromium-18.0.1025.33.ebuild
6 Log:
7 Version bump for beta channel release.
8
9 (Portage version: 2.2.0_alpha89/cvs/Linux x86_64)
10
11 Revision Changes Path
12 1.568 www-client/chromium/ChangeLog
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/chromium/ChangeLog?rev=1.568&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/chromium/ChangeLog?rev=1.568&content-type=text/plain
16 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/chromium/ChangeLog?r1=1.567&r2=1.568
17
18 Index: ChangeLog
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo-x86/www-client/chromium/ChangeLog,v
21 retrieving revision 1.567
22 retrieving revision 1.568
23 diff -u -r1.567 -r1.568
24 --- ChangeLog 29 Feb 2012 11:06:21 -0000 1.567
25 +++ ChangeLog 1 Mar 2012 02:46:33 -0000 1.568
26 @@ -1,6 +1,12 @@
27 # ChangeLog for www-client/chromium
28 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
29 -# $Header: /var/cvsroot/gentoo-x86/www-client/chromium/ChangeLog,v 1.567 2012/02/29 11:06:21 phajdan.jr Exp $
30 +# $Header: /var/cvsroot/gentoo-x86/www-client/chromium/ChangeLog,v 1.568 2012/03/01 02:46:33 floppym Exp $
31 +
32 +*chromium-18.0.1025.45 (01 Mar 2012)
33 +
34 + 01 Mar 2012; Mike Gilbert <floppym@g.o> +chromium-18.0.1025.45.ebuild,
35 + -chromium-18.0.1025.33.ebuild:
36 + Version bump for beta channel release.
37
38 *chromium-19.0.1055.1 (29 Feb 2012)
39
40
41
42
43 1.1 www-client/chromium/chromium-18.0.1025.45.ebuild
44
45 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/chromium/chromium-18.0.1025.45.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/chromium/chromium-18.0.1025.45.ebuild?rev=1.1&content-type=text/plain
47
48 Index: chromium-18.0.1025.45.ebuild
49 ===================================================================
50 # Copyright 1999-2012 Gentoo Foundation
51 # Distributed under the terms of the GNU General Public License v2
52 # $Header: /var/cvsroot/gentoo-x86/www-client/chromium/chromium-18.0.1025.45.ebuild,v 1.1 2012/03/01 02:46:33 floppym Exp $
53
54 EAPI="4"
55 PYTHON_DEPEND="2:2.6"
56
57 inherit eutils fdo-mime flag-o-matic gnome2-utils linux-info multilib \
58 pax-utils portability python toolchain-funcs versionator virtualx
59
60 DESCRIPTION="Open-source version of Google Chrome web browser"
61 HOMEPAGE="http://chromium.org/"
62 SRC_URI="http://commondatastorage.googleapis.com/chromium-browser-official/${P}.tar.bz2"
63
64 LICENSE="BSD"
65 SLOT="0"
66 KEYWORDS="~amd64 ~x86"
67 IUSE="bindist cups custom-cflags gnome gnome-keyring kerberos pulseaudio"
68
69 # en_US is ommitted on purpose from the list below. It must always be available.
70 LANGS="am ar bg bn ca cs da de el en_GB es es_LA et fa fi fil fr gu he hi hr
71 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
72 tr uk vi zh_CN zh_TW"
73 for lang in ${LANGS}; do
74 IUSE+=" linguas_${lang}"
75 done
76
77 RDEPEND="app-arch/bzip2
78 cups? (
79 dev-libs/libgcrypt
80 >=net-print/cups-1.3.11
81 )
82 >=dev-lang/v8-3.8.9.4
83 dev-libs/dbus-glib
84 dev-libs/elfutils
85 >=dev-libs/icu-4.4.1
86 >=dev-libs/libevent-1.4.13
87 dev-libs/libxml2[icu]
88 dev-libs/libxslt
89 >=dev-libs/nss-3.12.3
90 gnome? ( >=gnome-base/gconf-2.24.0 )
91 gnome-keyring? ( >=gnome-base/gnome-keyring-2.28.2 )
92 >=media-libs/alsa-lib-1.0.19
93 media-libs/flac
94 virtual/jpeg
95 media-libs/libpng
96 >=media-libs/libwebp-0.1.3
97 media-libs/speex
98 pulseaudio? ( media-sound/pulseaudio )
99 sys-fs/udev
100 sys-libs/zlib
101 x11-libs/gtk+:2
102 x11-libs/libXinerama
103 x11-libs/libXScrnSaver
104 x11-libs/libXtst
105 kerberos? ( virtual/krb5 )"
106 DEPEND="${RDEPEND}
107 >=dev-lang/nacl-toolchain-newlib-0_p7311
108 dev-lang/perl
109 dev-lang/yasm
110 dev-python/simplejson
111 >=dev-util/gperf-3.0.3
112 >=dev-util/pkgconfig-0.23
113 >=sys-devel/bison-2.4.3
114 sys-devel/flex
115 >=sys-devel/make-3.81-r2
116 test? ( dev-python/pyftpdlib )"
117 RDEPEND+="
118 !=www-client/chromium-9999
119 x11-misc/xdg-utils
120 virtual/ttf-fonts"
121
122 gyp_use() {
123 if [[ $# -lt 2 ]]; then
124 echo "!!! usage: gyp_use <USEFLAG> <GYPFLAG>" >&2
125 return 1
126 fi
127 if use "$1"; then echo "-D$2=1"; else echo "-D$2=0"; fi
128 }
129
130 egyp() {
131 set -- build/gyp_chromium --depth=. "${@}"
132 echo "${@}" >&2
133 "${@}"
134 }
135
136 # Chromium uses different names for some langs,
137 # return Chromium name corresponding to a Gentoo lang.
138 chromium_lang() {
139 if [[ "$1" == "es_LA" ]]; then
140 echo "es_419"
141 else
142 echo "$1"
143 fi
144 }
145
146 get_bundled_v8_version() {
147 "$(PYTHON -2)" "${FILESDIR}"/extract_v8_version.py v8/src/version.cc
148 }
149
150 get_installed_v8_version() {
151 best_version dev-lang/v8 | sed -e 's@dev-lang/v8-@@g'
152 }
153
154 if ! has chromium-pkg_die ${EBUILD_DEATH_HOOKS}; then
155 EBUILD_DEATH_HOOKS+=" chromium-pkg_die";
156 fi
157
158 chromium-pkg_die() {
159 if [[ "${EBUILD_PHASE}" != "compile" ]]; then
160 return
161 fi
162
163 # Prevent user problems like bug #348235.
164 eshopts_push -s extglob
165 if is-flagq '-g?(gdb)?([1-9])'; then
166 ewarn
167 ewarn "You have enabled debug info (i.e. -g or -ggdb in your CFLAGS/CXXFLAGS)."
168 ewarn "Please try removing -g{,gdb} before reporting a bug."
169 ewarn
170 fi
171 eshopts_pop
172
173 # ccache often causes bogus compile failures, especially when the cache gets
174 # corrupted.
175 if has ccache ${FEATURES}; then
176 ewarn
177 ewarn "You have enabled ccache. Please try disabling ccache"
178 ewarn "before reporting a bug."
179 ewarn
180 fi
181
182 # No ricer bugs.
183 if use custom-cflags; then
184 ewarn
185 ewarn "You have enabled the custom-cflags USE flag."
186 ewarn "Please disable it before reporting a bug."
187 ewarn
188 fi
189
190 # If the system doesn't have enough memory, the compilation is known to
191 # fail. Print info about memory to recognize this condition.
192 einfo
193 einfo "$(grep MemTotal /proc/meminfo)"
194 einfo "$(grep SwapTotal /proc/meminfo)"
195 einfo
196 }
197
198 pkg_setup() {
199 if [[ "${SLOT}" == "0" ]]; then
200 CHROMIUM_SUFFIX=""
201 else
202 CHROMIUM_SUFFIX="-${SLOT}"
203 fi
204 CHROMIUM_HOME="/usr/$(get_libdir)/chromium-browser${CHROMIUM_SUFFIX}"
205
206 # Make sure the build system will use the right tools, bug #340795.
207 tc-export AR CC CXX RANLIB
208
209 # Make sure the build system will use the right python, bug #344367.
210 python_set_active_version 2
211 python_pkg_setup
212
213 if [[ "${MERGE_TYPE}" == "source" || "${MERGE_TYPE}" == "binary" ]]; then
214 # Fail if the kernel doesn't support features needed for sandboxing,
215 # bug #363907.
216 ERROR_PID_NS="PID_NS is required for sandbox to work"
217 ERROR_NET_NS="NET_NS is required for sandbox to work"
218 CONFIG_CHECK="~PID_NS ~NET_NS"
219 check_extra_config
220 fi
221
222 if use bindist; then
223 elog "bindist enabled: H.264 video support will be disabled."
224 else
225 elog "bindist disabled: Resulting binaries may not be legal to re-distribute."
226 fi
227 }
228
229 src_prepare() {
230 ln -s /usr/$(get_libdir)/nacl-toolchain-newlib \
231 native_client/toolchain/linux_x86_newlib || die
232
233 # zlib-1.2.5.1-r1 renames the OF macro in zconf.h, bug 383371.
234 sed -i '1i#define OF(x) x' \
235 third_party/zlib/contrib/minizip/{ioapi,{,un}zip}.c \
236 chrome/common/zip*.cc || die
237
238 # Revert WebKit changeset responsible for Gentoo bug #393471.
239 epatch "${FILESDIR}/${PN}-revert-jpeg-swizzle-r2.patch"
240
241 # Prevent gyp failures caused by target type 'settings' instead of 'none'.
242 epatch "${FILESDIR}/${PN}-gyp-settings-r0.patch"
243
244 # Prevent compilation failures caused by missing zlib #include
245 # and dependency.
246 epatch "${FILESDIR}/${PN}-webkit-zlib-r0.patch"
247
248 # Fix crashes on illegal instructions, bug #401537.
249 epatch "${FILESDIR}/${PN}-media-no-sse-r0.patch"
250
251 epatch_user
252
253 # Remove most bundled libraries. Some are still needed.
254 find third_party -type f \! -iname '*.gyp*' \
255 \! -path 'third_party/WebKit/*' \
256 \! -path 'third_party/angle/*' \
257 \! -path 'third_party/cacheinvalidation/*' \
258 \! -path 'third_party/cld/*' \
259 \! -path 'third_party/expat/*' \
260 \! -path 'third_party/ffmpeg/*' \
261 \! -path 'third_party/flac/flac.h' \
262 \! -path 'third_party/gpsd/*' \
263 \! -path 'third_party/harfbuzz/*' \
264 \! -path 'third_party/hunspell/*' \
265 \! -path 'third_party/iccjpeg/*' \
266 \! -path 'third_party/jsoncpp/*' \
267 \! -path 'third_party/khronos/*' \
268 \! -path 'third_party/launchpad_translations/*' \
269 \! -path 'third_party/leveldb/*' \
270 \! -path 'third_party/leveldatabase/*' \
271 \! -path 'third_party/libjingle/*' \
272 \! -path 'third_party/libphonenumber/*' \
273 \! -path 'third_party/libsrtp/*' \
274 \! -path 'third_party/libvpx/*' \
275 \! -path 'third_party/libyuv/*' \
276 \! -path 'third_party/lss/*' \
277 \! -path 'third_party/mesa/*' \
278 \! -path 'third_party/modp_b64/*' \
279 \! -path 'third_party/mongoose/*' \
280 \! -path 'third_party/npapi/*' \
281 \! -path 'third_party/openmax/*' \
282 \! -path 'third_party/ots/*' \
283 \! -path 'third_party/protobuf/*' \
284 \! -path 'third_party/scons-2.0.1/*' \
285 \! -path 'third_party/sfntly/*' \
286 \! -path 'third_party/skia/*' \
287 \! -path 'third_party/smhasher/*' \
288 \! -path 'third_party/speex/speex.h' \
289 \! -path 'third_party/sqlite/*' \
290 \! -path 'third_party/tcmalloc/*' \
291 \! -path 'third_party/tlslite/*' \
292 \! -path 'third_party/undoview/*' \
293 \! -path 'third_party/v8-i18n/*' \
294 \! -path 'third_party/webdriver/*' \
295 \! -path 'third_party/webgl_conformance/*' \
296 \! -path 'third_party/webrtc/*' \
297 \! -path 'third_party/zlib/contrib/minizip/*' \
298 -delete || die
299
300 local v8_bundled="$(get_bundled_v8_version)"
301 local v8_installed="$(get_installed_v8_version)"
302 elog "V8 version: bundled - ${v8_bundled}; installed - ${v8_installed}"
303
304 # Remove bundled v8.
305 find v8 -type f \! -iname '*.gyp*' -delete || die
306
307 # The implementation files include v8 headers with full path,
308 # like #include "v8/include/v8.h". Make sure the system headers
309 # will be used.
310 # TODO: find a solution that can be upstreamed.
311 rmdir v8/include || die
312 ln -s /usr/include v8/include || die
313
314 # Make sure the build system will use the right python, bug #344367.
315 # Only convert directories that need it, to save time.
316 python_convert_shebangs -q -r 2 build tools
317 }
318
319 src_configure() {
320 local myconf=""
321
322 # Never tell the build system to "enable" SSE2, it has a few unexpected
323 # additions, bug #336871.
324 myconf+=" -Ddisable_sse2=1"
325
326 # Use system-provided libraries.
327 # TODO: use_system_ffmpeg
328 # TODO: use_system_hunspell (upstream changes needed).
329 # TODO: use_system_ssl (http://crbug.com/58087).
330 # TODO: use_system_sqlite (http://crbug.com/22208).
331 # TODO: use_system_vpx
332 myconf+="
333 -Duse_system_bzip2=1
334 -Duse_system_flac=1
335 -Duse_system_icu=1
336 -Duse_system_libevent=1
337 -Duse_system_libjpeg=1
338 -Duse_system_libpng=1
339 -Duse_system_libwebp=1
340 -Duse_system_libxml=1
341 -Duse_system_speex=1
342 -Duse_system_v8=1
343 -Duse_system_xdg_utils=1
344 -Duse_system_yasm=1
345 -Duse_system_zlib=1"
346
347 # Optional dependencies.
348 # TODO: linux_link_kerberos, bug #381289.
349 myconf+="
350 $(gyp_use cups use_cups)
351 $(gyp_use gnome use_gconf)
352 $(gyp_use gnome-keyring use_gnome_keyring)
353 $(gyp_use gnome-keyring linux_link_gnome_keyring)
354 $(gyp_use kerberos use_kerberos)
355 $(gyp_use pulseaudio use_pulseaudio)"
356
357 # Enable sandbox.
358 myconf+="
359 -Dlinux_sandbox_path=${CHROMIUM_HOME}/chrome_sandbox
360 -Dlinux_sandbox_chrome_path=${CHROMIUM_HOME}/chrome"
361
362 # if host-is-pax; then
363 # # Prevent the build from failing (bug #301880). The performance
364 # # difference is very small.
365 # myconf+=" -Dv8_use_snapshot=0"
366 # fi
367
368 # Our system ffmpeg should support more codecs than the bundled one
369 # for Chromium.
370 # myconf+=" -Dproprietary_codecs=1"
371
372 if ! use bindist; then
373 # Enable H.624 support in bundled ffmpeg.
374 myconf+=" -Dproprietary_codecs=1 -Dffmpeg_branding=Chrome"
375 fi
376
377 local myarch="$(tc-arch)"
378 if [[ $myarch = amd64 ]] ; then
379 myconf+=" -Dtarget_arch=x64"
380 elif [[ $myarch = x86 ]] ; then
381 myconf+=" -Dtarget_arch=ia32"
382 elif [[ $myarch = arm ]] ; then
383 # TODO: check this again after
384 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39509 is fixed.
385 append-flags -fno-tree-sink
386
387 myconf+=" -Dtarget_arch=arm -Ddisable_nacl=1 -Dlinux_use_tcmalloc=0"
388 else
389 die "Failed to determine target arch, got '$myarch'."
390 fi
391
392 # Make sure that -Werror doesn't get added to CFLAGS by the build system.
393 # Depending on GCC version the warnings are different and we don't want
394 # the build to fail because of that.
395 myconf+=" -Dwerror="
396
397 # Avoid CFLAGS problems, bug #352457, bug #390147.
398 if ! use custom-cflags; then
399 replace-flags "-Os" "-O2"
400 strip-flags
401 fi
402
403 egyp ${myconf} || die
404 }
405
406 src_compile() {
407 emake chrome chrome_sandbox chromedriver BUILDTYPE=Release V=1 || die
408 pax-mark m out/Release/chrome
409 if use test; then
410 emake {base,cacheinvalidation,crypto,googleurl,gpu,media,net,printing}_unittests BUILDTYPE=Release V=1 || die
411 pax-mark m out/Release/{base,cacheinvalidation,crypto,googleurl,gpu,media,net,printing}_unittests
412 fi
413 }
414
415 src_test() {
416 # For more info see bug #350349.
417 local mylocale='en_US.utf8'
418 if ! locale -a | grep -q "$mylocale"; then
419 eerror "${PN} requires ${mylocale} locale for tests"
420 eerror "Please read the following guides for more information:"
421 eerror " http://www.gentoo.org/doc/en/guide-localization.xml"
422 eerror " http://www.gentoo.org/doc/en/utf-8.xml"
423 die "locale ${mylocale} is not supported"
424 fi
425
426 # For more info see bug #370957.
427 if [[ $UID -eq 0 ]]; then
428 die "Tests must be run as non-root. Please use FEATURES=userpriv."
429 fi
430
431 # ICUStringConversionsTest: bug #350347.
432 # MessagePumpLibeventTest: bug #398501.
433 LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/base_unittests virtualmake \
434 '--gtest_filter=-ICUStringConversionsTest.*:MessagePumpLibeventTest.*'
435
436 LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/cacheinvalidation_unittests virtualmake
437 LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/crypto_unittests virtualmake
438 LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/googleurl_unittests virtualmake
439 LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/gpu_unittests virtualmake
440 LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/media_unittests virtualmake
441
442 # NetUtilTest: bug #361885.
443 # DnsConfigServiceTest.GetSystemConfig: bug #394883.
444 LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/net_unittests virtualmake \
445 '--gtest_filter=-NetUtilTest.IDNToUnicode*:NetUtilTest.FormatUrl*:DnsConfigServiceTest.GetSystemConfig'
446
447 LC_ALL="${mylocale}" VIRTUALX_COMMAND=out/Release/printing_unittests virtualmake
448 }
449
450 src_install() {
451 exeinto "${CHROMIUM_HOME}"
452 doexe out/Release/chrome || die
453 doexe out/Release/chrome_sandbox || die
454 fperms 4755 "${CHROMIUM_HOME}/chrome_sandbox"
455
456 doexe out/Release/chromedriver || die
457
458 # Install Native Client files on platforms that support it.
459 insinto "${CHROMIUM_HOME}"
460 case "$(tc-arch)" in
461 amd64)
462 doexe out/Release/nacl_helper{,_bootstrap} || die
463 doins out/Release/nacl_irt_x86_64.nexe || die
464 doins out/Release/libppGoogleNaClPluginChrome.so || die
465 ;;
466 x86)
467 doexe out/Release/nacl_helper{,_bootstrap} || die
468 doins out/Release/nacl_irt_x86_32.nexe || die
469 doins out/Release/libppGoogleNaClPluginChrome.so || die
470 ;;
471 esac
472
473 newexe "${FILESDIR}"/chromium-launcher-r2.sh chromium-launcher.sh || die
474 if [[ "${CHROMIUM_SUFFIX}" != "" ]]; then
475 sed "s:chromium-browser:chromium-browser${CHROMIUM_SUFFIX}:g" \
476 -i "${ED}"/"${CHROMIUM_HOME}"/chromium-launcher.sh || die
477 sed "s:chromium.desktop:chromium${CHROMIUM_SUFFIX}.desktop:g" \
478 -i "${ED}"/"${CHROMIUM_HOME}"/chromium-launcher.sh || die
479 sed "s:plugins:plugins --user-data-dir=\${HOME}/.config/chromium${CHROMIUM_SUFFIX}:" \
480 -i "${ED}"/"${CHROMIUM_HOME}"/chromium-launcher.sh || die
481 fi
482
483 # It is important that we name the target "chromium-browser",
484 # xdg-utils expect it; bug #355517.
485 dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium-browser${CHROMIUM_SUFFIX} || die
486 # keep the old symlink around for consistency
487 dosym "${CHROMIUM_HOME}/chromium-launcher.sh" /usr/bin/chromium${CHROMIUM_SUFFIX} || die
488
489 # Allow users to override command-line options, bug #357629.
490 dodir /etc/chromium || die
491 insinto /etc/chromium
492 newins "${FILESDIR}/chromium.default" "default" || die
493
494 # Support LINGUAS, bug #332751.
495 local pak
496 for pak in out/Release/locales/*.pak; do
497 local pakbasename="$(basename ${pak})"
498 local pakname="${pakbasename%.pak}"
499 local langname="${pakname//-/_}"
500
501 # Do not issue warning for en_US locale. This is the fallback
502 # locale so it should always be installed.
503 if [[ "${langname}" == "en_US" ]]; then
504 continue
505 fi
506
507 local found=false
508 local lang
509 for lang in ${LANGS}; do
510 local crlang="$(chromium_lang ${lang})"
511 if [[ "${langname}" == "${crlang}" ]]; then
512 found=true
513 break
514 fi
515 done
516 if ! $found; then
517 ewarn "LINGUAS warning: no ${langname} in LANGS"
518 fi
519 done
520 local lang
521 for lang in ${LANGS}; do
522 local crlang="$(chromium_lang ${lang})"
523 local pakfile="out/Release/locales/${crlang//_/-}.pak"
524 if [ ! -f "${pakfile}" ]; then
525 ewarn "LINGUAS warning: no .pak file for ${lang} (${pakfile} not found)"
526 fi
527 if ! use linguas_${lang}; then
528 rm "${pakfile}" || die
529 fi
530 done
531
532 insinto "${CHROMIUM_HOME}"
533 doins out/Release/chrome.pak || die
534 doins out/Release/resources.pak || die
535
536 doins -r out/Release/locales || die
537 doins -r out/Release/resources || die
538
539 newman out/Release/chrome.1 chromium${CHROMIUM_SUFFIX}.1 || die
540 newman out/Release/chrome.1 chromium-browser${CHROMIUM_SUFFIX}.1 || die
541
542 # Chromium looks for these in its folder
543 # See media_posix.cc and base_paths_linux.cc
544 # dosym /usr/$(get_libdir)/libavcodec.so.52 "${CHROMIUM_HOME}" || die
545 # dosym /usr/$(get_libdir)/libavformat.so.52 "${CHROMIUM_HOME}" || die
546 # dosym /usr/$(get_libdir)/libavutil.so.50 "${CHROMIUM_HOME}" || die
547 doexe out/Release/libffmpegsumo.so || die
548
549 # Install icons and desktop entry.
550 for SIZE in 16 22 24 32 48 64 128 256 ; do
551 insinto /usr/share/icons/hicolor/${SIZE}x${SIZE}/apps
552 newins chrome/app/theme/chromium/product_logo_${SIZE}.png \
553 chromium-browser${CHROMIUM_SUFFIX}.png || die
554 done
555 local mime_types="text/html;text/xml;application/xhtml+xml;"
556 mime_types+="x-scheme-handler/http;x-scheme-handler/https;" # bug #360797
557 make_desktop_entry \
558 chromium-browser${CHROMIUM_SUFFIX} \
559 "Chromium${CHROMIUM_SUFFIX}" \
560 chromium-browser${CHROMIUM_SUFFIX} \
561 "Network;WebBrowser" \
562 "MimeType=${mime_types}\nStartupWMClass=chromium-browser"
563 sed -e "/^Exec/s/$/ %U/" -i "${ED}"/usr/share/applications/*.desktop || die
564
565 # Install GNOME default application entry (bug #303100).
566 if use gnome; then
567 dodir /usr/share/gnome-control-center/default-apps || die
568 insinto /usr/share/gnome-control-center/default-apps
569 newins "${FILESDIR}"/chromium-browser.xml chromium-browser${CHROMIUM_SUFFIX}.xml || die
570 if [[ "${CHROMIUM_SUFFIX}" != "" ]]; then
571 sed "s:chromium-browser:chromium-browser${CHROMIUM_SUFFIX}:g" -i \
572 "${ED}"/usr/share/gnome-control-center/default-apps/chromium-browser${CHROMIUM_SUFFIX}.xml
573 fi
574 fi
575 }
576
577 pkg_preinst() {
578 gnome2_icon_savelist
579 }
580
581 pkg_postinst() {
582 fdo-mime_desktop_database_update
583 gnome2_icon_cache_update
584
585 # For more info see bug #292201, bug #352263, bug #361859.
586 elog
587 elog "Depending on your desktop environment, you may need"
588 elog "to install additional packages to get icons on the Downloads page."
589 elog
590 elog "For KDE, the required package is kde-base/oxygen-icons."
591 elog
592 elog "For other desktop environments, try one of the following:"
593 elog " - x11-themes/gnome-icon-theme"
594 elog " - x11-themes/tango-icon-theme"
595
596 # For more info see bug #359153.
597 elog
598 elog "Some web pages may require additional fonts to display properly."
599 elog "Try installing some of the following packages if some characters"
600 elog "are not displayed properly:"
601 elog " - media-fonts/arphicfonts"
602 elog " - media-fonts/bitstream-cyberbit"
603 elog " - media-fonts/droid"
604 elog " - media-fonts/ipamonafont"
605 elog " - media-fonts/ja-ipafonts"
606 elog " - media-fonts/takao-fonts"
607 elog " - media-fonts/wqy-microhei"
608 elog " - media-fonts/wqy-zenhei"
609 }
610
611 pkg_postrm() {
612 gnome2_icon_cache_update
613 }