diff options
author | Tomas Chvatal <scarabeus@gentoo.org> | 2011-01-13 18:43:58 +0000 |
---|---|---|
committer | Tomas Chvatal <scarabeus@gentoo.org> | 2011-01-13 18:43:58 +0000 |
commit | 3f48dba2b7abb32fb44cefc0a5a91b80f899f873 (patch) | |
tree | 721dc2118ef3a61133319517c2bf4d1fd3603d60 /eclass/waf-utils.eclass | |
parent | Bump to 0.10.31. Minor fixes in this release. (diff) | |
download | gentoo-2-3f48dba2b7abb32fb44cefc0a5a91b80f899f873.tar.gz gentoo-2-3f48dba2b7abb32fb44cefc0a5a91b80f899f873.tar.bz2 gentoo-2-3f48dba2b7abb32fb44cefc0a5a91b80f899f873.zip |
Merge in changes to be similar to cmake-utils.eclass so this eclass can be used for talloc.
Diffstat (limited to 'eclass/waf-utils.eclass')
-rw-r--r-- | eclass/waf-utils.eclass | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/eclass/waf-utils.eclass b/eclass/waf-utils.eclass index 48ca1d5ce832..46e125a28fa9 100644 --- a/eclass/waf-utils.eclass +++ b/eclass/waf-utils.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/waf-utils.eclass,v 1.1 2010/12/07 06:48:08 eva Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/waf-utils.eclass,v 1.2 2011/01/13 18:43:58 scarabeus Exp $ # @ECLASS: waf-utils.eclass # @MAINTAINER: @@ -8,6 +8,7 @@ # # @CODE # Original Author: Gilles Dartiguelongue <eva@gentoo.org> +# Various improvements based on cmake-utils.eclass: Tomáš Chvátal <scarabeus@gentoo.org> # @CODE # @BLURB: common ebuild functions for waf-based packages # @DESCRIPTION: @@ -18,19 +19,22 @@ inherit base eutils multilib python case ${EAPI:-0} in - 3|2) EXPORT_FUNCTIONS pkg_setup src_configure src_compile src_install ;; + 4|3|2) EXPORT_FUNCTIONS pkg_setup src_configure src_compile src_install ;; *) die "EAPI=${EAPI} is not supported" ;; esac -# @ECLASS-VARIABLE: DOCS -# @DESCRIPTION: -# Documents passed to dodoc command. - # @FUNCTION: waf-utils_src_configure # @DESCRIPTION: # General function for configuring with waf. waf-utils_pkg_setup() { + debug-print-function ${FUNCNAME} "$@" + python_set_active_version 2 + + # @ECLASS-VARIABLE: WAF_BINARY + # @DESCRIPTION: + # Eclass can use different waf executable. Usually it is located in "${S}/waf". + : ${WAF_BINARY:="${S}/waf"} } # @FUNCTION: waf-utils_src_configure @@ -39,7 +43,9 @@ waf-utils_pkg_setup() { waf-utils_src_configure() { debug-print-function ${FUNCNAME} "$@" - CCFLAGS="${CFLAGS}" LINKFLAGS="${LDFLAGS}" "${S}"/waf \ + echo "CCFLAGS=\"${CFLAGS}\" LINKFLAGS=\"${LDFLAGS}\" \"${WAF_BINARY}\" --prefix=/usr --libdir=/usr/$(get_libdir) $@ configure" + + CCFLAGS="${CFLAGS}" LINKFLAGS="${LDFLAGS}" "${WAF_BINARY}" \ --prefix=/usr \ --libdir=/usr/$(get_libdir) \ $@ \ @@ -53,7 +59,8 @@ waf-utils_src_compile() { debug-print-function ${FUNCNAME} "$@" local jobs=$(echo -j1 ${MAKEOPTS} | sed -r "s/.*(-j\s*|--jobs=)([0-9]+).*/--jobs=\2/" ) - "${S}"/waf build ${jobs} || die "build failed" + echo "\"${WAF_BINARY}\" build ${jobs}" + "${WAF_BINARY}" ${jobs} || die "build failed" } # @FUNCTION: waf-utils_src_install @@ -61,11 +68,11 @@ waf-utils_src_compile() { # Function for installing the package. waf-utils_src_install() { debug-print-function ${FUNCNAME} "$@" - has ${EAPI:-0} 2 && ! use prefix && ED="${D}" - "${S}"/waf --destdir="${ED}" install || die "Make install failed" + has ${EAPI:-0} 2 && ! use prefix && ED="${D}" + echo "\"${WAF_BINARY}\" --destdir=\"${ED}\" install" + "${WAF_BINARY}" --destdir="${ED}" install || die "Make install failed" # Manual document installation - [[ -n "${DOCS}" ]] && { dodoc ${DOCS} || die "dodoc failed" ; } + base_src_install_docs } - |