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

Contents of /eclass/waf-utils.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (hide annotations) (download)
Tue Aug 9 18:53:06 2011 UTC (3 years, 1 month ago) by jer
Branch: MAIN
Changes since 1.5: +3 -2 lines
Respect toolchain (bug #378529).

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

  ViewVC Help
Powered by ViewVC 1.1.20