Gentoo Archives: gentoo-dev

From: Chris Mayo <aklhfex@×××××.com>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] [PATCH 2/2] waf-utils.eclass: Replace NO_WAF_LIBDIR with an automatic check
Date: Thu, 05 Mar 2020 19:41:18
Message-Id: 20200305194056.288660-2-aklhfex@gmail.com
In Reply to: [gentoo-dev] [PATCH 1/2] waf-utils.eclass: Support --docdir and --htmldir by Chris Mayo
1 Test `waf --help` for --libdir support instead.
2
3 Signed-off-by: Chris Mayo <aklhfex@×××××.com>
4 ---
5
6 NO_WAF_LIBDIR only used by dev-libs/tut. emerge's OK after this patch.
7
8
9 eclass/waf-utils.eclass | 12 ++++--------
10 1 file changed, 4 insertions(+), 8 deletions(-)
11
12 diff --git a/eclass/waf-utils.eclass b/eclass/waf-utils.eclass
13 index a944195b162..7a894f6bbb7 100644
14 --- a/eclass/waf-utils.eclass
15 +++ b/eclass/waf-utils.eclass
16 @@ -69,19 +69,12 @@ waf-utils_src_configure() {
17
18 [[ ${fail} ]] && die "Invalid use of waf-utils.eclass"
19
20 - local conf_args=()
21 -
22 # @ECLASS-VARIABLE: WAF_BINARY
23 # @DESCRIPTION:
24 # Eclass can use different waf executable. Usually it is located in "${S}/waf".
25 : ${WAF_BINARY:="${S}/waf"}
26
27 - # @ECLASS-VARIABLE: NO_WAF_LIBDIR
28 - # @DEFAULT_UNSET
29 - # @DESCRIPTION:
30 - # Variable specifying that you don't want to set the libdir for waf script.
31 - # Some scripts does not allow setting it at all and die if they find it.
32 - [[ -z ${NO_WAF_LIBDIR} ]] && conf_args+=(--libdir="${EPREFIX}/usr/$(get_libdir)")
33 + local conf_args=()
34
35 local waf_help=$("${WAF_BINARY}" --help 2>/dev/null)
36 if [[ ${waf_help} == *--docdir* ]]; then
37 @@ -90,6 +83,9 @@ waf-utils_src_configure() {
38 if [[ ${waf_help} == *--htmldir* ]]; then
39 conf_args+=( --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html )
40 fi
41 + if [[ ${waf_help} == *--libdir* ]]; then
42 + conf_args+=( --libdir="${EPREFIX}/usr/$(get_libdir)" )
43 + fi
44
45 tc-export AR CC CPP CXX RANLIB
46
47 --
48 2.24.1