Gentoo Archives: gentoo-dev

From: Angelo Arrifano <miknix@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Announcement of The G Palmtop Environment ebuilds
Date: Sat, 07 Feb 2009 21:04:50
Message-Id: 1234040736.13462.3.camel@localhost
In Reply to: Re: [gentoo-dev] Announcement of The G Palmtop Environment ebuilds by "Petteri Räty"
1 # Copyright 2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4 #
5 # @ECLASS: gpe.eclass
6 # @MAINTAINER: <gpe@g.o>
7 #
8 # Original Authors:
9 # Rene Wagner <rw@×××××××××.org>
10 # Ned Ludd <solar@g.o>
11 # Angelo Arrifano <miknix@g.o>
12 #
13 # @BLURB: Provides common functionality for the G Palmtop Environment.
14 # @DESCRIPTION: Provides common functionality for the G Palmtop Environment.
15 #
16 # Thanks to:
17 # loki_val for EAPI->EAPI2 patch
18 #
19 # Based on:
20 # gnome2.eclass and gpe.bbclass (the latter from OpenEmbedded)
21
22 inherit libtool toolchain-funcs
23
24 case "${EAPI:-0}" in
25 0|1)
26 EXPORT_FUNCTIONS src_unpack src_compile src_install
27 ;;
28 *)
29 EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install
30 ;;
31 esac
32
33 ELTCONF="" # extra options passed to elibtoolize
34 GPE_DOCS="" # documentation files to be installed with dodoc
35
36 [ -z "${GPE_MIRROR}" ] && GPE_MIRROR="http://gpe.linuxtogo.org/download/source"
37 [ -z "${GPE_TARBALL_SUFFIX}" ] && GPE_TARBALL_SUFFIX="gz"
38 SRC_URI="${GPE_MIRROR}/${P}.tar.${GPE_TARBALL_SUFFIX}"
39
40 HOMEPAGE="http://gpe.linuxtogo.org"
41
42 IUSE="nls"
43 GPECONF="${GPECONF} --enable-debug=no --disable-debug"
44
45 RDEPEND=""
46 DEPEND="
47 >=dev-util/intltool-0.29
48 >=dev-util/pkgconfig-0.12.0"
49
50 # @FUNCTION: gpe_src_unpack
51 # @DESCRIPTION: Unpacks and applies some required patches for GPE.
52 gpe_src_unpack() {
53 unpack ${A}
54 cd "${S}"
55 has "${EAPI:-0}" 0 1 && gpe_src_prepare "$@"
56 }
57
58 # Do not call, use gpe_src_unpack() instead.
59 gpe_src_prepare() {
60 # let portage handle stripping.
61 for file in $(find . -name 'Makefile*') ; do
62 sed -i -e s/'install -s'/'install'/g \
63 -e s/'install -Ds'/'install -D'/g \
64 -e 's/$(INSTALL) -s/$(INSTALL) /g' \
65 -e 's;strip ;#strip ;g' \
66 ${file} \
67 ||die "Sedding ${file} failed."
68 done
69 [[ -f configure ]] && elibtoolize
70 }
71
72 # @FUNCTION: gpe_src_configure
73 # @DESCRIPTION: Configures a GPE package in a cross-compile aware environment.
74 gpe_src_configure() {
75 tc-export CC
76 [[ -f configure ]] && econf "$@" ${GPECONF}
77 }
78
79 # @FUNCTION: gpe_src_compile
80 # @DESCRIPTION: (Cross-)Compiles a GPE package.
81 gpe_src_compile() {
82 tc-export CC
83 has "${EAPI:-0}" 0 1 && gpe_src_configure "$@"
84 # miknix: Code belo must NOT die, some packages dont really build anything,
85 # just install.
86 emake PREFIX=/usr
87 }
88
89 # @FUNCTION: gpe_src_install
90 # @DESCRIPTION: Installs a GPE package in the correct way.
91 gpe_src_install() {
92 local use_nls
93
94 use_nls=yes
95 use nls || use_nls=no
96
97 if [ -f configure ]; then
98 einstall "$@" || die "einstall failed"
99 else
100 emake DESTDIR=${D} ENABLE_NLS=${use_nls} \
101 "$@" install || die "emake install failed"
102 fi
103 if [[ "${GPE_DOCS}" ]]; then
104 dodoc ${GPE_DOCS} || die "dodoc failed"
105 fi
106 }
107
108
109 Thanks all for the suggestions/patches
110 --
111 Angelo Arrifano <miknix@g.o>
112 Gentoo Linux ARM/OMAP850 Developer

Replies

Subject Author
Re: [gentoo-dev] Announcement of The G Palmtop Environment ebuilds "Petteri Räty" <betelgeuse@g.o>