1 |
Importing base.eclass causes us to export src_unpack() phase function |
2 |
which is entirely useless in EAPIs 2+ (which we only support), and |
3 |
causes trouble importing autotools-utils e.g. after VCS eclasses. |
4 |
|
5 |
Fixes: https://bugs.gentoo.org/show_bug.cgi?id=392651 |
6 |
--- |
7 |
eclass/autotools-utils.eclass | 54 +++++++++++++++++++++++++++++++++++++---- |
8 |
1 files changed, 49 insertions(+), 5 deletions(-) |
9 |
|
10 |
diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass |
11 |
index 0aa1679..b65443f 100644 |
12 |
--- a/eclass/autotools-utils.eclass |
13 |
+++ b/eclass/autotools-utils.eclass |
14 |
@@ -93,24 +93,28 @@ case ${EAPI:-0} in |
15 |
*) die "EAPI=${EAPI} is not supported" ;; |
16 |
esac |
17 |
|
18 |
-inherit autotools base eutils libtool |
19 |
+inherit autotools eutils libtool |
20 |
|
21 |
EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test |
22 |
|
23 |
# @ECLASS-VARIABLE: AUTOTOOLS_BUILD_DIR |
24 |
+# @DEFAULT_UNSET |
25 |
# @DESCRIPTION: |
26 |
# Build directory, location where all autotools generated files should be |
27 |
# placed. For out of source builds it defaults to ${WORKDIR}/${P}_build. |
28 |
|
29 |
# @ECLASS-VARIABLE: AUTOTOOLS_IN_SOURCE_BUILD |
30 |
+# @DEFAULT_UNSET |
31 |
# @DESCRIPTION: |
32 |
# Set to enable in-source build. |
33 |
|
34 |
# @ECLASS-VARIABLE: ECONF_SOURCE |
35 |
+# @DEFAULT_UNSET |
36 |
# @DESCRIPTION: |
37 |
# Specify location of autotools' configure script. By default it uses ${S}. |
38 |
|
39 |
# @ECLASS-VARIABLE: myeconfargs |
40 |
+# @DEFAULT_UNSET |
41 |
# @DESCRIPTION: |
42 |
# Optional econf arguments as Bash array. Should be defined before calling src_configure. |
43 |
# @CODE |
44 |
@@ -125,6 +129,36 @@ EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test |
45 |
# } |
46 |
# @CODE |
47 |
|
48 |
+# @ECLASS-VARIABLE: DOCS |
49 |
+# @DEFAULT_UNSET |
50 |
+# @DESCRIPTION: |
51 |
+# Array containing documents passed to dodoc command. |
52 |
+# |
53 |
+# Example: |
54 |
+# @CODE |
55 |
+# DOCS=( NEWS README ) |
56 |
+# @CODE |
57 |
+ |
58 |
+# @ECLASS-VARIABLE: HTML_DOCS |
59 |
+# @DEFAULT_UNSET |
60 |
+# @DESCRIPTION: |
61 |
+# Array containing documents passed to dohtml command. |
62 |
+# |
63 |
+# Example: |
64 |
+# @CODE |
65 |
+# HTML_DOCS=( doc/html/ ) |
66 |
+# @CODE |
67 |
+ |
68 |
+# @ECLASS-VARIABLE: PATCHES |
69 |
+# @DEFAULT_UNSET |
70 |
+# @DESCRIPTION: |
71 |
+# PATCHES array variable containing all various patches to be applied. |
72 |
+# |
73 |
+# Example: |
74 |
+# @CODE |
75 |
+# PATCHES=( "${FILESDIR}"/${P}-mypatch.patch ) |
76 |
+# @CODE |
77 |
+ |
78 |
# Determine using IN or OUT source build |
79 |
_check_build_dir() { |
80 |
: ${ECONF_SOURCE:=${S}} |
81 |
@@ -224,7 +258,9 @@ remove_libtool_files() { |
82 |
autotools-utils_src_prepare() { |
83 |
debug-print-function ${FUNCNAME} "$@" |
84 |
|
85 |
- base_src_prepare |
86 |
+ [[ ${PATCHES} ]] && epatch "${PATCHES[@]}" |
87 |
+ epatch_user |
88 |
+ |
89 |
elibtoolize --patch-only |
90 |
} |
91 |
|
92 |
@@ -260,7 +296,7 @@ autotools-utils_src_configure() { |
93 |
_check_build_dir |
94 |
mkdir -p "${AUTOTOOLS_BUILD_DIR}" || die "mkdir '${AUTOTOOLS_BUILD_DIR}' failed" |
95 |
pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null |
96 |
- base_src_configure "${econfargs[@]}" "$@" |
97 |
+ default_src_configure "${econfargs[@]}" "$@" |
98 |
popd > /dev/null |
99 |
} |
100 |
|
101 |
@@ -272,7 +308,7 @@ autotools-utils_src_compile() { |
102 |
|
103 |
_check_build_dir |
104 |
pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null |
105 |
- base_src_compile "$@" |
106 |
+ default_src_compile "$@" |
107 |
popd > /dev/null |
108 |
} |
109 |
|
110 |
@@ -289,9 +325,17 @@ autotools-utils_src_install() { |
111 |
|
112 |
_check_build_dir |
113 |
pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null |
114 |
- base_src_install "$@" |
115 |
+ emake DESTDIR="${D}" "$@" install || die "emake install failed" |
116 |
popd > /dev/null |
117 |
|
118 |
+ # XXX: support installing them from builddir as well? |
119 |
+ if [[ ${DOCS} ]]; then |
120 |
+ dodoc "${DOCS[@]}" || die "dodoc failed" |
121 |
+ fi |
122 |
+ if [[ ${HTML_DOCS} ]]; then |
123 |
+ dohtml -r "${HTML_DOCS[@]}" || die "dohtml failed" |
124 |
+ fi |
125 |
+ |
126 |
# Remove libtool files and unnecessary static libs |
127 |
remove_libtool_files |
128 |
} |
129 |
-- |
130 |
1.7.8.rc4.dirty |