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
10 # @BLURB: Provides phases for MATE based packages.
12 # Exports portage base functions used by ebuilds written for packages using the
13 # MATE framework. Occassionally acts as a wrapper to gnome2 due to the
14 # fact that MATE is a GNOME fork. For additional functions, see gnome2-utils.eclass.
19 *) die "EAPI=${EAPI:-0} is not supported" ;;
22 # Inherit happens below after declaration of GNOME2_LA_PUNT
24 # @ECLASS-VARIABLE: MATE_LA_PUNT
26 # Available values for MATE_LA_PUNT:
27 # - "no": will not clean any .la files
28 # - "yes": will run prune_libtool_files --modules
29 # - If it is not set, it will run prune_libtool_files
30 # MATE_LA_PUNT is a stub to GNOME2_LA_PUNT
31 GNOME2_LA_PUNT=${MATE_LA_PUNT:-""}
33 inherit gnome2 autotools mate-desktop.org
36 6) EXPORT_FUNCTIONS src_prepare src_configure src_install pkg_preinst pkg_postinst pkg_postrm ;;
37 *) die "EAPI=${EAPI:-0} is not supported" ;;
40 # Autotools requires our MATE m4 files
41 DEPEND=">=mate-base/mate-common-${MATE_BRANCH}"
43 # @FUNCTION: mate_py_cond_func_wrap
45 # Wraps a function for conditional python use, to run for each
46 # python implementation in the build directory.
47 # This function should only be used if the ebuild also inherits the
49 mate_py_cond_func_wrap() {
50 if [[ ! ${_PYTHON_R1} ]]; then
51 die "This function requires the inheritence of the python-r1 eclass"
54 python_foreach_impl run_in_build_dir "$@"
60 # @ECLASS-VARIABLE: MATE_FORCE_AUTORECONF
62 # Available values for MATE_FORCE_AUTORECONF:
63 # - true: will always run eautoreconf
64 # - false: will default to automatic detect
65 # - If it is not set, it will default to false
66 : ${MATE_FORCE_AUTORECONF:="false"}
68 # @FUNCTION: ematedocize
70 # A wrapper around mate-doc-common
72 ebegin "Running mate-doc-common --copy"
73 mate-doc-common --copy || die
77 # @FUNCTION: want_mate_doc
79 # Returns true/false based on whether eautoreconf should call
82 grep -q USE_COMMON_DOC_BUILD autogen.sh
85 # @FUNCTION: mate_src_prepare
87 # Call gnome2_src_prepare to handle environment setup and patching, then
88 # call eautoreconf if necessary
90 debug-print-function ${FUNCNAME} "$@"
92 local force_autoreconf=${MATE_FORCE_AUTORECONF}
93 [[ ${PV} == 9999 ]] && force_autoreconf="true"
96 find '(' -name 'Makefile.am' \
97 -o -name 'configure.ac' \
98 -o -name 'configure.in' ')' \
99 -exec cksum {} + | sort -k2
102 local chksum=$(gen_chksum)
104 gnome2_src_prepare "$@"
106 if [[ "${force_autoreconf}" == "true" ]] || [[ ${chksum} != $(gen_chksum) ]]; then
107 want_mate_doc && ematedocize
108 AT_NOELIBTOOLIZE="yes" eautoreconf # gnome2_src_prepare calls elibtoolize
112 # @FUNCTION: mate_src_configure
114 # MATE specific configure handling
115 # Stub to gnome2_src_configure()
116 mate_src_configure() {
117 gnome2_src_configure "$@"
120 # @FUNCTION: mate_src_install
122 # MATE specific install. Stub to gnome2_src_install
124 gnome2_src_install "$@"
127 # @FUNCTION: mate_pkg_preinst
129 # Finds Icons, GConf and GSettings schemas for later handling in pkg_postinst
130 # Stub to gnome2_pkg_preinst
132 gnome2_pkg_preinst "$@"
135 # @FUNCTION: mate_pkg_postinst
137 # Handle scrollkeeper, GConf, GSettings, Icons, desktop and mime
139 # Stub to gnome2_pkg_postinst
140 mate_pkg_postinst() {
141 gnome2_pkg_postinst "$@"
144 # @FUNCTION: mate_pkg_postrm
146 # Handle scrollkeeper, GSettings, Icons, desktop and mime database updates.
147 # Stub to gnome2_pkg_postrm
149 gnome2_pkg_postrm "$@"