summaryrefslogtreecommitdiff
path: root/eclass/mate.eclass
blob: 1f4584b80adbfbb638d0f8be38bbf45316f35fca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit autotools eutils libtool gnome2 mate-desktop.org

# FIXME Not all package have proper build system/docs
# Once this is fixed upstream remove DEPEND and move to ebuild.
DEPEND="dev-util/gtk-doc
		dev-util/gtk-doc-am"

# @FUNCTION: mate_gen_build_system
# @DESCRIPTION:
# Generate autotools build system for releases that don't have one.
# We need this as early releases did not have a proper build system.
mate_gen_build_system() {
	einfo "Generating mate build system"
	# Retrieve configure script
		local mate_conf_in
		if [[ -f "${S}/configure.in" ]]; then
			mate_conf_in="${S}/configure.in"
		elif [[ -f "${S}/configure.ac" ]]; then
			mate_conf_in="${S}/configure.ac"
		else
			einfo "no configure.in or configure.ac file were found"
			return 0
		fi
		# Mate preparation, doing similar to autotools eclass stuff. (Do we need die here?)
		if grep -q "^AM_GLIB_GNU_GETTEXT" "${mate_conf_in}"; then
			autotools_run_tool glib-gettextize --copy --force || die
		elif grep -q "^AM_GNU_GETTEXT" "${mate_conf_in}"; then
			eautopoint --force
		fi

		if grep -q "^A[CM]_PROG_LIBTOOL" "${mate_conf_in}" || grep -q "^LT_INIT" "${mate_conf_in}"; then
			_elibtoolize --copy --force --install
		fi


		if grep -q "^AC_PROG_INTLTOOL" "${mate_conf_in}" || grep -q "^IT_PROG_INTLTOOL" "${mate_conf_in}"; then
			mkdir -p "${S}/m4"
			autotools_run_tool intltoolize --automake --copy --force || die
		fi

		if grep -q "^GTK_DOC_CHECK" "${mate_conf_in}"; then
			autotools_run_tool gtkdocize --copy || die
		fi

		if grep -q "^MATE_DOC_INIT" "${mate_conf_in}"; then
			autotools_run_tool mate-doc-prepare --force --copy || die
			autotools_run_tool mate-doc-common --copy || die
		fi

		eaclocal
		eautoconf
		eautoheader
		eautomake
}