1 |
commit: e38913efbae82f8888a6232162b775f744da2f72 |
2 |
Author: Chris Mayo <aklhfex <AT> gmail <DOT> com> |
3 |
AuthorDate: Tue Mar 24 19:49:57 2020 +0000 |
4 |
Commit: Mikle Kolyada <zlogene <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Apr 1 10:34:10 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e38913ef |
7 |
|
8 |
waf-utils.eclass: Support --docdir and --htmldir |
9 |
|
10 |
waf can optionally set the standard GNU directories [1]. |
11 |
Based on the code for econf in Portage's phase-helpers.sh. |
12 |
|
13 |
[1] https://waf.io/apidocs/tools/gnu_dirs.html |
14 |
|
15 |
Closes: https://bugs.gentoo.org/711612 |
16 |
Signed-off-by: Chris Mayo <aklhfex <AT> gmail.com> |
17 |
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org> |
18 |
|
19 |
eclass/waf-utils.eclass | 14 +++++++++++--- |
20 |
1 file changed, 11 insertions(+), 3 deletions(-) |
21 |
|
22 |
diff --git a/eclass/waf-utils.eclass b/eclass/waf-utils.eclass |
23 |
index 2cb26bc8dfd..a944195b162 100644 |
24 |
--- a/eclass/waf-utils.eclass |
25 |
+++ b/eclass/waf-utils.eclass |
26 |
@@ -69,7 +69,7 @@ waf-utils_src_configure() { |
27 |
|
28 |
[[ ${fail} ]] && die "Invalid use of waf-utils.eclass" |
29 |
|
30 |
- local libdir=() |
31 |
+ local conf_args=() |
32 |
|
33 |
# @ECLASS-VARIABLE: WAF_BINARY |
34 |
# @DESCRIPTION: |
35 |
@@ -81,7 +81,15 @@ waf-utils_src_configure() { |
36 |
# @DESCRIPTION: |
37 |
# Variable specifying that you don't want to set the libdir for waf script. |
38 |
# Some scripts does not allow setting it at all and die if they find it. |
39 |
- [[ -z ${NO_WAF_LIBDIR} ]] && libdir=(--libdir="${EPREFIX}/usr/$(get_libdir)") |
40 |
+ [[ -z ${NO_WAF_LIBDIR} ]] && conf_args+=(--libdir="${EPREFIX}/usr/$(get_libdir)") |
41 |
+ |
42 |
+ local waf_help=$("${WAF_BINARY}" --help 2>/dev/null) |
43 |
+ if [[ ${waf_help} == *--docdir* ]]; then |
44 |
+ conf_args+=( --docdir="${EPREFIX}"/usr/share/doc/${PF} ) |
45 |
+ fi |
46 |
+ if [[ ${waf_help} == *--htmldir* ]]; then |
47 |
+ conf_args+=( --htmldir="${EPREFIX}"/usr/share/doc/${PF}/html ) |
48 |
+ fi |
49 |
|
50 |
tc-export AR CC CPP CXX RANLIB |
51 |
|
52 |
@@ -91,7 +99,7 @@ waf-utils_src_configure() { |
53 |
PKGCONFIG="$(tc-getPKG_CONFIG)" |
54 |
"${WAF_BINARY}" |
55 |
"--prefix=${EPREFIX}/usr" |
56 |
- "${libdir[@]}" |
57 |
+ "${conf_args[@]}" |
58 |
"${@}" |
59 |
configure |
60 |
) |