1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
10 # Rene Wagner <rw@handhelds.org>
11 # Ned Ludd <solar@gentoo.org>
12 # Angelo Arrifano <miknix@gentoo.org>
13 # EAPI->EAPI2 patch: loki_val
14 # multiple suggestions: Betelgeuse
15 # Based on gnome2.eclass and gpe.bbclass (the latter from OpenEmbedded)
16 # @BLURB: Provides common functionality for the G Palmtop Environment.
18 inherit libtool toolchain-funcs
22 EXPORT_FUNCTIONS src_unpack src_compile src_install
25 EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install
29 # @ECLASS-VARIABLE: ELTCONF
31 # Extra options passed to elibtoolize on gnome2 eclass.
34 # @ECLASS-VARIABLE: GPE_DOCS
36 # Documentation files to be installed with dodoc.
39 [[ -z "${GPE_MIRROR}" ]] && GPE_MIRROR="http://gpe.linuxtogo.org/download/source"
40 [[ -z "${GPE_TARBALL_SUFFIX}" ]] && GPE_TARBALL_SUFFIX="gz"
41 SRC_URI="${GPE_MIRROR}/${P}.tar.${GPE_TARBALL_SUFFIX}"
43 HOMEPAGE="http://gpe.linuxtogo.org"
46 GPECONF="${GPECONF} --enable-debug=no --disable-debug"
50 >=dev-util/intltool-0.29
53 # @FUNCTION: gpe_src_unpack
55 # Unpacks and applies some required patches for GPE.
59 has "${EAPI:-0}" 0 1 && gpe_src_prepare "$@"
62 # Do not call, use gpe_src_unpack() instead.
64 # let portage handle stripping.
65 # sort is needed, see #272161 .
66 for file in $(find . -name 'Makefile*' | sort) ; do
67 sed -i -e s/'install -s'/'install'/g \
68 -e s/'install -Ds'/'install -D'/g \
69 -e 's/$(INSTALL) -s/$(INSTALL) /g' \
70 -e 's;strip ;#strip ;g' \
72 ||die "Sedding ${file} failed."
74 [[ -f configure ]] && elibtoolize
77 # @FUNCTION: gpe_src_configure
79 # Configures a GPE package in a cross-compile aware environment.
82 [[ -f configure ]] && econf "$@" ${GPECONF}
85 # @FUNCTION: gpe_src_compile
87 # (Cross-)Compiles a GPE package.
90 has "${EAPI:-0}" 0 1 && gpe_src_configure "$@"
91 emake PREFIX=/usr || die "emake failed"
94 # @FUNCTION: gpe_src_install
96 # Installs a GPE package in the correct way.
100 use nls || use_nls=no
102 if [ -f configure ]; then
103 einstall "$@" || die "einstall failed"
105 emake STRIP=true DESTDIR=${D} PREFIX=/usr \
106 ENABLE_NLS=${use_nls} "$@" install || die "emake install failed"
109 use nls || rm -rf ${D}/usr/share/locale
111 # manual document installation
112 if [[ "${GPE_DOCS}" ]]; then
113 dodoc ${GPE_DOCS} || die "dodoc failed"