summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Chvatal <scarabeus@gentoo.org>2011-01-13 18:43:58 +0000
committerTomas Chvatal <scarabeus@gentoo.org>2011-01-13 18:43:58 +0000
commitd50166295aabd71d1142bc5621cb32002ac2561f (patch)
tree14bafb9c1bf2858d63e6eea58b7660851a70993c /eclass/waf-utils.eclass
parentBump to 0.10.31. Minor fixes in this release. (diff)
downloadhistorical-d50166295aabd71d1142bc5621cb32002ac2561f.tar.gz
historical-d50166295aabd71d1142bc5621cb32002ac2561f.tar.bz2
historical-d50166295aabd71d1142bc5621cb32002ac2561f.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.eclass31
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
}
-