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

Contents of /eclass/waf-utils.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Thu Jan 13 18:43:58 2011 UTC (3 years, 9 months ago) by scarabeus
Branch: MAIN
Changes since 1.1: +19 -12 lines
Merge in changes to be similar to cmake-utils.eclass so this eclass can be used for talloc.

1 eva 1.1 # Copyright 1999-2010 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 scarabeus 1.2 # $Header: /var/cvsroot/gentoo-x86/eclass/waf-utils.eclass,v 1.1 2010/12/07 06:48:08 eva 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     inherit base eutils multilib python
20    
21     case ${EAPI:-0} in
22 scarabeus 1.2 4|3|2) EXPORT_FUNCTIONS pkg_setup 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     waf-utils_pkg_setup() {
30 scarabeus 1.2 debug-print-function ${FUNCNAME} "$@"
31    
32 eva 1.1 python_set_active_version 2
33 scarabeus 1.2
34     # @ECLASS-VARIABLE: WAF_BINARY
35     # @DESCRIPTION:
36     # Eclass can use different waf executable. Usually it is located in "${S}/waf".
37     : ${WAF_BINARY:="${S}/waf"}
38 eva 1.1 }
39    
40     # @FUNCTION: waf-utils_src_configure
41     # @DESCRIPTION:
42     # General function for configuring with waf.
43     waf-utils_src_configure() {
44     debug-print-function ${FUNCNAME} "$@"
45    
46 scarabeus 1.2 echo "CCFLAGS=\"${CFLAGS}\" LINKFLAGS=\"${LDFLAGS}\" \"${WAF_BINARY}\" --prefix=/usr --libdir=/usr/$(get_libdir) $@ configure"
47    
48     CCFLAGS="${CFLAGS}" LINKFLAGS="${LDFLAGS}" "${WAF_BINARY}" \
49 eva 1.1 --prefix=/usr \
50     --libdir=/usr/$(get_libdir) \
51     $@ \
52     configure || die "configure failed"
53     }
54    
55     # @FUNCTION: waf-utils_src_compile
56     # @DESCRIPTION:
57     # General function for compiling with waf.
58     waf-utils_src_compile() {
59     debug-print-function ${FUNCNAME} "$@"
60    
61     local jobs=$(echo -j1 ${MAKEOPTS} | sed -r "s/.*(-j\s*|--jobs=)([0-9]+).*/--jobs=\2/" )
62 scarabeus 1.2 echo "\"${WAF_BINARY}\" build ${jobs}"
63     "${WAF_BINARY}" ${jobs} || die "build failed"
64 eva 1.1 }
65    
66     # @FUNCTION: waf-utils_src_install
67     # @DESCRIPTION:
68     # Function for installing the package.
69     waf-utils_src_install() {
70     debug-print-function ${FUNCNAME} "$@"
71 scarabeus 1.2
72 eva 1.1 has ${EAPI:-0} 2 && ! use prefix && ED="${D}"
73 scarabeus 1.2 echo "\"${WAF_BINARY}\" --destdir=\"${ED}\" install"
74     "${WAF_BINARY}" --destdir="${ED}" install || die "Make install failed"
75 eva 1.1
76     # Manual document installation
77 scarabeus 1.2 base_src_install_docs
78 eva 1.1 }

  ViewVC Help
Powered by ViewVC 1.1.20