1 |
As EAPI 2 support is intended, this requires configuring the build |
2 |
system to install docs into a temporary location and moving files from |
3 |
it. Due to the lack of 'dodoc -r', directories inside docdir are |
4 |
supported only with EAPI 4. |
5 |
|
6 |
Fixes: https://bugs.gentoo.org/show_bug.cgi?id=350423 |
7 |
--- |
8 |
eclass/autotools-utils.eclass | 24 +++++++++++++++++++++++- |
9 |
1 files changed, 23 insertions(+), 1 deletions(-) |
10 |
|
11 |
diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass |
12 |
index 9a13a3a..fcdf219 100644 |
13 |
--- a/eclass/autotools-utils.eclass |
14 |
+++ b/eclass/autotools-utils.eclass |
15 |
@@ -392,8 +392,12 @@ autotools-utils_src_configure() { |
16 |
[[ -z ${myeconfargs+1} || $(declare -p myeconfargs) == 'declare -a'* ]] \ |
17 |
|| die 'autotools-utils.eclass: myeconfargs has to be an array.' |
18 |
|
19 |
+ [[ ${EAPI} == 2 ]] && ! use prefix && EPREFIX= |
20 |
+ |
21 |
# Common args |
22 |
- local econfargs=() |
23 |
+ local econfargs=( |
24 |
+ --docdir="${EPREFIX}/usr/share/doc/${PF}" |
25 |
+ ) |
26 |
|
27 |
# Handle static-libs found in IUSE, disable them by default |
28 |
if in_iuse static-libs; then |
29 |
@@ -441,6 +445,24 @@ autotools-utils_src_install() { |
30 |
emake DESTDIR="${D}" "$@" install || die "emake install failed" |
31 |
popd > /dev/null |
32 |
|
33 |
+ # Move docs installed by autotools (in EAPI < 4). |
34 |
+ if [[ -d ${D}${EPREFIX}/usr/share/doc/${PF} ]]; then |
35 |
+ if [[ ${EAPI} == [23] ]]; then |
36 |
+ mkdir "${T}"/temp-docdir |
37 |
+ mv "${D}${EPREFIX}"/usr/share/doc/${PF}/* "${T}"/temp-docdir/ \ |
38 |
+ || die "moving docs to tempdir failed" |
39 |
+ |
40 |
+ local f |
41 |
+ for f in "${T}"/temp-docdir/*; do |
42 |
+ [[ -d ${f} ]] \ |
43 |
+ && die "directories in docdir require at least EAPI 4" |
44 |
+ done |
45 |
+ |
46 |
+ dodoc "${T}"/temp-docdir/* || die "docdir dodoc failed" |
47 |
+ rm -r "${T}"/temp-docdir || die |
48 |
+ fi |
49 |
+ fi |
50 |
+ |
51 |
# XXX: support installing them from builddir as well? |
52 |
if [[ ${DOCS} ]]; then |
53 |
dodoc "${DOCS[@]}" || die "dodoc failed" |
54 |
-- |
55 |
1.7.8.3 |