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

Contents of /eclass/waf-utils.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (hide annotations) (download)
Mon Aug 22 04:46:32 2011 UTC (3 years, 1 month ago) by vapier
Branch: MAIN
Changes since 1.6: +3 -5 lines
fix random bugs in eclass documentation, and convert to new @AUTHOR tag

1 vapier 1.7 # Copyright 1999-2011 Gentoo Foundation
2 eva 1.1 # Distributed under the terms of the GNU General Public License v2
3 vapier 1.7 # $Header: /var/cvsroot/gentoo-x86/eclass/waf-utils.eclass,v 1.6 2011/08/09 18:53:06 jer Exp $
4 eva 1.1
5     # @ECLASS: waf-utils.eclass
6     # @MAINTAINER:
7     # gnome@gentoo.org
8 vapier 1.7 # @AUTHOR:
9 eva 1.1 # Original Author: Gilles Dartiguelongue <eva@gentoo.org>
10 scarabeus 1.2 # Various improvements based on cmake-utils.eclass: Tomáš Chvátal <scarabeus@gentoo.org>
11 abcd 1.5 # Proper prefix support: Jonathan Callen <abcd@gentoo.org>
12 eva 1.1 # @BLURB: common ebuild functions for waf-based packages
13     # @DESCRIPTION:
14     # The waf-utils eclass contains functions that make creating ebuild for
15     # waf-based packages much easier.
16     # Its main features are support of common portage default settings.
17    
18 jer 1.6 inherit base eutils multilib toolchain-funcs
19 eva 1.1
20     case ${EAPI:-0} in
21 scarabeus 1.4 4|3) EXPORT_FUNCTIONS src_configure src_compile src_install ;;
22 eva 1.1 *) die "EAPI=${EAPI} is not supported" ;;
23     esac
24    
25     # @FUNCTION: waf-utils_src_configure
26     # @DESCRIPTION:
27     # General function for configuring with waf.
28 scarabeus 1.4 waf-utils_src_configure() {
29 scarabeus 1.2 debug-print-function ${FUNCNAME} "$@"
30    
31     # @ECLASS-VARIABLE: WAF_BINARY
32     # @DESCRIPTION:
33     # Eclass can use different waf executable. Usually it is located in "${S}/waf".
34     : ${WAF_BINARY:="${S}/waf"}
35 scarabeus 1.3
36 jer 1.6 tc-export AR CC CPP CXX RANLIB
37 abcd 1.5 echo "CCFLAGS=\"${CFLAGS}\" LINKFLAGS=\"${LDFLAGS}\" \"${WAF_BINARY}\" --prefix=${EPREFIX}/usr --libdir=${EPREFIX}/usr/$(get_libdir) $@ configure"
38 scarabeus 1.2
39     CCFLAGS="${CFLAGS}" LINKFLAGS="${LDFLAGS}" "${WAF_BINARY}" \
40 abcd 1.5 "--prefix=${EPREFIX}/usr" \
41     "--libdir=${EPREFIX}/usr/$(get_libdir)" \
42     "$@" \
43 eva 1.1 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 abcd 1.5 echo "\"${WAF_BINARY}\" --destdir=\"${D}\" install"
64     "${WAF_BINARY}" --destdir="${D}" 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