1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
4 # @ECLASS: xfconf.eclass
6 # XFCE maintainers <xfce@gentoo.org>
7 # @BLURB: Default XFCE ebuild layout
9 # Default XFCE ebuild layout
11 # @ECLASS-VARIABLE: EAUTORECONF
13 # Run eautoreconf instead of elibtoolize if the variable is set
15 if [[ -n ${EAUTORECONF} ]] ; then
16 AUTOTOOLS_AUTO_DEPEND=yes
18 : ${AUTOTOOLS_AUTO_DEPEND:=no}
21 # @ECLASS-VARIABLE: XFCONF
23 # This should be an array defining arguments for econf
26 [[ $PV == *9999* ]] && _xfconf_live=git-2
28 inherit ${_xfconf_live} autotools eutils gnome2-utils libtool xdg-utils
30 EGIT_BOOTSTRAP=autogen.sh
31 EGIT_REPO_URI="git://git.xfce.org/xfce/${MY_PN:-${PN}}"
34 _xfconf_m4=">=dev-util/xfce4-dev-tools-4.10"
36 [[ -n $_xfconf_live ]] && _xfconf_deps+=" dev-util/gtk-doc ${_xfconf_m4}"
37 [[ -n $EAUTORECONF ]] && _xfconf_deps+=" ${_xfconf_m4}"
40 DEPEND="${_xfconf_deps}"
47 *) die "Unknown EAPI." ;;
50 [[ -n $_xfconf_live ]] && _xfconf_live=src_unpack
52 EXPORT_FUNCTIONS ${_xfconf_live} src_prepare src_configure src_install pkg_preinst pkg_postinst pkg_postrm
54 # @FUNCTION: xfconf_use_debug
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.
60 if has debug ${IUSE}; then
62 if [[ -n $XFCONF_FULL_DEBUG ]]; then
63 echo "--enable-debug=full"
68 echo "--enable-debug=minimum"
71 ewarn "${FUNCNAME} called without debug in IUSE"
75 # @FUNCTION: xfconf_src_unpack
77 # Run git-2_src_unpack if required
79 NOCONFIGURE=1 git-2_src_unpack
82 # @FUNCTION: xfconf_src_prepare
84 # Process PATCHES with epatch and run epatch_user followed by run of
85 # elibtoolize, or eautoreconf if EAUTORECONF is set.
86 xfconf_src_prepare() {
87 debug-print-function ${FUNCNAME} "$@"
89 [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}"
92 if [[ -n $EAUTORECONF ]]; then
93 AT_M4DIR=${EPREFIX}/usr/share/xfce4/dev-tools/m4macros eautoreconf
99 # @FUNCTION: xfconf_src_configure
101 # Run econf with opts from the XFCONF array
102 xfconf_src_configure() {
103 debug-print-function ${FUNCNAME} "$@"
104 [[ -n $_xfconf_live ]] && XFCONF+=( --enable-maintainer-mode )
108 # @FUNCTION: xfconf_src_install
110 # Run emake install to DESTDIR, einstalldocs to process DOCS and
111 # prune_libtool_files --all to always remove libtool files (.la)
112 xfconf_src_install() {
113 debug-print-function ${FUNCNAME} "$@"
116 if [[ -n $_xfconf_live ]] && ! [[ -e ChangeLog ]]; then
120 emake DESTDIR="${D}" "$@" install
124 prune_libtool_files --all
127 # @FUNCTION: xfconf_pkg_preinst
129 # Run gnome2_icon_savelist
130 xfconf_pkg_preinst() {
131 debug-print-function ${FUNCNAME} "$@"
135 # @FUNCTION: xfconf_pkg_postinst
137 # Run xdg_{desktop,mimeinfo}_database_update and gnome2_icon_cache_update
138 xfconf_pkg_postinst() {
139 debug-print-function ${FUNCNAME} "$@"
140 xdg_desktop_database_update
141 xdg_mimeinfo_database_update
142 if [[ -n ${GNOME2_ECLASS_ICONS} ]]; then
143 gnome2_icon_cache_update
147 # @FUNCTION: xfconf_pkg_postrm
149 # Run xdg_{desktop,mimeinfo}_database_update and gnome2_icon_cache_update
150 xfconf_pkg_postrm() {
151 debug-print-function ${FUNCNAME} "$@"
152 xdg_desktop_database_update
153 xdg_mimeinfo_database_update
154 if [[ -n ${GNOME2_ECLASS_ICONS} ]]; then
155 gnome2_icon_cache_update