summaryrefslogtreecommitdiff
blob: e2bf1a11b5e088278b2f806135d7938907ee69ac (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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/enlightenment.eclass,v 1.60 2006/01/07 06:50:16 vapier Exp $
#
# Author: vapier@gentoo.org

inherit eutils

# ECVS_STATE's:
#	release      [default]
#		KEYWORDS arch
#		SRC_URI  $P.tar.gz
#		S        $WORKDIR/$P
#
#	snap         $PV has .200##### datestamp or .### counter
#		KEYWORDS ~arch
#		SRC_URI  $P.tar.bz2
#		S        $WORKDIR/$P
#
#	live         $PV has a 9999 marker
#		KEYWORDS -*
#		SRC_URI  `cvs up`
#		S        $WORKDIR/$ECVS_MODULE
#
# Overrides:
#	KEYWORDS    EKEY_STATE
#	SRC_URI     EURI_STATE
#	S           EURI_STATE

EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst

ECVS_STATE="release"
if [[ ${PV/9999} != ${PV} ]] ; then
	if [[ -z ${ECVS_MODULE} ]] ; then
		ECVS_MODULE=${PN}
		if [[ ${CATEGORY/libs} != ${CATEGORY} ]] ; then
			ECVS_MODULE="e17/libs/${PN}"
		else
			ECVS_MODULE="e17/apps/${PN}"
		fi
	fi
	ECVS_SERVER=${E17_ECVS_SERVER:-${ECVS_SERVER:-cvs.sourceforge.net:/cvsroot/enlightenment}}
	ECVS_STATE="live"
	inherit cvs
elif [[ ${PV/.200[3-9][0-1][0-9][0-3][0-9]/} != ${PV} ]] ; then
	ECVS_STATE="snap"
elif [[ ${PV%%.[0-9][0-9][0-9]} != ${PV} ]] ; then
	ECVS_STATE="snap"
	EURI_STATE="release"
fi

DESCRIPTION="A DR17 production"
HOMEPAGE="http://www.enlightenment.org/"
case ${EURI_STATE:-${ECVS_STATE}} in
	release) SRC_URI="http://enlightenment.freedesktop.org/files/${P}.tar.gz mirror://sourceforge/enlightenment/${P}.tar.gz";;
	snap)    SRC_URI="mirror://gentoo/${P}.tar.bz2";;
	live)    SRC_URI="";;
esac

LICENSE="BSD"
SLOT="0"
case ${EKEY_STATE:-${ECVS_STATE}} in
	release) KEYWORDS="alpha amd64 arm hppa ia64 mips ppc ppc64 sh sparc x86";;
	snap)    KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86";;
	live)    KEYWORDS="-*";;
esac
IUSE="nls doc"

DEPEND="doc? ( app-doc/doxygen )"
RDEPEND="nls? ( sys-devel/gettext )"

case ${EURI_STATE:-${ECVS_STATE}} in
	release) S=${WORKDIR}/${P};;
	snap)    S=${WORKDIR}/${PN};;
	live)    S=${WORKDIR}/${ECVS_MODULE};;
esac

enlightenment_warning_msg() {
	if [[ ${ECVS_STATE} == "snap" ]] ; then
		ewarn "Please do not contact the E team about bugs in Gentoo."
		ewarn "Only contact vapier@gentoo.org via e-mail or bugzilla."
		ewarn "Remember, this stuff is CVS only code so dont cry when"
		ewarn "I break you :)."
	elif [[ ${ECVS_STATE} == "live" ]] ; then
		eerror "This is a LIVE CVS ebuild."
		eerror "That means there are NO promises it will work."
		eerror "If it fails to build, FIX THE CODE YOURSELF"
		eerror "before reporting any issues."
		echo
		einfo "If you have trouble connecting to the sourceforge cvs"
		einfo "server, try exporting using the unofficial mirror:"
		einfo "export E17_ECVS_SERVER=thinktux.net:/root"
	fi
}

enlightenment_die() {
	enlightenment_warning_msg
	die "$@"$'\n'"!!! SEND BUG REPORTS TO vapier@gentoo.org NOT THE E TEAM"
}

enlightenment_pkg_setup() {
	enlightenment_warning_msg
}

# the stupid gettextize script prevents non-interactive mode, so we hax it
gettext_modify() {
	use nls || return 0
	cp $(which gettextize) "${T}"/ || die "could not copy gettextize"
	sed -i \
		-e 's:read dummy < /dev/tty::' \
		"${T}"/gettextize
}

enlightenment_src_unpack() {
	if [[ ${ECVS_STATE} == "live" ]] ; then
		cvs_src_unpack
	else
		unpack ${A}
	fi
	gettext_modify
	[[ -s gendoc ]] && chmod a+rx gendoc
}

enlightenment_src_compile() {
	if [[ ! -e configure ]] ; then
		export WANT_AUTOMAKE=${EAUTOMAKE:-1.8}
		env \
			PATH="${T}:${PATH}" \
			NOCONFIGURE=yes \
			USER=blah \
			./autogen.sh \
			|| enlightenment_die "autogen failed"
		# symlinked files will cause sandbox violation
		for x in config.{guess,sub} ; do
			[[ ! -L ${x} ]] && continue
			rm -f ${x}
			touch ${x}
		done
		if [[ ! -z ${EHACKLIBLTDL} ]] ; then
			cd libltdl
			autoconf || enlightenment_die "autogen in libltdl failed"
			cd ..
		fi
	fi
	epunt_cxx
	econf ${MY_ECONF} || enlightenment_die "econf failed"
	emake || enlightenment_die "emake failed"
	use doc && [[ -x ./gendoc ]] && { ./gendoc || enlightenment_die "gendoc failed" ; }
}

enlightenment_src_install() {
	make install DESTDIR="${D}" || enlightenment_die
	find "${D}" -name CVS -type d -exec rm -rf '{}' \; 2>/dev/null
	dodoc AUTHORS ChangeLog NEWS README TODO ${EDOCS}
	use doc && [[ -d doc ]] && dohtml -r doc/*
}

enlightenment_pkg_postinst() {
	enlightenment_warning_msg
}