Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: reavertm@g.o, scarabeus@g.o, "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 1/4] autotools-utils: use common BUILD_DIR variable.
Date: Thu, 29 Nov 2012 13:41:54
Message-Id: 1354196458-17485-2-git-send-email-mgorny@gentoo.org
In Reply to: [gentoo-dev] autotools-utils & cmake-utils: use common BUILD_DIR var by "Michał Górny"
1 For interoperability with python-r1.
2 ---
3 gx86/eclass/autotools-utils.eclass | 30 ++++++++++++++++++------------
4 1 file changed, 18 insertions(+), 12 deletions(-)
5
6 diff --git a/gx86/eclass/autotools-utils.eclass b/gx86/eclass/autotools-utils.eclass
7 index b035dc5..b6bfc96 100644
8 --- a/gx86/eclass/autotools-utils.eclass
9 +++ b/gx86/eclass/autotools-utils.eclass
10 @@ -76,10 +76,10 @@
11 # }
12 #
13 # src_install() {
14 -# use doc && HTML_DOCS=("${AUTOTOOLS_BUILD_DIR}/apidocs/html/")
15 +# use doc && HTML_DOCS=("${BUILD_DIR}/apidocs/html/")
16 # autotools-utils_src_install
17 # if use examples; then
18 -# dobin "${AUTOTOOLS_BUILD_DIR}"/foo_example{1,2,3} \\
19 +# dobin "${BUILD_DIR}"/foo_example{1,2,3} \\
20 # || die 'dobin examples failed'
21 # fi
22 # }
23 @@ -117,11 +117,14 @@ inherit autotools eutils libtool
24
25 EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test
26
27 -# @ECLASS-VARIABLE: AUTOTOOLS_BUILD_DIR
28 +# @ECLASS-VARIABLE: BUILD_DIR
29 # @DEFAULT_UNSET
30 # @DESCRIPTION:
31 # Build directory, location where all autotools generated files should be
32 # placed. For out of source builds it defaults to ${WORKDIR}/${P}_build.
33 +#
34 +# This variable has been called AUTOTOOLS_BUILD_DIR formerly.
35 +# It is set under that name for compatibility.
36
37 # @ECLASS-VARIABLE: AUTOTOOLS_IN_SOURCE_BUILD
38 # @DEFAULT_UNSET
39 @@ -183,11 +186,14 @@ EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test
40 _check_build_dir() {
41 : ${ECONF_SOURCE:=${S}}
42 if [[ -n ${AUTOTOOLS_IN_SOURCE_BUILD} ]]; then
43 - AUTOTOOLS_BUILD_DIR="${ECONF_SOURCE}"
44 + BUILD_DIR="${ECONF_SOURCE}"
45 else
46 - : ${AUTOTOOLS_BUILD_DIR:=${WORKDIR}/${P}_build}
47 + : ${BUILD_DIR:=${AUTOTOOLS_BUILD_DIR:-${WORKDIR}/${P}_build}}
48 fi
49 - echo ">>> Working in BUILD_DIR: \"$AUTOTOOLS_BUILD_DIR\""
50 +
51 + # Backwards compatibility.
52 + AUTOTOOLS_BUILD_DIR=${BUILD_DIR}
53 + echo ">>> Working in BUILD_DIR: \"${BUILD_DIR}\""
54 }
55
56 # @FUNCTION: remove_libtool_files
57 @@ -413,20 +419,20 @@ autotools-utils_src_configure() {
58 # Append user args
59 econfargs+=("${myeconfargs[@]}")
60
61 - mkdir -p "${AUTOTOOLS_BUILD_DIR}" || die "mkdir '${AUTOTOOLS_BUILD_DIR}' failed"
62 - pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null || die
63 + mkdir -p "${BUILD_DIR}" || die
64 + pushd "${BUILD_DIR}" > /dev/null || die
65 econf "${econfargs[@]}" "$@"
66 popd > /dev/null || die
67 }
68
69 # @FUNCTION: autotools-utils_src_compile
70 # @DESCRIPTION:
71 -# The autotools src_compile function, invokes emake in specified AUTOTOOLS_BUILD_DIR.
72 +# The autotools src_compile function, invokes emake in specified BUILD_DIR.
73 autotools-utils_src_compile() {
74 debug-print-function ${FUNCNAME} "$@"
75
76 _check_build_dir
77 - pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null || die
78 + pushd "${BUILD_DIR}" > /dev/null || die
79 emake "$@" || die 'emake failed'
80 popd > /dev/null || die
81 }
82 @@ -443,7 +449,7 @@ autotools-utils_src_install() {
83 debug-print-function ${FUNCNAME} "$@"
84
85 _check_build_dir
86 - pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null || die
87 + pushd "${BUILD_DIR}" > /dev/null || die
88 emake DESTDIR="${D}" "$@" install || die "emake install failed"
89 popd > /dev/null || die
90
91 @@ -490,7 +496,7 @@ autotools-utils_src_test() {
92 debug-print-function ${FUNCNAME} "$@"
93
94 _check_build_dir
95 - pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null || die
96 + pushd "${BUILD_DIR}" > /dev/null || die
97 # Run default src_test as defined in ebuild.sh
98 default_src_test
99 popd > /dev/null || die
100 --
101 1.8.0