/[gentoo-x86]/eclass/waf-utils.eclass
Gentoo

Contents of /eclass/waf-utils.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations) (download)
Mon Jan 24 14:04:39 2011 UTC (3 years, 6 months ago) by scarabeus
Branch: MAIN
Changes since 1.3: +3 -15 lines
Drop pkg_setup phase since operations done inside of that phase were supposed to be done in the src_configure.

1 eva 1.1 # Copyright 1999-2010 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 scarabeus 1.4 # $Header: /var/cvsroot/gentoo-x86/eclass/waf-utils.eclass,v 1.3 2011/01/16 08:36:35 scarabeus Exp $
4 eva 1.1
5     # @ECLASS: waf-utils.eclass
6     # @MAINTAINER:
7     # gnome@gentoo.org
8     #
9     # @CODE
10     # Original Author: Gilles Dartiguelongue <eva@gentoo.org>
11 scarabeus 1.2 # Various improvements based on cmake-utils.eclass: Tomáš Chvátal <scarabeus@gentoo.org>
12 eva 1.1 # @CODE
13     # @BLURB: common ebuild functions for waf-based packages
14     # @DESCRIPTION:
15     # The waf-utils eclass contains functions that make creating ebuild for
16     # waf-based packages much easier.
17     # Its main features are support of common portage default settings.
18    
19 scarabeus 1.3 inherit base eutils multilib
20 eva 1.1
21     case ${EAPI:-0} in
22 scarabeus 1.4 4|3) EXPORT_FUNCTIONS src_configure src_compile src_install ;;
23 eva 1.1 *) die "EAPI=${EAPI} is not supported" ;;
24     esac
25    
26     # @FUNCTION: waf-utils_src_configure
27     # @DESCRIPTION:
28     # General function for configuring with waf.
29 scarabeus 1.4 waf-utils_src_configure() {
30 scarabeus 1.2 debug-print-function ${FUNCNAME} "$@"
31    
32     # @ECLASS-VARIABLE: WAF_BINARY
33     # @DESCRIPTION:
34     # Eclass can use different waf executable. Usually it is located in "${S}/waf".
35     : ${WAF_BINARY:="${S}/waf"}
36 scarabeus 1.3
37 scarabeus 1.2 echo "CCFLAGS=\"${CFLAGS}\" LINKFLAGS=\"${LDFLAGS}\" \"${WAF_BINARY}\" --prefix=/usr --libdir=/usr/$(get_libdir) $@ configure"
38    
39     CCFLAGS="${CFLAGS}" LINKFLAGS="${LDFLAGS}" "${WAF_BINARY}" \
40 eva 1.1 --prefix=/usr \
41     --libdir=/usr/$(get_libdir) \
42     $@ \
43     configure || die "configure failed"
44     }
45    
46     # @FUNCTION: waf-utils_src_compile
47     # @DESCRIPTION:
48     # General function for compiling with waf.
49     waf-utils_src_compile() {
50     debug-print-function ${FUNCNAME} "$@"
51    
52     local jobs=$(echo -j1 ${MAKEOPTS} | sed -r "s/.*(-j\s*|--jobs=)([0-9]+).*/--jobs=\2/" )
53 scarabeus 1.2 echo "\"${WAF_BINARY}\" build ${jobs}"
54     "${WAF_BINARY}" ${jobs} || die "build failed"
55 eva 1.1 }
56    
57     # @FUNCTION: waf-utils_src_install
58     # @DESCRIPTION:
59     # Function for installing the package.
60     waf-utils_src_install() {
61     debug-print-function ${FUNCNAME} "$@"
62 scarabeus 1.2
63     echo "\"${WAF_BINARY}\" --destdir=\"${ED}\" install"
64     "${WAF_BINARY}" --destdir="${ED}" install || die "Make install failed"
65 eva 1.1
66     # Manual document installation
67 scarabeus 1.2 base_src_install_docs
68 eva 1.1 }

  ViewVC Help
Powered by ViewVC 1.1.20