summaryrefslogtreecommitdiff
blob: 16ab4fe5520555de799ae44343c486bb9ae9961e (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

#
# gnome2-live.eclass
#
# Exports additional functions used by live ebuilds written for GNOME packages
# Always to be imported *AFTER* gnome2.eclass
#
# Author: Nirbheek Chauhan <nirbheek@gentoo.org>
#


inherit autotools gnome2 gnome2-utils libtool git

# Stolen from git.eclass
EXPORTED_FUNCTIONS="src_unpack pkg_postinst"
case "${EAPI:-0}" in
    2|3) EXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS} src_prepare" ;;
    0|1) ;;
    *) die "Unknown EAPI, Bug eclass maintainers." ;;
esac
EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS}

# DEPEND on
# app-text/gnome-doc-utils for gnome-doc-*
# dev-util/gtk-doc for gtkdocize
# dev-util/intltool for intltoolize
# gnome-base/gnome-common for GNOME_COMMON_INIT
DEPEND="${DEPEND}
	gnome-base/gnome-common
	app-text/gnome-doc-utils
	dev-util/gtk-doc
	dev-util/intltool"

# Extra options passed to elibtoolize
ELTCONF=${ELTCONF:-}

# Default module svn path
MODPATH=${MODPATH:-"${PN}"}

# GIT URI for the project
EGIT_REPO_URI="${EGIT_REPO_URI:-"git://git.gnome.org/${MODPATH}"}"

# Unset SRC_URI auto-set by gnome2.eclass
SRC_URI=""

gnome2-live_src_unpack() {
	if test -n "${A}"; then
		unpack ${A}
	fi
	git_src_unpack
	has src_prepare ${EXPORTED_FUNCTIONS} || gnome2-live_src_prepare
}

gnome2-live_src_prepare() {
	# Blame git.eclass
	cd "${S}"
	for i in ${PATCHES}; do
		epatch "${i}"
	done

	if grep -qe 'GTK_DOC' configure.*; then
		gtkdocize
	fi
	if grep -qe 'GNOME_DOC_INIT' configure.*; then
		gnome-doc-common
		gnome-doc-prepare --automake
	fi
	if grep -qe "INTLTOOL" configure.*; then
		intltoolize --force
	fi
	if test -e m4; then
		AT_M4DIR=m4 eautoreconf
	else
		eautoreconf
	fi

	# Disable pyc compiling. Doesn't harm if DNE
	ln -sf $(type -P true) py-compile

	### Keep this in-sync with gnome2.eclass!
	# Prevent scrollkeeper access violations
	gnome2_omf_fix

	# Run libtoolize
	elibtoolize ${ELTCONF}
}

# So that it replaces gnome2_src_unpack in ebuilds that call it
gnome2_src_unpack() {
	gnome2-live_src_unpack
}

# So that it replaces gnome2_src_prepare in ebuilds that call it
gnome2_src_prepare() {
	gnome2-live_src_prepare
}

# Run manually for ebuilds that have a custom pkg_postinst
gnome2-live_pkg_postinst() {
	ewarn "This is a live ebuild, upstream trunks will mostly be UNstable"
	ewarn "Do NOT report bugs about this package to Gentoo"
	ewarn "Report upstream bugs (with patches if possible) instead."
}