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

Contents of /eclass/gpe.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sat Feb 28 14:07:58 2009 UTC (5 years, 7 months ago) by miknix
Branch: MAIN
Initial commit of gpe eclass.
Credits to solar for his collaborative work with me on GPE.

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@gentoo.org>
7 #
8 # Original Authors:
9 # Rene Wagner <rw@handhelds.org>
10 # Ned Ludd <solar@gentoo.org>
11 # Angelo Arrifano <miknix@gentoo.org>
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 # Betelgeuse for multiple suggestions.
19 #
20 # Based on:
21 # gnome2.eclass and gpe.bbclass (the latter from OpenEmbedded)
22
23 inherit libtool toolchain-funcs
24
25 case "${EAPI:-0}" in
26 0|1)
27 EXPORT_FUNCTIONS src_unpack src_compile src_install
28 ;;
29 *)
30 EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install
31 ;;
32 esac
33
34 # @ECLASS-VARIABLE: ELTCONF
35 # @DESCRIPTION:
36 # Extra options passed to elibtoolize on gnome2 eclass.
37 ELTCONF=""
38
39 # @ECLASS-VARIABLE: GPE_DOCS
40 # @DESCRIPTION:
41 # Documentation files to be installed with dodoc.
42 GPE_DOCS=""
43
44 [[ -z "${GPE_MIRROR}" ]] && GPE_MIRROR="http://gpe.linuxtogo.org/download/source"
45 [[ -z "${GPE_TARBALL_SUFFIX}" ]] && GPE_TARBALL_SUFFIX="gz"
46 SRC_URI="${GPE_MIRROR}/${P}.tar.${GPE_TARBALL_SUFFIX}"
47
48 HOMEPAGE="http://gpe.linuxtogo.org"
49
50 IUSE="nls"
51 GPECONF="${GPECONF} --enable-debug=no --disable-debug"
52
53 RDEPEND=""
54 DEPEND="
55 >=dev-util/intltool-0.29
56 >=dev-util/pkgconfig-0.12.0"
57
58 # @FUNCTION: gpe_src_unpack
59 # @DESCRIPTION: Unpacks and applies some required patches for GPE.
60 gpe_src_unpack() {
61 unpack ${A}
62 cd "${S}"
63 has "${EAPI:-0}" 0 1 && gpe_src_prepare "$@"
64 }
65
66 # Do not call, use gpe_src_unpack() instead.
67 gpe_src_prepare() {
68 # let portage handle stripping.
69 for file in $(find . -name 'Makefile*') ; do
70 sed -i -e s/'install -s'/'install'/g \
71 -e s/'install -Ds'/'install -D'/g \
72 -e 's/$(INSTALL) -s/$(INSTALL) /g' \
73 -e 's;strip ;#strip ;g' \
74 ${file} \
75 ||die "Sedding ${file} failed."
76 done
77 [[ -f configure ]] && elibtoolize
78 }
79
80 # @FUNCTION: gpe_src_configure
81 # @DESCRIPTION: Configures a GPE package in a cross-compile aware environment.
82 gpe_src_configure() {
83 tc-export CC
84 [[ -f configure ]] && econf "$@" ${GPECONF}
85 }
86
87 # @FUNCTION: gpe_src_compile
88 # @DESCRIPTION: (Cross-)Compiles a GPE package.
89 gpe_src_compile() {
90 tc-export CC
91 has "${EAPI:-0}" 0 1 && gpe_src_configure "$@"
92 emake PREFIX=/usr || die "emake failed"
93 }
94
95 # @FUNCTION: gpe_src_install
96 # @DESCRIPTION: Installs a GPE package in the correct way.
97 gpe_src_install() {
98 local use_nls=yes
99
100 use nls || use_nls=no
101
102 if [ -f configure ]; then
103 einstall "$@" || die "einstall failed"
104 else
105 emake STRIP=true DESTDIR=${D} PREFIX=/usr \
106 ENABLE_NLS=${use_nls} "$@" install || die "emake install failed"
107 fi
108
109 use nls || rm -rf ${D}/usr/share/locale
110
111 # manual document installation
112 if [[ "${GPE_DOCS}" ]]; then
113 dodoc ${GPE_DOCS} || die "dodoc failed"
114 fi
115 }

  ViewVC Help
Powered by ViewVC 1.1.20