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

Contents of /eclass/waf-utils.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.12 - (show annotations) (download)
Tue Jul 17 04:43:50 2012 UTC (21 months, 1 week ago) by vapier
Branch: MAIN
Changes since 1.11: +7 -3 lines
detect if waf supports --libdir as some versions (like glmark2) do not #412133

1 # Copyright 1999-2012 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.11 2012/06/07 05:02:33 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 multiprocessing
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 # Python with threads is required to run waf. We do not know which python slot
26 # is being used as the system interpreter, so we are forced to block all
27 # slots that have USE=-threads.
28 DEPEND="${DEPEND}
29 dev-lang/python
30 !dev-lang/python[-threads]"
31
32 # @FUNCTION: waf-utils_src_configure
33 # @DESCRIPTION:
34 # General function for configuring with waf.
35 waf-utils_src_configure() {
36 debug-print-function ${FUNCNAME} "$@"
37
38 # @ECLASS-VARIABLE: WAF_BINARY
39 # @DESCRIPTION:
40 # Eclass can use different waf executable. Usually it is located in "${S}/waf".
41 : ${WAF_BINARY:="${S}/waf"}
42
43 tc-export AR CC CPP CXX RANLIB
44
45 # Make sure this waf supports --libdir #412133
46 if "${WAF_BINARY}" --help | grep -q -e--libdir ; then
47 set -- "--libdir=${EPREFIX}/usr/$(get_libdir)" "$@"
48 fi
49 echo "CCFLAGS=\"${CFLAGS}\" LINKFLAGS=\"${LDFLAGS}\" \"${WAF_BINARY}\" --prefix=${EPREFIX}/usr $@ configure"
50
51 CCFLAGS="${CFLAGS}" LINKFLAGS="${LDFLAGS}" "${WAF_BINARY}" \
52 "--prefix=${EPREFIX}/usr" \
53 "$@" \
54 configure || die "configure failed"
55 }
56
57 # @FUNCTION: waf-utils_src_compile
58 # @DESCRIPTION:
59 # General function for compiling with waf.
60 waf-utils_src_compile() {
61 debug-print-function ${FUNCNAME} "$@"
62
63 local jobs="--jobs=$(makeopts_jobs)"
64 echo "\"${WAF_BINARY}\" build ${jobs}"
65 "${WAF_BINARY}" ${jobs} || die "build failed"
66 }
67
68 # @FUNCTION: waf-utils_src_install
69 # @DESCRIPTION:
70 # Function for installing the package.
71 waf-utils_src_install() {
72 debug-print-function ${FUNCNAME} "$@"
73
74 echo "\"${WAF_BINARY}\" --destdir=\"${D}\" install"
75 "${WAF_BINARY}" --destdir="${D}" install || die "Make install failed"
76
77 # Manual document installation
78 base_src_install_docs
79 }

  ViewVC Help
Powered by ViewVC 1.1.20