/[gentoo-x86]/eclass/xfconf.eclass
Gentoo

Contents of /eclass/xfconf.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.36 - (show annotations) (download)
Mon Jun 13 18:01:11 2011 UTC (3 years, 6 months ago) by angelos
Branch: MAIN
Changes since 1.35: +33 -23 lines
Implement live functionality

1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/xfconf.eclass,v 1.34 2011/05/19 22:39:07 ssuominen Exp $
4
5 # @ECLASS: xfconf.eclass
6 # @MAINTAINER:
7 # XFCE maintainers <xfce@gentoo.org>
8 # @BLURB: Default XFCE ebuild layout
9 # @DESCRIPTION:
10 # Default XFCE ebuild layout
11
12 # @ECLASS-VARIABLE: EAUTORECONF
13 # @DESCRIPTION:
14 # Run eautoreconf instead of elibtoolize if the variable is set
15
16 # @ECLASS-VARIABLE: EINTLTOOLIZE
17 # @DESCRIPTION:
18 # Run intltoolize --force --copy --automake if the variable is set
19
20 # @ECLASS-VARIABLE: XFCONF
21 # @DESCRIPTION:
22 # This should be an array defining arguments for econf
23
24 unset _xfconf_live
25 [[ $PV == *9999* ]] && _xfconf_live=git-2
26
27 inherit ${_xfconf_live} autotools base eutils fdo-mime gnome2-utils libtool
28
29 EGIT_BOOTSTRAP="autogen.sh"
30 EGIT_REPO_URI="git://git.xfce.org/xfce/${MY_PN:-${PN}}"
31
32 _xfconf_deps=""
33 _xfconf_m4=">=dev-util/xfce4-dev-tools-4.8.0"
34
35 [[ -n $_xfconf_live ]] && _xfconf_deps+=" dev-util/gtk-doc ${_xfconf_m4}"
36 [[ -n $EINTLTOOLIZE ]] && _xfconf_deps+=" dev-util/intltool"
37 [[ -n $EAUTORECONF ]] && _xfconf_deps+=" ${_xfconf_m4}"
38
39 RDEPEND=""
40 DEPEND="${_xfconf_deps}"
41
42 unset _xfconf_deps
43 unset _xfconf_m4
44
45 case ${EAPI:-0} in
46 4|3) ;;
47 *) die "Unknown EAPI." ;;
48 esac
49
50 [[ -n $_xfconf_live ]] && _xfconf_live=src_unpack
51
52 EXPORT_FUNCTIONS ${_xfconf_live} src_prepare src_configure src_install pkg_preinst pkg_postinst pkg_postrm
53
54 # @FUNCTION: xfconf_use_debug
55 # @DESCRIPTION:
56 # If IUSE has debug, return --enable-debug=minimum.
57 # If USE debug is enabled, return --enable-debug which is the same as --enable-debug=yes.
58 # If USE debug is enabled and the XFCONF_FULL_DEBUG variable is set, return --enable-debug=full.
59 xfconf_use_debug() {
60 if has debug ${IUSE}; then
61 if use debug; then
62 if [[ -n $XFCONF_FULL_DEBUG ]]; then
63 echo "--enable-debug=full"
64 else
65 echo "--enable-debug"
66 fi
67 else
68 echo "--enable-debug=minimum"
69 fi
70 else
71 ewarn "${FUNCNAME} called without debug in IUSE"
72 fi
73 }
74
75 # @FUNCTION: xfconf_src_unpack
76 # @DESCRIPTION:
77 # Run git-2_src_unpack if required
78 xfconf_src_unpack() {
79 NOCONFIGURE=1 git-2_src_unpack
80 }
81
82 # @FUNCTION: xfconf_src_prepare
83 # @DESCRIPTION:
84 # Run base_src_prepare and eautoreconf or elibtoolize
85 xfconf_src_prepare() {
86 debug-print-function ${FUNCNAME} "$@"
87 base_src_prepare
88
89 if [[ -n $EINTLTOOLIZE ]]; then
90 local _intltoolize="intltoolize --force --copy --automake"
91 ebegin "Running ${_intltoolize}"
92 ${_intltoolize} || die
93 eend $?
94 fi
95
96 if [[ -n $EAUTORECONF ]]; then
97 AT_M4DIR=${EPREFIX}/usr/share/xfce4/dev-tools/m4macros eautoreconf
98 else
99 elibtoolize
100 fi
101 }
102
103 # @FUNCTION: xfconf_src_configure
104 # @DESCRIPTION:
105 # Run econf with opts from the XFCONF array
106 xfconf_src_configure() {
107 debug-print-function ${FUNCNAME} "$@"
108 [[ -n $_xfconf_live ]] && XFCONF+=( --enable-maintainer-mode )
109 econf "${XFCONF[@]}"
110 }
111
112 # @FUNCTION: xfconf_src_install
113 # @DESCRIPTION:
114 # Run emake install and install documentation in the DOCS array
115 xfconf_src_install() {
116 debug-print-function ${FUNCNAME} "$@"
117
118 # FIXME
119 if [[ -n $_xfconf_live ]] && ! [[ -e ChangeLog ]]; then
120 touch ChangeLog
121 fi
122
123 base_src_install "$@" || die
124
125 find "${ED}" -name '*.la' -exec rm -f {} +
126
127 validate_desktop_entries
128 }
129
130 # @FUNCTION: xfconf_pkg_preinst
131 # @DESCRIPTION:
132 # Run gnome2_icon_savelist
133 xfconf_pkg_preinst() {
134 debug-print-function ${FUNCNAME} "$@"
135 gnome2_icon_savelist
136 }
137
138 # @FUNCTION: xfconf_pkg_postinst
139 # @DESCRIPTION:
140 # Run fdo-mime_{desktop,mime}_database_update and gnome2_icon_cache_update
141 xfconf_pkg_postinst() {
142 debug-print-function ${FUNCNAME} "$@"
143 fdo-mime_desktop_database_update
144 fdo-mime_mime_database_update
145 gnome2_icon_cache_update
146 }
147
148 # @FUNCTION: xfconf_pkg_postrm
149 # @DESCRIPTION:
150 # Run fdo-mime_{desktop,mime}_database_update and gnome2_icon_cache_update
151 xfconf_pkg_postrm() {
152 debug-print-function ${FUNCNAME} "$@"
153 fdo-mime_desktop_database_update
154 fdo-mime_mime_database_update
155 gnome2_icon_cache_update
156 }

  ViewVC Help
Powered by ViewVC 1.1.20