* [gentoo-dev] [PATCH 1/2] waf-utils.eclass: Support --docdir and --htmldir
@ 2020-03-05 19:40 Chris Mayo
2020-03-05 19:40 ` [gentoo-dev] [PATCH 2/2] waf-utils.eclass: Replace NO_WAF_LIBDIR with an automatic check Chris Mayo
0 siblings, 1 reply; 2+ messages in thread
From: Chris Mayo @ 2020-03-05 19:40 UTC (permalink / raw
To: gentoo-dev
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>
---
Fixes QA problem with media-video/mpv-0.32.0-r1 reported in the linked bug.
eclass/waf-utils.eclass | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/eclass/waf-utils.eclass b/eclass/waf-utils.eclass
index 2cb26bc8dfd..a944195b162 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
)
--
2.24.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-dev] [PATCH 2/2] waf-utils.eclass: Replace NO_WAF_LIBDIR with an automatic check
2020-03-05 19:40 [gentoo-dev] [PATCH 1/2] waf-utils.eclass: Support --docdir and --htmldir Chris Mayo
@ 2020-03-05 19:40 ` Chris Mayo
0 siblings, 0 replies; 2+ messages in thread
From: Chris Mayo @ 2020-03-05 19:40 UTC (permalink / raw
To: gentoo-dev
Test `waf --help` for --libdir support instead.
Signed-off-by: Chris Mayo <aklhfex@gmail.com>
---
NO_WAF_LIBDIR only used by dev-libs/tut. emerge's OK after this patch.
eclass/waf-utils.eclass | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/eclass/waf-utils.eclass b/eclass/waf-utils.eclass
index a944195b162..7a894f6bbb7 100644
--- a/eclass/waf-utils.eclass
+++ b/eclass/waf-utils.eclass
@@ -69,19 +69,12 @@ waf-utils_src_configure() {
[[ ${fail} ]] && die "Invalid use of waf-utils.eclass"
- local conf_args=()
-
# @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} ]] && conf_args+=(--libdir="${EPREFIX}/usr/$(get_libdir)")
+ local conf_args=()
local waf_help=$("${WAF_BINARY}" --help 2>/dev/null)
if [[ ${waf_help} == *--docdir* ]]; then
@@ -90,6 +83,9 @@ waf-utils_src_configure() {
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
--
2.24.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-03-05 19:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-05 19:40 [gentoo-dev] [PATCH 1/2] waf-utils.eclass: Support --docdir and --htmldir Chris Mayo
2020-03-05 19:40 ` [gentoo-dev] [PATCH 2/2] waf-utils.eclass: Replace NO_WAF_LIBDIR with an automatic check Chris Mayo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox