/[gentoo-x86]/eclass/enlightenment.eclass
Gentoo

Diff of /eclass/enlightenment.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.64 Revision 1.87
1# Copyright 1999-2006 Gentoo Foundation 1# Copyright 1999-2010 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/enlightenment.eclass,v 1.64 2006/04/21 00:59:05 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/enlightenment.eclass,v 1.87 2010/09/18 08:38:08 vapier Exp $
4# 4
5# Author: vapier@gentoo.org 5# @ECLASS: enlightenment.eclass
6# @MAINTAINER:
7# enlightenment@gentoo.org
8# @BLURB: simplify enlightenment package management
6 9
7inherit eutils libtool 10inherit eutils libtool
8 11
12# @ECLASS-VARIABLE: E_PYTHON
13# @DEFAULT_UNSET
14# @DESCRIPTION:
15# if defined, the package is based on Python/distutils
16
17# @ECLASS-VARIABLE: E_CYTHON
18# @DEFAULT_UNSET
19# @DESCRIPTION:
20# if defined, the package is Cython bindings (implies E_PYTHON)
21
9# ECVS_STATE's: 22# E_STATE's:
10# release [default] 23# release [default]
11# KEYWORDS arch 24# KEYWORDS arch
12# SRC_URI $P.tar.gz 25# SRC_URI $P.tar.gz
13# S $WORKDIR/$P 26# S $WORKDIR/$P
14# 27#
16# KEYWORDS ~arch 29# KEYWORDS ~arch
17# SRC_URI $P.tar.bz2 30# SRC_URI $P.tar.bz2
18# S $WORKDIR/$P 31# S $WORKDIR/$P
19# 32#
20# live $PV has a 9999 marker 33# live $PV has a 9999 marker
21# KEYWORDS -* 34# KEYWORDS ""
22# SRC_URI `cvs up` 35# SRC_URI cvs/svn/etc... up
23# S $WORKDIR/$ECVS_MODULE 36# S $WORKDIR/$E_S_APPEND
24# 37#
25# Overrides: 38# Overrides:
26# KEYWORDS EKEY_STATE 39# KEYWORDS EKEY_STATE
27# SRC_URI EURI_STATE 40# SRC_URI EURI_STATE
28# S EURI_STATE 41# S EURI_STATE
29 42
30EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst 43#E_LIVE_DEFAULT_CVS="cvs.sourceforge.net:/cvsroot/enlightenment"
44E_LIVE_SERVER_DEFAULT_CVS="anoncvs.enlightenment.org:/var/cvs/e"
45E_LIVE_SERVER_DEFAULT_SVN="http://svn.enlightenment.org/svn/e/trunk"
31 46
32#E17_DEFAULT_CVS="cvs.sourceforge.net:/cvsroot/enlightenment" 47E_STATE="release"
33E17_DEFAULT_CVS="anoncvs.enlightenment.org:/var/cvs/e" 48if [[ ${PV/9999} != ${PV} ]] ; then
49 E_LIVE_SERVER=${E_LIVE_SERVER:-${E_LIVE_SERVER_DEFAULT_SVN}}
50 E_STATE="live"
51 WANT_AUTOTOOLS="yes"
34 52
35ECVS_STATE="release" 53 # force people to opt-in to legacy cvs
36if [[ ${PV/9999} != ${PV} ]] ; then
37 if [[ -z ${ECVS_MODULE} ]] ; then 54 if [[ -n ${ECVS_MODULE} ]] ; then
38 ECVS_MODULE=${PN} 55 ECVS_SERVER=${ECVS_SERVER:-${E_LIVE_SERVER_DEFAULT_CVS}}
39 if [[ ${CATEGORY/libs} != ${CATEGORY} ]] ; then 56 E_LIVE_SOURCE="cvs"
40 ECVS_MODULE="e17/libs/${PN}" 57 E_S_APPEND=${ECVS_MODULE}
58 inherit cvs
41 else 59 else
42 ECVS_MODULE="e17/apps/${PN}" 60 ESVN_URI_APPEND=${ESVN_URI_APPEND:-${PN}}
43 fi 61 ESVN_PROJECT="enlightenment/${ESVN_SUB_PROJECT}"
62 ESVN_REPO_URI=${ESVN_SERVER:-${E_LIVE_SERVER_DEFAULT_SVN}}/${ESVN_SUB_PROJECT}/${ESVN_URI_APPEND}
63 E_S_APPEND=${ESVN_URI_APPEND}
64 E_LIVE_SOURCE="svn"
65 inherit subversion
44 fi 66 fi
45 ECVS_SERVER=${E17_ECVS_SERVER:-${ECVS_SERVER:-${E17_DEFAULT_CVS}}} 67elif [[ -n ${E_SNAP_DATE} ]] ; then
46 ECVS_STATE="live"
47 inherit cvs
48elif [[ ${PV/.200[3-9][0-1][0-9][0-3][0-9]/} != ${PV} ]] ; then
49 ECVS_STATE="snap" 68 E_STATE="snap"
50elif [[ ${PV%%.[0-9][0-9][0-9]} != ${PV} ]] ; then 69else
51 ECVS_STATE="snap"
52 EURI_STATE="release" 70 E_STATE="release"
53fi 71fi
72
73# Parse requested python state
74: ${E_PYTHON:=${E_CYTHON}}
75if [[ -n ${E_PYTHON} ]] ; then
76 PYTHON_DEPEND="2:2.4"
77
78 inherit python
79fi
80
81if [[ ${WANT_AUTOTOOLS} == "yes" ]] ; then
82 WANT_AUTOCONF=${E_WANT_AUTOCONF:-latest}
83 WANT_AUTOMAKE=${E_WANT_AUTOMAKE:-latest}
84 inherit autotools
85fi
86
87ENLIGHTENMENT_EXPF="src_unpack src_compile src_install"
88case "${EAPI:-0}" in
89 2|3|4) ENLIGHTENMENT_EXPF+=" src_prepare src_configure" ;;
90 *) ;;
91esac
92EXPORT_FUNCTIONS ${ENLIGHTENMENT_EXPF}
54 93
55DESCRIPTION="A DR17 production" 94DESCRIPTION="A DR17 production"
56HOMEPAGE="http://www.enlightenment.org/" 95HOMEPAGE="http://www.enlightenment.org/"
57case ${EURI_STATE:-${ECVS_STATE}} in 96case ${EURI_STATE:-${E_STATE}} in
58 release) SRC_URI="http://enlightenment.freedesktop.org/files/${P}.tar.gz mirror://sourceforge/enlightenment/${P}.tar.gz";; 97 release) SRC_URI="mirror://sourceforge/enlightenment/${P}.tar.gz";;
59 snap) SRC_URI="mirror://gentoo/${P}.tar.bz2";; 98 snap) SRC_URI="http://download.enlightenment.org/snapshots/${E_SNAP_DATE}/${P}.tar.bz2";;
60 live) SRC_URI="";; 99 live) SRC_URI="";;
61esac 100esac
62 101
63LICENSE="BSD" 102LICENSE="BSD"
64SLOT="0" 103SLOT="0"
65case ${EKEY_STATE:-${ECVS_STATE}} in 104case ${EKEY_STATE:-${E_STATE}} in
66 release) KEYWORDS="alpha amd64 arm hppa ia64 mips ppc ppc64 sh sparc x86";; 105 release) KEYWORDS="alpha amd64 arm hppa ia64 mips ppc ppc64 sh sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x86-interix ~x86-solaris ~x64-solaris";;
67 snap) KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86";; 106 snap) KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x86-interix ~x86-solaris ~x64-solaris";;
68 live) KEYWORDS="-*";; 107 live) KEYWORDS="";;
69esac 108esac
70IUSE="nls doc" 109IUSE="nls doc"
71 110
72DEPEND="doc? ( app-doc/doxygen )" 111DEPEND="doc? ( app-doc/doxygen )"
73RDEPEND="nls? ( sys-devel/gettext )" 112RDEPEND="nls? ( sys-devel/gettext )"
113[[ -n ${E_PYTHON} ]] && DEPEND+=" >=dev-python/setuptools-0.6_rc9"
114[[ -n ${E_CYTHON} ]] && DEPEND+=" >=dev-python/cython-0.12.1"
74 115
75case ${EURI_STATE:-${ECVS_STATE}} in 116case ${EURI_STATE:-${E_STATE}} in
76 release) S=${WORKDIR}/${P};; 117 release) S=${WORKDIR}/${P};;
77 snap) S=${WORKDIR}/${PN};; 118 snap) S=${WORKDIR}/${P};;
78 live) S=${WORKDIR}/${ECVS_MODULE};; 119 live) S=${WORKDIR}/${E_S_APPEND};;
79esac 120esac
80 121
81enlightenment_warning_msg() { 122enlightenment_src_unpack() {
82 if [[ ${ECVS_STATE} == "snap" ]] ; then
83 ewarn "Please do not contact the E team about bugs in Gentoo."
84 ewarn "Only contact vapier@gentoo.org via e-mail or bugzilla."
85 ewarn "Remember, this stuff is CVS only code so dont cry when"
86 ewarn "I break you :)."
87 elif [[ ${ECVS_STATE} == "live" ]] ; then 123 if [[ ${E_STATE} == "live" ]] ; then
88 eerror "This is a LIVE CVS ebuild." 124 case ${E_LIVE_SOURCE} in
89 eerror "That means there are NO promises it will work." 125 cvs) cvs_src_unpack;;
90 eerror "If it fails to build, FIX THE CODE YOURSELF" 126 svn) subversion_src_unpack;;
91 eerror "before reporting any issues." 127 *) die "eek!";;
128 esac
129 else
130 unpack ${A}
131 fi
132 hasq src_prepare ${ENLIGHTENMENT_EXPF} || enlightenment_src_prepare
133}
134
135enlightenment_src_prepare() {
136 [[ -s gendoc ]] && chmod a+rx gendoc
137 if [[ ${WANT_AUTOTOOLS} == "yes" ]] ; then
138 [[ -d po ]] && eautopoint -f
139 # autotools require README, when README.in is around, but README
140 # is created later in configure step
141 [[ -f README.in ]] && touch README
142 export SVN_REPO_PATH=${ESVN_WC_PATH}
143 eautoreconf
144 fi
145 epunt_cxx
146 elibtoolize
147}
148
149enlightenment_src_configure() {
150 # gstreamer sucks, work around it doing stupid stuff
151 export GST_REGISTRY="${S}/registry.xml"
152 has static-libs ${IUSE} && MY_ECONF+=" $(use_enable static-libs static)"
153
154 econf ${MY_ECONF}
155}
156
157enlightenment_src_compile() {
158 hasq src_configure ${ENLIGHTENMENT_EXPF} || enlightenment_src_configure
159
160 emake || die
161
162 if use doc ; then
163 if [[ -x ./gendoc ]] ; then
164 ./gendoc || die
165 else
166 emake doc || die
167 fi
92 fi 168 fi
93} 169}
94 170
95enlightenment_die() { 171enlightenment_src_install() {
96 enlightenment_warning_msg 172 emake install DESTDIR="${D}" || die
97 die "$@"$'\n'"!!! SEND BUG REPORTS TO vapier@gentoo.org NOT THE E TEAM" 173 find "${D}" '(' -name CVS -o -name .svn -o -name .git ')' -type d -exec rm -rf '{}' \; 2>/dev/null
174 for d in AUTHORS ChangeLog NEWS README TODO ${EDOCS}; do
175 [[ -f ${d} ]] && dodoc ${d}
176 done
177 use doc && [[ -d doc ]] && dohtml -r doc/*
178 if has static-libs ${IUSE} ; then
179 use static-libs || find "${D}" -name '*.la' -exec rm -f {} +
180 fi
98} 181}
99
100enlightenment_pkg_setup() {
101 enlightenment_warning_msg
102}
103
104# the stupid gettextize script prevents non-interactive mode, so we hax it
105gettext_modify() {
106 use nls || return 0
107 cp $(which gettextize) "${T}"/ || die "could not copy gettextize"
108 sed -i \
109 -e 's:read dummy < /dev/tty::' \
110 "${T}"/gettextize
111}
112
113enlightenment_src_unpack() {
114 if [[ ${ECVS_STATE} == "live" ]] ; then
115 cvs_src_unpack
116 else
117 unpack ${A}
118 fi
119 gettext_modify
120 [[ -s gendoc ]] && chmod a+rx gendoc
121}
122
123enlightenment_src_compile() {
124 # gstreamer sucks, work around it doing stupid stuff
125 export GST_REGISTRY="${S}/registry.xml"
126
127 if [[ ! -e configure ]] ; then
128 export WANT_AUTOMAKE=${EAUTOMAKE:-1.8}
129 env \
130 PATH="${T}:${PATH}" \
131 NOCONFIGURE=yes \
132 USER=blah \
133 ./autogen.sh \
134 || enlightenment_die "autogen failed"
135 # symlinked files will cause sandbox violation
136 for x in config.{guess,sub} ; do
137 [[ ! -L ${x} ]] && continue
138 rm -f ${x}
139 touch ${x}
140 done
141 if [[ ! -z ${EHACKLIBLTDL} ]] ; then
142 cd libltdl
143 autoconf || enlightenment_die "autogen in libltdl failed"
144 cd ..
145 fi
146 fi
147 epunt_cxx
148 elibtoolize
149 econf ${MY_ECONF} || enlightenment_die "econf failed"
150 emake || enlightenment_die "emake failed"
151 use doc && [[ -x ./gendoc ]] && { ./gendoc || enlightenment_die "gendoc failed" ; }
152}
153
154enlightenment_src_install() {
155 make install DESTDIR="${D}" || enlightenment_die
156 find "${D}" -name CVS -type d -exec rm -rf '{}' \; 2>/dev/null
157 dodoc AUTHORS ChangeLog NEWS README TODO ${EDOCS}
158 use doc && [[ -d doc ]] && dohtml -r doc/*
159}
160
161enlightenment_pkg_postinst() {
162 enlightenment_warning_msg
163}

Legend:
Removed from v.1.64  
changed lines
  Added in v.1.87

  ViewVC Help
Powered by ViewVC 1.1.20