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

Contents of /eclass/waf-utils.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download)
Sun Apr 15 20:15:39 2012 UTC (2 years, 2 months ago) by vapier
Branch: MAIN
Changes since 1.7: +2 -2 lines
Use new makeopts_jobs helper from eutils.eclass.

1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/waf-utils.eclass,v 1.7 2011/08/22 04:46:32 vapier Exp $
4
5 # @ECLASS: waf-utils.eclass
6 # @MAINTAINER:
7 # gnome@gentoo.org
8 # @AUTHOR:
9 # Original Author: Gilles Dartiguelongue <eva@gentoo.org>
10 # Various improvements based on cmake-utils.eclass: Tomáš Chvátal <scarabeus@gentoo.org>
11 # Proper prefix support: Jonathan Callen <abcd@gentoo.org>
12 # @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 inherit base eutils multilib toolchain-funcs
19
20 case ${EAPI:-0} in
21 4|3) EXPORT_FUNCTIONS src_configure src_compile src_install ;;
22 *) 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 waf-utils_src_configure() {
29 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
36 tc-export AR CC CPP CXX RANLIB
37 echo "CCFLAGS=\"${CFLAGS}\" LINKFLAGS=\"${LDFLAGS}\" \"${WAF_BINARY}\" --prefix=${EPREFIX}/usr --libdir=${EPREFIX}/usr/$(get_libdir) $@ configure"
38
39 CCFLAGS="${CFLAGS}" LINKFLAGS="${LDFLAGS}" "${WAF_BINARY}" \
40 "--prefix=${EPREFIX}/usr" \
41 "--libdir=${EPREFIX}/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=$(makeopts_jobs)
53 echo "\"${WAF_BINARY}\" build ${jobs}"
54 "${WAF_BINARY}" ${jobs} || die "build failed"
55 }
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
63 echo "\"${WAF_BINARY}\" --destdir=\"${D}\" install"
64 "${WAF_BINARY}" --destdir="${D}" install || die "Make install failed"
65
66 # Manual document installation
67 base_src_install_docs
68 }

  ViewVC Help
Powered by ViewVC 1.1.20