1 | # Copyright 1999-2009 Gentoo Foundation |
1 | # Copyright 1999-2009 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/xfconf.eclass,v 1.23 2011/02/10 18:14:53 ssuominen Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/xfconf.eclass,v 1.37 2011/10/15 21:08:59 ssuominen Exp $ |
4 | |
4 | |
5 | # @ECLASS: xfconf.eclass |
5 | # @ECLASS: xfconf.eclass |
6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
7 | # XFCE maintainers <xfce@gentoo.org> |
7 | # XFCE maintainers <xfce@gentoo.org> |
8 | # @BLURB: Default XFCE ebuild layout |
8 | # @BLURB: Default XFCE ebuild layout |
9 | # @DESCRIPTION: |
9 | # @DESCRIPTION: |
10 | # Default XFCE ebuild layout |
10 | # Default XFCE ebuild layout |
11 | |
11 | |
12 | # @ECLASS-VARIABLE: EAUTORECONF |
12 | # @ECLASS-VARIABLE: EAUTORECONF |
13 | # @DESCRIPTION: |
13 | # @DESCRIPTION: |
14 | # Run eautoreconf instead of elibtoolize if set "yes" |
14 | # Run eautoreconf instead of elibtoolize if the variable is set |
15 | |
15 | |
16 | # @ECLASS-VARIABLE: EINTLTOOLIZE |
16 | # @ECLASS-VARIABLE: EINTLTOOLIZE |
17 | # @DESCRIPTION: |
17 | # @DESCRIPTION: |
18 | # Run intltoolize --force --copy --automake if set "yes" |
18 | # Run intltoolize --force --copy --automake if the variable is set |
19 | |
|
|
20 | # @ECLASS-VARIABLE: DOCS |
|
|
21 | # @DESCRIPTION: |
|
|
22 | # Define documentation to install |
|
|
23 | |
|
|
24 | # @ECLASS-VARIABLE: PATCHES |
|
|
25 | # @DESCRIPTION: |
|
|
26 | # Define patches to apply |
|
|
27 | |
19 | |
28 | # @ECLASS-VARIABLE: XFCONF |
20 | # @ECLASS-VARIABLE: XFCONF |
29 | # @DESCRIPTION: |
21 | # @DESCRIPTION: |
30 | # Define options for econf |
22 | # This should be an array defining arguments for econf |
31 | |
23 | |
32 | inherit autotools base eutils fdo-mime gnome2-utils libtool |
24 | unset _xfconf_live |
|
|
25 | [[ $PV == *9999* ]] && _xfconf_live=git-2 |
33 | |
26 | |
34 | if ! [[ ${MY_P} ]]; then |
27 | inherit ${_xfconf_live} autotools base eutils fdo-mime gnome2-utils libtool |
35 | MY_P=${P} |
|
|
36 | else |
|
|
37 | S=${WORKDIR}/${MY_P} |
|
|
38 | fi |
|
|
39 | |
28 | |
40 | SRC_URI="mirror://xfce/xfce/${PV}/src/${MY_P}.tar.bz2" |
29 | EGIT_BOOTSTRAP="autogen.sh" |
|
|
30 | EGIT_REPO_URI="git://git.xfce.org/xfce/${MY_PN:-${PN}}" |
41 | |
31 | |
42 | if [[ "${EINTLTOOLIZE}" == "yes" ]]; then |
32 | _xfconf_deps="" |
43 | _xfce4_intltool="dev-util/intltool" |
33 | _xfconf_m4=">=dev-util/xfce4-dev-tools-4.8.0" |
44 | fi |
|
|
45 | |
34 | |
46 | if [[ "${EAUTORECONF}" == "yes" ]]; then |
35 | [[ -n $_xfconf_live ]] && _xfconf_deps+=" dev-util/gtk-doc ${_xfconf_m4}" |
47 | _xfce4_m4=">=dev-util/xfce4-dev-tools-4.7.0" |
36 | [[ -n $EINTLTOOLIZE ]] && _xfconf_deps+=" dev-util/intltool" |
48 | fi |
37 | [[ -n $EAUTORECONF ]] && _xfconf_deps+=" ${_xfconf_m4}" |
49 | |
38 | |
50 | RDEPEND="" |
39 | RDEPEND="" |
51 | DEPEND="${_xfce4_intltool} |
40 | DEPEND="${_xfconf_deps}" |
52 | ${_xfce4_m4}" |
|
|
53 | |
41 | |
54 | unset _xfce4_intltool |
42 | unset _xfconf_deps |
55 | unset _xfce4_m4 |
43 | unset _xfconf_m4 |
56 | |
44 | |
57 | case ${EAPI:-0} in |
45 | case ${EAPI:-0} in |
58 | 4|3) ;; |
46 | 4) ;; |
59 | *) die "Unknown EAPI." ;; |
47 | *) die "Unknown EAPI." ;; |
60 | esac |
48 | esac |
61 | |
49 | |
|
|
50 | [[ -n $_xfconf_live ]] && _xfconf_live=src_unpack |
|
|
51 | |
62 | EXPORT_FUNCTIONS src_prepare src_configure src_install pkg_preinst pkg_postinst pkg_postrm |
52 | EXPORT_FUNCTIONS ${_xfconf_live} src_prepare src_configure src_install pkg_preinst pkg_postinst pkg_postrm |
63 | |
53 | |
64 | # @FUNCTION: xfconf_use_debug |
54 | # @FUNCTION: xfconf_use_debug |
65 | # @DESCRIPTION: |
55 | # @DESCRIPTION: |
66 | # Return --enable-debug, null, --enable-debug=full or --disable-debug based on |
56 | # If IUSE has debug, return --enable-debug=minimum. |
67 | # XFCONF_FULL_DEBUG variable and USE debug |
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. |
68 | xfconf_use_debug() { |
59 | xfconf_use_debug() { |
69 | if has debug ${IUSE}; then |
60 | if has debug ${IUSE}; then |
70 | if use debug; then |
61 | if use debug; then |
71 | if [[ -n $XFCONF_FULL_DEBUG ]]; then |
62 | if [[ -n $XFCONF_FULL_DEBUG ]]; then |
72 | echo "--enable-debug=full" |
63 | echo "--enable-debug=full" |
73 | else |
64 | else |
74 | echo "--enable-debug" |
65 | echo "--enable-debug" |
75 | fi |
66 | fi |
76 | else |
67 | else |
77 | if [[ -n $XFCONF_FULL_DEBUG ]]; then |
|
|
78 | echo "--disable-debug" |
68 | echo "--enable-debug=minimum" |
79 | fi |
|
|
80 | fi |
69 | fi |
|
|
70 | else |
|
|
71 | ewarn "${FUNCNAME} called without debug in IUSE" |
81 | fi |
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 |
82 | } |
80 | } |
83 | |
81 | |
84 | # @FUNCTION: xfconf_src_prepare |
82 | # @FUNCTION: xfconf_src_prepare |
85 | # @DESCRIPTION: |
83 | # @DESCRIPTION: |
86 | # Run base_src_util autopatch and eautoreconf or elibtoolize |
84 | # Run base_src_prepare and eautoreconf or elibtoolize |
87 | xfconf_src_prepare() { |
85 | xfconf_src_prepare() { |
88 | debug-print-function ${FUNCNAME} "$@" |
86 | debug-print-function ${FUNCNAME} "$@" |
89 | base_src_prepare |
87 | base_src_prepare |
90 | |
88 | |
91 | if [[ "${EINTLTOOLIZE}" == "yes" ]]; then |
89 | if [[ -n $EINTLTOOLIZE ]]; then |
92 | intltoolize --force --copy --automake || die |
90 | local _intltoolize="intltoolize --force --copy --automake" |
|
|
91 | ebegin "Running ${_intltoolize}" |
|
|
92 | ${_intltoolize} || die |
|
|
93 | eend $? |
93 | fi |
94 | fi |
94 | |
95 | |
95 | if [[ "${EAUTORECONF}" == "yes" ]]; then |
96 | if [[ -n $EAUTORECONF ]]; then |
96 | AT_M4DIR="${EPREFIX}/usr/share/xfce4/dev-tools/m4macros" eautoreconf |
97 | AT_M4DIR=${EPREFIX}/usr/share/xfce4/dev-tools/m4macros eautoreconf |
97 | else |
98 | else |
98 | elibtoolize |
99 | elibtoolize |
99 | fi |
100 | fi |
100 | } |
101 | } |
101 | |
102 | |
102 | # @FUNCTION: xfconf_src_configure |
103 | # @FUNCTION: xfconf_src_configure |
103 | # @DESCRIPTION: |
104 | # @DESCRIPTION: |
104 | # Run econf with opts in XFCONF array |
105 | # Run econf with opts from the XFCONF array |
105 | xfconf_src_configure() { |
106 | xfconf_src_configure() { |
106 | debug-print-function ${FUNCNAME} "$@" |
107 | debug-print-function ${FUNCNAME} "$@" |
107 | |
108 | [[ -n $_xfconf_live ]] && XFCONF+=( --enable-maintainer-mode ) |
108 | # Convert XFCONF to an array, see base.eclass for original code |
|
|
109 | if [[ "$(declare -p XFCONF 2>/dev/null 2>&1)" != "declare -a"* ]]; then |
|
|
110 | XFCONF=( ${XFCONF} ) |
|
|
111 | fi |
|
|
112 | |
|
|
113 | econf ${XFCONF[@]} |
109 | econf "${XFCONF[@]}" |
114 | } |
110 | } |
115 | |
111 | |
116 | # @FUNCTION: xfconf_src_install |
112 | # @FUNCTION: xfconf_src_install |
117 | # @DESCRIPTION: |
113 | # @DESCRIPTION: |
118 | # Run emake install and install documentation in DOCS variable |
114 | # Run emake install and install documentation in the DOCS array |
119 | xfconf_src_install() { |
115 | xfconf_src_install() { |
120 | debug-print-function ${FUNCNAME} "$@" |
116 | debug-print-function ${FUNCNAME} "$@" |
121 | emake DESTDIR="${D}" "$@" install || die |
|
|
122 | |
117 | |
123 | if [[ -n ${DOCS} ]]; then |
118 | # FIXME |
124 | dodoc ${DOCS} || die |
119 | if [[ -n $_xfconf_live ]] && ! [[ -e ChangeLog ]]; then |
|
|
120 | touch ChangeLog |
125 | fi |
121 | fi |
|
|
122 | |
|
|
123 | base_src_install "$@" || die |
126 | |
124 | |
127 | find "${ED}" -name '*.la' -exec rm -f {} + |
125 | find "${ED}" -name '*.la' -exec rm -f {} + |
128 | |
126 | |
129 | validate_desktop_entries |
127 | validate_desktop_entries |
130 | } |
128 | } |