Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH] autotools-utils: drop base.eclass inherit and thus src_unpack() export.
Date: Wed, 30 Nov 2011 18:24:18
Message-Id: 1322677433-5034-1-git-send-email-mgorny@gentoo.org
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 | 38 +++++++++++++++++++++++++++++++++-----
8 1 files changed, 33 insertions(+), 5 deletions(-)
9
10 diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
11 index 0aa1679..7a5b77c 100644
12 --- a/eclass/autotools-utils.eclass
13 +++ b/eclass/autotools-utils.eclass
14 @@ -93,7 +93,7 @@ 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 @@ -125,6 +125,24 @@ EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test
24 # }
25 # @CODE
26
27 +# @ECLASS-VARIABLE: DOCS
28 +# @DESCRIPTION:
29 +# Array containing documents passed to dodoc command.
30 +#
31 +# DOCS=( NEWS README )
32 +
33 +# @ECLASS-VARIABLE: HTML_DOCS
34 +# @DESCRIPTION:
35 +# Array containing documents passed to dohtml command.
36 +#
37 +# HTML_DOCS=( doc/html/ )
38 +
39 +# @ECLASS-VARIABLE: PATCHES
40 +# @DESCRIPTION:
41 +# PATCHES array variable containing all various patches to be applied.
42 +#
43 +# PATCHES=( "${FILESDIR}/mypatch.patch" )
44 +
45 # Determine using IN or OUT source build
46 _check_build_dir() {
47 : ${ECONF_SOURCE:=${S}}
48 @@ -224,7 +242,9 @@ remove_libtool_files() {
49 autotools-utils_src_prepare() {
50 debug-print-function ${FUNCNAME} "$@"
51
52 - base_src_prepare
53 + [[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
54 + epatch_user
55 +
56 elibtoolize --patch-only
57 }
58
59 @@ -260,7 +280,7 @@ autotools-utils_src_configure() {
60 _check_build_dir
61 mkdir -p "${AUTOTOOLS_BUILD_DIR}" || die "mkdir '${AUTOTOOLS_BUILD_DIR}' failed"
62 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
63 - base_src_configure "${econfargs[@]}" "$@"
64 + default_src_configure "${econfargs[@]}" "$@"
65 popd > /dev/null
66 }
67
68 @@ -272,7 +292,7 @@ autotools-utils_src_compile() {
69
70 _check_build_dir
71 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
72 - base_src_compile "$@"
73 + default_src_compile "$@"
74 popd > /dev/null
75 }
76
77 @@ -289,9 +309,17 @@ autotools-utils_src_install() {
78
79 _check_build_dir
80 pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
81 - base_src_install "$@"
82 + emake DESTDIR="${D}" "$@" install || die "emake install failed"
83 popd > /dev/null
84
85 + # XXX: support installing them from builddir as well?
86 + if [[ ${DOCS} ]]; then
87 + dodoc "${DOCS[@]}" || die "dodoc failed"
88 + fi
89 + if [[ ${HTML_DOCS} ]]; then
90 + dohtml -r "${HTML_DOCS[@]}" || die "dohtml failed"
91 + fi
92 +
93 # Remove libtool files and unnecessary static libs
94 remove_libtool_files
95 }
96 --
97 1.7.8.rc4.dirty

Replies