/[gentoo-x86]/eclass/gnome2-utils.eclass
Gentoo

Diff of /eclass/gnome2-utils.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.31 Revision 1.32
1# Copyright 1999-2012 Gentoo Foundation 1# Copyright 1999-2013 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/gnome2-utils.eclass,v 1.31 2012/10/27 22:24:10 tetromino Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/gnome2-utils.eclass,v 1.32 2013/09/03 21:54:38 eva Exp $
4 4
5# @ECLASS: gnome2-utils.eclass 5# @ECLASS: gnome2-utils.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# gnome@gentoo.org 7# gnome@gentoo.org
8# @BLURB: Auxiliary functions commonly used by Gnome packages. 8# @BLURB: Auxiliary functions commonly used by Gnome packages.
13# * Gtk+ icon cache management 13# * Gtk+ icon cache management
14# * GSettings schemas management 14# * GSettings schemas management
15# * GConf schemas management 15# * GConf schemas management
16# * scrollkeeper (old Gnome help system) management 16# * scrollkeeper (old Gnome help system) management
17 17
18inherit multilib
19
18case "${EAPI:-0}" in 20case "${EAPI:-0}" in
19 0|1|2|3|4|5) ;; 21 0|1|2|3|4|5) ;;
20 *) die "EAPI=${EAPI} is not supported" ;; 22 *) die "EAPI=${EAPI} is not supported" ;;
21esac 23esac
22 24
48# @INTERNAL 50# @INTERNAL
49# @DESCRIPTION: 51# @DESCRIPTION:
50# Path to glib-compile-schemas 52# Path to glib-compile-schemas
51: ${GLIB_COMPILE_SCHEMAS:="/usr/bin/glib-compile-schemas"} 53: ${GLIB_COMPILE_SCHEMAS:="/usr/bin/glib-compile-schemas"}
52 54
55# @ECLASS-VARIABLE: GDK_PIXBUF_UPDATE_BIN
56# @INTERNAL
57# @DESCRIPTION:
58# Path to gdk-pixbuf-query-loaders
59: ${GDK_PIXBUF_UPDATE_BIN:="/usr/bin/gdk-pixbuf-query-loaders"}
60
53# @ECLASS-VARIABLE: GNOME2_ECLASS_SCHEMAS 61# @ECLASS-VARIABLE: GNOME2_ECLASS_SCHEMAS
54# @INTERNAL 62# @INTERNAL
55# @DEFAULT_UNSET 63# @DEFAULT_UNSET
56# @DESCRIPTION: 64# @DESCRIPTION:
57# List of GConf schemas provided by the package 65# List of GConf schemas provided by the package
71# @ECLASS-VARIABLE: GNOME2_ECLASS_GLIB_SCHEMAS 79# @ECLASS-VARIABLE: GNOME2_ECLASS_GLIB_SCHEMAS
72# @INTERNAL 80# @INTERNAL
73# @DEFAULT_UNSET 81# @DEFAULT_UNSET
74# @DESCRIPTION: 82# @DESCRIPTION:
75# List of GSettings schemas provided by the package 83# List of GSettings schemas provided by the package
84
85# @ECLASS-VARIABLE: GNOME2_ECLASS_GDK_PIXBUF_LOADERS
86# @INTERNAL
87# @DEFAULT_UNSET
88# @DESCRIPTION:
89# List of gdk-pixbuf loaders provided by the package
76 90
77DEPEND=">=sys-apps/sed-4" 91DEPEND=">=sys-apps/sed-4"
78 92
79 93
80# @FUNCTION: gnome2_environment_reset 94# @FUNCTION: gnome2_environment_reset
385 ebegin "Updating GSettings schemas" 399 ebegin "Updating GSettings schemas"
386 ${updater} --allow-any-name "$@" "${EROOT%/}/usr/share/glib-2.0/schemas" &>/dev/null 400 ${updater} --allow-any-name "$@" "${EROOT%/}/usr/share/glib-2.0/schemas" &>/dev/null
387 eend $? 401 eend $?
388} 402}
389 403
404# @FUNCTION: gnome2_gdk_pixbuf_savelist
405# @DESCRIPTION:
406# Find if there is any gdk-pixbuf loader to install and save the list in
407# GNOME2_ECLASS_GDK_PIXBUF_LOADERS variable.
408# This function should be called from pkg_preinst.
409gnome2_gdk_pixbuf_savelist() {
410 has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
411 pushd "${ED}" 1>/dev/null
412 export GNOME2_ECLASS_GDK_PIXBUF_LOADERS=$(find "usr/$(get_libdir)/gdk-pixbuf-2.0" -type f 2>/dev/null)
413 popd 1>/dev/null
414}
415
416# @FUNCTION: gnome2_gdk_pixbuf_update
417# @USAGE: gnome2_gdk_pixbuf_update
418# @DESCRIPTION:
419# Updates gdk-pixbuf loader cache if GNOME2_ECLASS_GDK_PIXBUF_LOADERS has some.
420# This function should be called from pkg_postinst and pkg_postrm.
421gnome2_gdk_pixbuf_update() {
422 has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
423 local updater="${EROOT}${GDK_PIXBUF_UPDATE_BIN}"
424
425 if [[ ! -x ${updater} ]]; then
426 debug-print "${updater} is not executable"
427 return
428 fi
429
430 if [[ -z ${GNOME2_ECLASS_GDK_PIXBUF_LOADERS} ]]; then
431 debug-print "gdk-pixbuf loader cache does not need an update"
432 return
433 fi
434
435 ebegin "Updating gdk-pixbuf loader cache"
436 local tmp_file=$(mktemp -t tmp.XXXXXXXXXX_gdkpixbuf)
437 ${updater} 1> "${tmp_file}" &&
438 chmod 0644 "${tmp_file}" &&
439 mv -f "${tmp_file}" "${EROOT}usr/$(get_libdir)/gdk-pixbuf-2.0/2.10.0/loaders.cache"
440 eend $?
441}
442
443
390# @FUNCTION: gnome2_query_immodules_gtk2 444# @FUNCTION: gnome2_query_immodules_gtk2
391# @USAGE: gnome2_query_immodules_gtk2 445# @USAGE: gnome2_query_immodules_gtk2
392# @DESCRIPTION: 446# @DESCRIPTION:
393# Updates gtk2 immodules/gdk-pixbuf loaders listing. 447# Updates gtk2 immodules/gdk-pixbuf loaders listing.
394gnome2_query_immodules_gtk2() { 448gnome2_query_immodules_gtk2() {

Legend:
Removed from v.1.31  
changed lines
  Added in v.1.32

  ViewVC Help
Powered by ViewVC 1.1.20