1 |
On Qua, 2009-02-04 at 13:56 +0200, Petteri Räty wrote: |
2 |
> Angelo Arrifano wrote: |
3 |
> > |
4 |
> > Since we are maintaining this over half a year now, we think that its |
5 |
> > time to finally starting moving step-by-step the GPE suite into the |
6 |
> > portage tree - starting with the eclass and toplevel categories. |
7 |
> > |
8 |
> |
9 |
> Please start by posting the new eclasses for review then. |
10 |
> |
11 |
> Regards, |
12 |
> Petteri |
13 |
> |
14 |
|
15 |
# Copyright 2008 Gentoo Foundation |
16 |
# Distributed under the terms of the GNU General Public License v2 |
17 |
# $Header: $ |
18 |
# |
19 |
# Authors: |
20 |
# Rene Wagner <rw@×××××××××.org> |
21 |
# Ned Ludd <solar@g.o> |
22 |
# Angelo Arrifano <miknix@g.o> |
23 |
|
24 |
# based on gnome2.eclass and gpe.bbclass (the latter from OpenEmbedded) |
25 |
|
26 |
inherit libtool toolchain-funcs |
27 |
|
28 |
# GPE ECLASS |
29 |
#GPECONF="" # extra configure opts passed to econf |
30 |
ELTCONF="" # extra options passed to elibtoolize |
31 |
DOCS="" # documentation files to be installed with dodoc |
32 |
|
33 |
[ -z "${GPE_MIRROR}" ] && export GPE_MIRROR="http://gpe.linuxtogo.org/download/source" |
34 |
|
35 |
[ -z "${GPE_TARBALL_SUFFIX}" ] && export GPE_TARBALL_SUFFIX="gz" |
36 |
|
37 |
SRC_URI="${GPE_MIRROR}/${PN}-${PV}.tar.${GPE_TARBALL_SUFFIX}" |
38 |
HOMEPAGE="http://gpe.handhelds.org/" |
39 |
|
40 |
IUSE="${IUSE} nls" |
41 |
GPECONF="${GPECONF} --enable-debug=no --disable-debug" |
42 |
|
43 |
RDEPEND="" |
44 |
DEPEND=">=dev-util/intltool-0.29 >=dev-util/pkgconfig-0.12.0" |
45 |
|
46 |
gpe_src_configure() { |
47 |
tc-export CC |
48 |
if [ -f configure ]; then |
49 |
elibtoolize ${ELTCONF} |
50 |
econf "$@" ${GPECONF} || die "./configure failure" |
51 |
fi |
52 |
} |
53 |
|
54 |
gpe_src_compile() { |
55 |
tc-export CC |
56 |
has "${EAPI:-0}" 0 1 && gpe_src_configure "$@" |
57 |
emake PREFIX=/usr || die "compile failure" |
58 |
} |
59 |
|
60 |
gpe_src_install() { |
61 |
USE_NLS=yes |
62 |
use nls || USE_NLS=no |
63 |
|
64 |
if [ -f configure ]; then |
65 |
einstall "$@" |
66 |
else |
67 |
make DESTDIR=${D} PREFIX=/usr \ |
68 |
STRIP=true ENABLE_NLS=${USE_NLS} \ |
69 |
"$@" install |
70 |
fi |
71 |
|
72 |
# manual document installation |
73 |
[ -n "${DOCS}" ] && dodoc ${DOCS} |
74 |
|
75 |
} |
76 |
|
77 |
gpe_src_unpack() { |
78 |
unpack ${A} |
79 |
cd "${S}" |
80 |
# let portage handle stripping. |
81 |
for x in $(find "${S}" -name 'Makefile*') ; do |
82 |
sed -i -e s/'install -s'/'install'/g \ |
83 |
-e s/'install -Ds'/'install -D'/g \ |
84 |
-e 's/$(INSTALL) -s/$(INSTALL) /g' $x |
85 |
done |
86 |
} |
87 |
|
88 |
EXPORT_FUNCTIONS src_compile src_install src_unpack |