1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 # @ECLASS: xfconf.eclass
7 # XFCE maintainers <xfce@gentoo.org>
8 # @BLURB: Default XFCE ebuild layout
10 # Default XFCE ebuild layout
12 # @ECLASS-VARIABLE: EAUTORECONF
14 # Run eautoreconf instead of elibtoolize if the variable is set
16 if [[ -n ${EAUTORECONF} ]] ; then
17 AUTOTOOLS_AUTO_DEPEND=yes
19 : ${AUTOTOOLS_AUTO_DEPEND:=no}
22 # @ECLASS-VARIABLE: XFCONF
24 # This should be an array defining arguments for econf
27 [[ $PV == *9999* ]] && _xfconf_live=git-2
29 inherit ${_xfconf_live} autotools eutils fdo-mime gnome2-utils libtool
31 EGIT_BOOTSTRAP=autogen.sh
32 EGIT_REPO_URI="git://git.xfce.org/xfce/${MY_PN:-${PN}}"
35 _xfconf_m4=">=dev-util/xfce4-dev-tools-4.10"
37 [[ -n $_xfconf_live ]] && _xfconf_deps+=" dev-util/gtk-doc ${_xfconf_m4}"
38 [[ -n $EAUTORECONF ]] && _xfconf_deps+=" ${_xfconf_m4}"
41 DEPEND="${_xfconf_deps}"
48 *) die "Unknown EAPI." ;;
51 [[ -n $_xfconf_live ]] && _xfconf_live=src_unpack
53 EXPORT_FUNCTIONS ${_xfconf_live} src_prepare src_configure src_install pkg_preinst pkg_postinst pkg_postrm
55 # @FUNCTION: xfconf_use_debug
57 # If IUSE has debug, return --enable-debug=minimum.
58 # If USE debug is enabled, return --enable-debug which is the same as --enable-debug=yes.
59 # If USE debug is enabled and the XFCONF_FULL_DEBUG variable is set, return --enable-debug=full.
61 if has debug ${IUSE}; then
63 if [[ -n $XFCONF_FULL_DEBUG ]]; then
64 echo "--enable-debug=full"
69 echo "--enable-debug=minimum"
72 ewarn "${FUNCNAME} called without debug in IUSE"
76 # @FUNCTION: xfconf_src_unpack
78 # Run git-2_src_unpack if required
80 NOCONFIGURE=1 git-2_src_unpack
83 # @FUNCTION: xfconf_src_prepare
85 # Process PATCHES with epatch and run epatch_user followed by run of
86 # elibtoolize, or eautoreconf if EAUTORECONF is set.
87 xfconf_src_prepare() {
88 debug-print-function ${FUNCNAME} "$@"
90 [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}"
93 if [[ -n $EAUTORECONF ]]; then
94 AT_M4DIR=${EPREFIX}/usr/share/xfce4/dev-tools/m4macros eautoreconf
100 # @FUNCTION: xfconf_src_configure
102 # Run econf with opts from the XFCONF array
103 xfconf_src_configure() {
104 debug-print-function ${FUNCNAME} "$@"
105 [[ -n $_xfconf_live ]] && XFCONF+=( --enable-maintainer-mode )
109 # @FUNCTION: xfconf_src_install
111 # Run emake install to DESTDIR, einstalldocs to process DOCS and
112 # prune_libtool_files --all to always remove libtool files (.la)
113 xfconf_src_install() {
114 debug-print-function ${FUNCNAME} "$@"
117 if [[ -n $_xfconf_live ]] && ! [[ -e ChangeLog ]]; then
121 emake DESTDIR="${D}" "$@" install
125 prune_libtool_files --all
128 # @FUNCTION: xfconf_pkg_preinst
130 # Run gnome2_icon_savelist
131 xfconf_pkg_preinst() {
132 debug-print-function ${FUNCNAME} "$@"
136 # @FUNCTION: xfconf_pkg_postinst
138 # Run fdo-mime_{desktop,mime}_database_update and gnome2_icon_cache_update
139 xfconf_pkg_postinst() {
140 debug-print-function ${FUNCNAME} "$@"
141 fdo-mime_desktop_database_update
142 fdo-mime_mime_database_update
143 gnome2_icon_cache_update
146 # @FUNCTION: xfconf_pkg_postrm
148 # Run fdo-mime_{desktop,mime}_database_update and gnome2_icon_cache_update
149 xfconf_pkg_postrm() {
150 debug-print-function ${FUNCNAME} "$@"
151 fdo-mime_desktop_database_update
152 fdo-mime_mime_database_update
153 gnome2_icon_cache_update