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

Contents of /eclass/gpe.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Fri Jun 5 22:53:46 2009 UTC (5 years, 3 months ago) by miknix
Branch: MAIN
Changes since 1.1: +3 -2 lines
Fix sed messing with Makefile timestamps, see bug #272161 .

1 miknix 1.1 # Copyright 2008 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 miknix 1.2 # $Header: /var/cvsroot/gentoo-x86/eclass/gpe.eclass,v 1.1 2009/02/28 14:07:58 miknix Exp $
4 miknix 1.1 #
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 miknix 1.2 # sort is needed, see #272161 .
70     for file in $(find . -name 'Makefile*' | sort) ; do
71 miknix 1.1 sed -i -e s/'install -s'/'install'/g \
72     -e s/'install -Ds'/'install -D'/g \
73     -e 's/$(INSTALL) -s/$(INSTALL) /g' \
74     -e 's;strip ;#strip ;g' \
75     ${file} \
76     ||die "Sedding ${file} failed."
77     done
78     [[ -f configure ]] && elibtoolize
79     }
80    
81     # @FUNCTION: gpe_src_configure
82     # @DESCRIPTION: Configures a GPE package in a cross-compile aware environment.
83     gpe_src_configure() {
84     tc-export CC
85     [[ -f configure ]] && econf "$@" ${GPECONF}
86     }
87    
88     # @FUNCTION: gpe_src_compile
89     # @DESCRIPTION: (Cross-)Compiles a GPE package.
90     gpe_src_compile() {
91     tc-export CC
92     has "${EAPI:-0}" 0 1 && gpe_src_configure "$@"
93     emake PREFIX=/usr || die "emake failed"
94     }
95    
96     # @FUNCTION: gpe_src_install
97     # @DESCRIPTION: Installs a GPE package in the correct way.
98     gpe_src_install() {
99     local use_nls=yes
100    
101     use nls || use_nls=no
102    
103     if [ -f configure ]; then
104     einstall "$@" || die "einstall failed"
105     else
106     emake STRIP=true DESTDIR=${D} PREFIX=/usr \
107     ENABLE_NLS=${use_nls} "$@" install || die "emake install failed"
108     fi
109    
110     use nls || rm -rf ${D}/usr/share/locale
111    
112     # manual document installation
113     if [[ "${GPE_DOCS}" ]]; then
114     dodoc ${GPE_DOCS} || die "dodoc failed"
115     fi
116     }

  ViewVC Help
Powered by ViewVC 1.1.20