From 819912c974dbe76814ee83d6c24f124aa0ef7699 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Thu, 18 Feb 2021 16:45:37 +0100 Subject: [PATCH] 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. --- .../portage-stable/eclass/waf-utils.eclass | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/sdk_container/src/third_party/portage-stable/eclass/waf-utils.eclass b/sdk_container/src/third_party/portage-stable/eclass/waf-utils.eclass index 2cb26bc8df..f22460881e 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/waf-utils.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/waf-utils.eclass @@ -8,7 +8,7 @@ # Original Author: Gilles Dartiguelongue # Various improvements based on cmake-utils.eclass: Tomáš Chvátal # Proper prefix support: Jonathan Callen -# @SUPPORTED_EAPIS: 4 5 6 +# @SUPPORTED_EAPIS: 4 5 6 7 # @BLURB: common ebuild functions for waf-based packages # @DESCRIPTION: # The waf-utils eclass contains functions that make creating ebuild for @@ -19,7 +19,7 @@ inherit multilib toolchain-funcs multiprocessing 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" ;; esac @@ -69,19 +69,23 @@ waf-utils_src_configure() { [[ ${fail} ]] && die "Invalid use of waf-utils.eclass" - local libdir=() - # @ECLASS-VARIABLE: WAF_BINARY # @DESCRIPTION: # Eclass can use different waf executable. Usually it is located in "${S}/waf". : ${WAF_BINARY:="${S}/waf"} - # @ECLASS-VARIABLE: NO_WAF_LIBDIR - # @DEFAULT_UNSET - # @DESCRIPTION: - # Variable specifying that you don't want to set the libdir for waf script. - # Some scripts does not allow setting it at all and die if they find it. - [[ -z ${NO_WAF_LIBDIR} ]] && libdir=(--libdir="${EPREFIX}/usr/$(get_libdir)") + local conf_args=() + + local waf_help=$("${WAF_BINARY}" --help 2>/dev/null) + if [[ ${waf_help} == *--docdir* ]]; then + conf_args+=( --docdir="${EPREFIX}"/usr/share/doc/${PF} ) + 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 @@ -91,7 +95,7 @@ waf-utils_src_configure() { PKGCONFIG="$(tc-getPKG_CONFIG)" "${WAF_BINARY}" "--prefix=${EPREFIX}/usr" - "${libdir[@]}" + "${conf_args[@]}" "${@}" configure )