eclass: update waf-utils.eclass

To be able to use EAPI=7 in net-fs/samba, we need to sync waf-utils
with upstream Gentoo.
This commit is contained in:
Dongsu Park 2021-02-18 16:45:37 +01:00
parent 194ad24a04
commit 819912c974

View File

@ -8,7 +8,7 @@
# Original Author: Gilles Dartiguelongue <eva@gentoo.org> # Original Author: Gilles Dartiguelongue <eva@gentoo.org>
# Various improvements based on cmake-utils.eclass: Tomáš Chvátal <scarabeus@gentoo.org> # Various improvements based on cmake-utils.eclass: Tomáš Chvátal <scarabeus@gentoo.org>
# Proper prefix support: Jonathan Callen <jcallen@gentoo.org> # Proper prefix support: Jonathan Callen <jcallen@gentoo.org>
# @SUPPORTED_EAPIS: 4 5 6 # @SUPPORTED_EAPIS: 4 5 6 7
# @BLURB: common ebuild functions for waf-based packages # @BLURB: common ebuild functions for waf-based packages
# @DESCRIPTION: # @DESCRIPTION:
# The waf-utils eclass contains functions that make creating ebuild for # The waf-utils eclass contains functions that make creating ebuild for
@ -19,7 +19,7 @@
inherit multilib toolchain-funcs multiprocessing inherit multilib toolchain-funcs multiprocessing
case ${EAPI:-0} in case ${EAPI:-0} in
4|5|6) EXPORT_FUNCTIONS src_configure src_compile src_install ;; 4|5|6|7) EXPORT_FUNCTIONS src_configure src_compile src_install ;;
*) die "EAPI=${EAPI} is not supported" ;; *) die "EAPI=${EAPI} is not supported" ;;
esac esac
@ -69,19 +69,23 @@ waf-utils_src_configure() {
[[ ${fail} ]] && die "Invalid use of waf-utils.eclass" [[ ${fail} ]] && die "Invalid use of waf-utils.eclass"
local libdir=()
# @ECLASS-VARIABLE: WAF_BINARY # @ECLASS-VARIABLE: WAF_BINARY
# @DESCRIPTION: # @DESCRIPTION:
# Eclass can use different waf executable. Usually it is located in "${S}/waf". # Eclass can use different waf executable. Usually it is located in "${S}/waf".
: ${WAF_BINARY:="${S}/waf"} : ${WAF_BINARY:="${S}/waf"}
# @ECLASS-VARIABLE: NO_WAF_LIBDIR local conf_args=()
# @DEFAULT_UNSET
# @DESCRIPTION: local waf_help=$("${WAF_BINARY}" --help 2>/dev/null)
# Variable specifying that you don't want to set the libdir for waf script. if [[ ${waf_help} == *--docdir* ]]; then
# Some scripts does not allow setting it at all and die if they find it. conf_args+=( --docdir="${EPREFIX}"/usr/share/doc/${PF} )
[[ -z ${NO_WAF_LIBDIR} ]] && libdir=(--libdir="${EPREFIX}/usr/$(get_libdir)") fi
if [[ ${waf_help} == *--htmldir* ]]; then
conf_args+=( --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html )
fi
if [[ ${waf_help} == *--libdir* ]]; then
conf_args+=( --libdir="${EPREFIX}/usr/$(get_libdir)" )
fi
tc-export AR CC CPP CXX RANLIB tc-export AR CC CPP CXX RANLIB
@ -91,7 +95,7 @@ waf-utils_src_configure() {
PKGCONFIG="$(tc-getPKG_CONFIG)" PKGCONFIG="$(tc-getPKG_CONFIG)"
"${WAF_BINARY}" "${WAF_BINARY}"
"--prefix=${EPREFIX}/usr" "--prefix=${EPREFIX}/usr"
"${libdir[@]}" "${conf_args[@]}"
"${@}" "${@}"
configure configure
) )