summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorChris Mayo <aklhfex@gmail.com>2020-03-24 19:49:57 +0000
committerMikle Kolyada <zlogene@gentoo.org>2020-04-01 13:34:10 +0300
commite38913efbae82f8888a6232162b775f744da2f72 (patch)
tree23e0fe52618004d4d8d6c047d1e05bab697f040f /eclass
parentdev-lang/mercury: version bump (diff)
downloadgentoo-e38913efbae82f8888a6232162b775f744da2f72.tar.gz
gentoo-e38913efbae82f8888a6232162b775f744da2f72.tar.bz2
gentoo-e38913efbae82f8888a6232162b775f744da2f72.zip
waf-utils.eclass: Support --docdir and --htmldir
waf can optionally set the standard GNU directories [1]. Based on the code for econf in Portage's phase-helpers.sh. [1] https://waf.io/apidocs/tools/gnu_dirs.html Closes: https://bugs.gentoo.org/711612 Signed-off-by: Chris Mayo <aklhfex@gmail.com> Signed-off-by: Mikle Kolyada <zlogene@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/waf-utils.eclass14
1 files changed, 11 insertions, 3 deletions
diff --git a/eclass/waf-utils.eclass b/eclass/waf-utils.eclass
index 2cb26bc8dfd9..a944195b1627 100644
--- a/eclass/waf-utils.eclass
+++ b/eclass/waf-utils.eclass
@@ -69,7 +69,7 @@ waf-utils_src_configure() {
[[ ${fail} ]] && die "Invalid use of waf-utils.eclass"
- local libdir=()
+ local conf_args=()
# @ECLASS-VARIABLE: WAF_BINARY
# @DESCRIPTION:
@@ -81,7 +81,15 @@ waf-utils_src_configure() {
# @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)")
+ [[ -z ${NO_WAF_LIBDIR} ]] && conf_args+=(--libdir="${EPREFIX}/usr/$(get_libdir)")
+
+ 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
tc-export AR CC CPP CXX RANLIB
@@ -91,7 +99,7 @@ waf-utils_src_configure() {
PKGCONFIG="$(tc-getPKG_CONFIG)"
"${WAF_BINARY}"
"--prefix=${EPREFIX}/usr"
- "${libdir[@]}"
+ "${conf_args[@]}"
"${@}"
configure
)