1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
8 # Authors: NP-Hardass <NP-Hardass@gentoo.org> based upon the gnome2
9 # and autotools-utils eclasses
11 # @BLURB: Provides phases for MATE based packages.
13 # Exports portage base functions used by ebuilds written for packages using the
14 # MATE framework. Occassionally acts as a wrapper to gnome2 due to the
15 # fact that MATE is a GNOME fork. For additional functions, see gnome2-utils.eclass.
20 *) die "EAPI=${EAPI:-0} is not supported" ;;
23 # Inherit happens below after declaration of GNOME2_LA_PUNT
25 # @ECLASS-VARIABLE: MATE_LA_PUNT
27 # Available values for MATE_LA_PUNT:
28 # - "no": will not clean any .la files
29 # - "yes": will run prune_libtool_files --modules
30 # - If it is not set, it will run prune_libtool_files
31 # MATE_LA_PUNT is a stub to GNOME2_LA_PUNT
32 GNOME2_LA_PUNT=${MATE_LA_PUNT:-""}
34 inherit gnome2 autotools mate-desktop.org
37 6) EXPORT_FUNCTIONS src_prepare src_configure src_install pkg_preinst pkg_postinst pkg_postrm ;;
38 *) die "EAPI=${EAPI:-0} is not supported" ;;
41 # Autotools requires our MATE m4 files
42 DEPEND=">=mate-base/mate-common-${MATE_BRANCH}"
44 # @FUNCTION: mate_py_cond_func_wrap
46 # Wraps a function for conditional python use, to run for each
47 # python implementation in the build directory.
48 # This function should only be used if the ebuild also inherits the
50 mate_py_cond_func_wrap() {
51 if [[ ! ${_PYTHON_R1} ]]; then
52 die "This function requires the inheritence of the python-r1 eclass"
55 python_foreach_impl run_in_build_dir "$@"
61 # @ECLASS-VARIABLE: MATE_FORCE_AUTORECONF
63 # Available values for MATE_FORCE_AUTORECONF:
64 # - true: will always run eautoreconf
65 # - false: will default to automatic detect
66 # - If it is not set, it will default to false
67 : ${MATE_FORCE_AUTORECONF:="false"}
69 # @FUNCTION: ematedocize
71 # A wrapper around mate-doc-common
73 ebegin "Running mate-doc-common --copy"
74 mate-doc-common --copy || die
78 # @FUNCTION: want_mate_doc
80 # Returns true/false based on whether eautoreconf should call
83 grep -q USE_COMMON_DOC_BUILD autogen.sh
86 # @FUNCTION: mate_src_prepare
88 # Call gnome2_src_prepare to handle environment setup and patching, then
89 # call eautoreconf if necessary
91 debug-print-function ${FUNCNAME} "$@"
93 local force_autoreconf=${MATE_FORCE_AUTORECONF}
94 [[ ${PV} == 9999 ]] && force_autoreconf="true"
97 find '(' -name 'Makefile.am' \
98 -o -name 'configure.ac' \
99 -o -name 'configure.in' ')' \
100 -exec cksum {} + | sort -k2
103 local chksum=$(gen_chksum)
105 gnome2_src_prepare "$@"
107 if [[ "${force_autoreconf}" == "true" ]] || [[ ${chksum} != $(gen_chksum) ]]; then
108 want_mate_doc && ematedocize
109 AT_NOELIBTOOLIZE="yes" eautoreconf # gnome2_src_prepare calls elibtoolize
113 # @FUNCTION: mate_src_configure
115 # MATE specific configure handling
116 # Stub to gnome2_src_configure()
117 mate_src_configure() {
118 gnome2_src_configure "$@"
121 # @FUNCTION: mate_src_install
123 # MATE specific install. Stub to gnome2_src_install
125 gnome2_src_install "$@"
128 # @FUNCTION: mate_pkg_preinst
130 # Finds Icons, GConf and GSettings schemas for later handling in pkg_postinst
131 # Stub to gnome2_pkg_preinst
133 gnome2_pkg_preinst "$@"
136 # @FUNCTION: mate_pkg_postinst
138 # Handle scrollkeeper, GConf, GSettings, Icons, desktop and mime
140 # Stub to gnome2_pkg_postinst
141 mate_pkg_postinst() {
142 gnome2_pkg_postinst "$@"
145 # @FUNCTION: mate_pkg_postrm
147 # Handle scrollkeeper, GSettings, Icons, desktop and mime database updates.
148 # Stub to gnome2_pkg_postrm
150 gnome2_pkg_postrm "$@"