Gentoo Archives: gentoo-commits

From: "Michal Gorny (mgorny)" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog autotools-utils.eclass autotools-multilib.eclass cmake-utils.eclass
Date: Sat, 01 Dec 2012 16:26:16
Message-Id: 20121201162603.7CA52216C2@flycatcher.gentoo.org
1 mgorny 12/12/01 16:26:03
2
3 Modified: ChangeLog autotools-utils.eclass
4 autotools-multilib.eclass cmake-utils.eclass
5 Log:
6 Use a common BUILD_DIR variable. Acked by scarabeus.
7
8 Revision Changes Path
9 1.538 eclass/ChangeLog
10
11 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.538&view=markup
12 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.538&content-type=text/plain
13 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.537&r2=1.538
14
15 Index: ChangeLog
16 ===================================================================
17 RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
18 retrieving revision 1.537
19 retrieving revision 1.538
20 diff -u -r1.537 -r1.538
21 --- ChangeLog 1 Dec 2012 10:54:50 -0000 1.537
22 +++ ChangeLog 1 Dec 2012 16:26:03 -0000 1.538
23 @@ -1,6 +1,10 @@
24 # ChangeLog for eclass directory
25 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
26 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.537 2012/12/01 10:54:50 mgorny Exp $
27 +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.538 2012/12/01 16:26:03 mgorny Exp $
28 +
29 + 01 Dec 2012; Michał Górny <mgorny@g.o> autotools-multilib.eclass,
30 + autotools-utils.eclass, cmake-utils.eclass:
31 + Use a common BUILD_DIR variable. Acked by scarabeus.
32
33 01 Dec 2012; Michał Górny <mgorny@g.o> distutils-r1.eclass:
34 Support parallel builds using multiprocessing eclass.
35
36
37
38 1.58 eclass/autotools-utils.eclass
39
40 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/autotools-utils.eclass?rev=1.58&view=markup
41 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/autotools-utils.eclass?rev=1.58&content-type=text/plain
42 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/autotools-utils.eclass?r1=1.57&r2=1.58
43
44 Index: autotools-utils.eclass
45 ===================================================================
46 RCS file: /var/cvsroot/gentoo-x86/eclass/autotools-utils.eclass,v
47 retrieving revision 1.57
48 retrieving revision 1.58
49 diff -u -r1.57 -r1.58
50 --- autotools-utils.eclass 27 Sep 2012 16:35:41 -0000 1.57
51 +++ autotools-utils.eclass 1 Dec 2012 16:26:03 -0000 1.58
52 @@ -1,6 +1,6 @@
53 # Copyright 1999-2012 Gentoo Foundation
54 # Distributed under the terms of the GNU General Public License v2
55 -# $Header: /var/cvsroot/gentoo-x86/eclass/autotools-utils.eclass,v 1.57 2012/09/27 16:35:41 axs Exp $
56 +# $Header: /var/cvsroot/gentoo-x86/eclass/autotools-utils.eclass,v 1.58 2012/12/01 16:26:03 mgorny Exp $
57
58 # @ECLASS: autotools-utils.eclass
59 # @MAINTAINER:
60 @@ -76,10 +76,10 @@
61 # }
62 #
63 # src_install() {
64 -# use doc && HTML_DOCS=("${AUTOTOOLS_BUILD_DIR}/apidocs/html/")
65 +# use doc && HTML_DOCS=("${BUILD_DIR}/apidocs/html/")
66 # autotools-utils_src_install
67 # if use examples; then
68 -# dobin "${AUTOTOOLS_BUILD_DIR}"/foo_example{1,2,3} \\
69 +# dobin "${BUILD_DIR}"/foo_example{1,2,3} \\
70 # || die 'dobin examples failed'
71 # fi
72 # }
73 @@ -117,11 +117,14 @@
74
75 EXPORT_FUNCTIONS src_prepare src_configure src_compile src_install src_test
76
77 -# @ECLASS-VARIABLE: AUTOTOOLS_BUILD_DIR
78 +# @ECLASS-VARIABLE: BUILD_DIR
79 # @DEFAULT_UNSET
80 # @DESCRIPTION:
81 # Build directory, location where all autotools generated files should be
82 # placed. For out of source builds it defaults to ${WORKDIR}/${P}_build.
83 +#
84 +# This variable has been called AUTOTOOLS_BUILD_DIR formerly.
85 +# It is set under that name for compatibility.
86
87 # @ECLASS-VARIABLE: AUTOTOOLS_IN_SOURCE_BUILD
88 # @DEFAULT_UNSET
89 @@ -183,11 +186,14 @@
90 _check_build_dir() {
91 : ${ECONF_SOURCE:=${S}}
92 if [[ -n ${AUTOTOOLS_IN_SOURCE_BUILD} ]]; then
93 - AUTOTOOLS_BUILD_DIR="${ECONF_SOURCE}"
94 + BUILD_DIR="${ECONF_SOURCE}"
95 else
96 - : ${AUTOTOOLS_BUILD_DIR:=${WORKDIR}/${P}_build}
97 + : ${BUILD_DIR:=${AUTOTOOLS_BUILD_DIR:-${WORKDIR}/${P}_build}}
98 fi
99 - echo ">>> Working in BUILD_DIR: \"$AUTOTOOLS_BUILD_DIR\""
100 +
101 + # Backwards compatibility.
102 + AUTOTOOLS_BUILD_DIR=${BUILD_DIR}
103 + echo ">>> Working in BUILD_DIR: \"${BUILD_DIR}\""
104 }
105
106 # @FUNCTION: remove_libtool_files
107 @@ -413,20 +419,20 @@
108 # Append user args
109 econfargs+=("${myeconfargs[@]}")
110
111 - mkdir -p "${AUTOTOOLS_BUILD_DIR}" || die "mkdir '${AUTOTOOLS_BUILD_DIR}' failed"
112 - pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null || die
113 + mkdir -p "${BUILD_DIR}" || die
114 + pushd "${BUILD_DIR}" > /dev/null || die
115 econf "${econfargs[@]}" "$@"
116 popd > /dev/null || die
117 }
118
119 # @FUNCTION: autotools-utils_src_compile
120 # @DESCRIPTION:
121 -# The autotools src_compile function, invokes emake in specified AUTOTOOLS_BUILD_DIR.
122 +# The autotools src_compile function, invokes emake in specified BUILD_DIR.
123 autotools-utils_src_compile() {
124 debug-print-function ${FUNCNAME} "$@"
125
126 _check_build_dir
127 - pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null || die
128 + pushd "${BUILD_DIR}" > /dev/null || die
129 emake "$@" || die 'emake failed'
130 popd > /dev/null || die
131 }
132 @@ -443,7 +449,7 @@
133 debug-print-function ${FUNCNAME} "$@"
134
135 _check_build_dir
136 - pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null || die
137 + pushd "${BUILD_DIR}" > /dev/null || die
138 emake DESTDIR="${D}" "$@" install || die "emake install failed"
139 popd > /dev/null || die
140
141 @@ -490,7 +496,7 @@
142 debug-print-function ${FUNCNAME} "$@"
143
144 _check_build_dir
145 - pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null || die
146 + pushd "${BUILD_DIR}" > /dev/null || die
147 # Run default src_test as defined in ebuild.sh
148 default_src_test
149 popd > /dev/null || die
150
151
152
153 1.2 eclass/autotools-multilib.eclass
154
155 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/autotools-multilib.eclass?rev=1.2&view=markup
156 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/autotools-multilib.eclass?rev=1.2&content-type=text/plain
157 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/autotools-multilib.eclass?r1=1.1&r2=1.2
158
159 Index: autotools-multilib.eclass
160 ===================================================================
161 RCS file: /var/cvsroot/gentoo-x86/eclass/autotools-multilib.eclass,v
162 retrieving revision 1.1
163 retrieving revision 1.2
164 diff -u -r1.1 -r1.2
165 --- autotools-multilib.eclass 8 Oct 2012 18:44:30 -0000 1.1
166 +++ autotools-multilib.eclass 1 Dec 2012 16:26:03 -0000 1.2
167 @@ -1,6 +1,6 @@
168 # Copyright 1999-2012 Gentoo Foundation
169 # Distributed under the terms of the GNU General Public License v2
170 -# $Header: /var/cvsroot/gentoo-x86/eclass/autotools-multilib.eclass,v 1.1 2012/10/08 18:44:30 mgorny Exp $
171 +# $Header: /var/cvsroot/gentoo-x86/eclass/autotools-multilib.eclass,v 1.2 2012/12/01 16:26:03 mgorny Exp $
172
173 # @ECLASS: autotools-multilib.eclass
174 # @MAINTAINER:
175 @@ -38,17 +38,19 @@
176 # @USAGE: argv...
177 # @DESCRIPTION:
178 # If multilib support is enabled, sets the toolchain up for each
179 -# supported ABI along with the ABI variable and correct
180 -# AUTOTOOLS_BUILD_DIR, and runs the given commands with them.
181 +# supported ABI along with the ABI variable and correct BUILD_DIR,
182 +# and runs the given commands with them.
183 #
184 # If multilib support is disabled, it just runs the commands. No setup
185 # is done.
186 autotools-multilib_foreach_abi() {
187 + local initial_dir=${BUILD_DIR:-${S}}
188 +
189 if use multilib; then
190 local ABI
191 for ABI in $(get_all_abis); do
192 multilib_toolchain_setup "${ABI}"
193 - AUTOTOOLS_BUILD_DIR=${S%%/}-${ABI} "${@}"
194 + BUILD_DIR=${initial_dir%%/}-${ABI} "${@}"
195 done
196 else
197 "${@}"
198
199
200
201 1.86 eclass/cmake-utils.eclass
202
203 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/cmake-utils.eclass?rev=1.86&view=markup
204 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/cmake-utils.eclass?rev=1.86&content-type=text/plain
205 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/cmake-utils.eclass?r1=1.85&r2=1.86
206
207 Index: cmake-utils.eclass
208 ===================================================================
209 RCS file: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v
210 retrieving revision 1.85
211 retrieving revision 1.86
212 diff -u -r1.85 -r1.86
213 --- cmake-utils.eclass 25 Oct 2012 12:48:58 -0000 1.85
214 +++ cmake-utils.eclass 1 Dec 2012 16:26:03 -0000 1.86
215 @@ -1,6 +1,6 @@
216 # Copyright 1999-2012 Gentoo Foundation
217 # Distributed under the terms of the GNU General Public License v2
218 -# $Header: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v 1.85 2012/10/25 12:48:58 scarabeus Exp $
219 +# $Header: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v 1.86 2012/12/01 16:26:03 mgorny Exp $
220
221 # @ECLASS: cmake-utils.eclass
222 # @MAINTAINER:
223 @@ -114,12 +114,15 @@
224 fi
225 }
226
227 -# @ECLASS-VARIABLE: CMAKE_BUILD_DIR
228 +# @ECLASS-VARIABLE: BUILD_DIR
229 # @DESCRIPTION:
230 # Build directory where all cmake processed files should be generated.
231 # For in-source build it's fixed to ${CMAKE_USE_DIR}.
232 # For out-of-source build it can be overriden, by default it uses
233 # ${WORKDIR}/${P}_build.
234 +#
235 +# This variable has been called CMAKE_BUILD_DIR formerly.
236 +# It is set under that name for compatibility.
237
238 # @ECLASS-VARIABLE: CMAKE_BUILD_TYPE
239 # @DESCRIPTION:
240 @@ -163,12 +166,14 @@
241 : ${CMAKE_USE_DIR:=${S}}
242 if [[ -n ${CMAKE_IN_SOURCE_BUILD} ]]; then
243 # we build in source dir
244 - CMAKE_BUILD_DIR="${CMAKE_USE_DIR}"
245 + BUILD_DIR="${CMAKE_USE_DIR}"
246 else
247 - : ${CMAKE_BUILD_DIR:=${WORKDIR}/${P}_build}
248 + : ${BUILD_DIR:=${CMAKE_BUILD_DIR:-${WORKDIR}/${P}_build}}
249 fi
250 - mkdir -p "${CMAKE_BUILD_DIR}"
251 - echo ">>> Working in BUILD_DIR: \"$CMAKE_BUILD_DIR\""
252 + CMAKE_BUILD_DIR=${BUILD_DIR}
253 +
254 + mkdir -p "${BUILD_DIR}"
255 + echo ">>> Working in BUILD_DIR: \"$BUILD_DIR\""
256 }
257
258 # Determine which generator to use
259 @@ -328,7 +333,7 @@
260 fi
261
262 # Prepare Gentoo override rules (set valid compiler, append CPPFLAGS etc.)
263 - local build_rules=${CMAKE_BUILD_DIR}/gentoo_rules.cmake
264 + local build_rules=${BUILD_DIR}/gentoo_rules.cmake
265 cat > "${build_rules}" <<- _EOF_
266 SET (CMAKE_AR $(type -P $(tc-getAR)) CACHE FILEPATH "Archive manager" FORCE)
267 SET (CMAKE_C_COMPILER $(type -P $(tc-getCC)) CACHE FILEPATH "C compiler" FORCE)
268 @@ -364,7 +369,7 @@
269 fi
270
271 # Common configure parameters (invariants)
272 - local common_config=${CMAKE_BUILD_DIR}/gentoo_common_config.cmake
273 + local common_config=${BUILD_DIR}/gentoo_common_config.cmake
274 local libdir=$(get_libdir)
275 cat > "${common_config}" <<- _EOF_
276 SET (LIB_SUFFIX ${libdir/lib} CACHE STRING "library path suffix" FORCE)
277 @@ -396,7 +401,7 @@
278 "${MYCMAKEARGS}"
279 )
280
281 - pushd "${CMAKE_BUILD_DIR}" > /dev/null
282 + pushd "${BUILD_DIR}" > /dev/null
283 debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: mycmakeargs is ${mycmakeargs_local[*]}"
284 echo "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}"
285 "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" || die "cmake failed"
286 @@ -418,7 +423,7 @@
287 debug-print-function ${FUNCNAME} "$@"
288
289 _check_build_dir
290 - pushd "${CMAKE_BUILD_DIR}" > /dev/null
291 + pushd "${BUILD_DIR}" > /dev/null
292 if [[ $(_generator_to_use) = Ninja ]]; then
293 # first check if Makefile exist otherwise die
294 [[ -e build.ninja ]] || die "Makefile not found. Error during configure stage."
295 @@ -444,7 +449,7 @@
296 debug-print-function ${FUNCNAME} "$@"
297
298 _check_build_dir
299 - pushd "${CMAKE_BUILD_DIR}" > /dev/null
300 + pushd "${BUILD_DIR}" > /dev/null
301 if [[ $(_generator_to_use) = Ninja ]]; then
302 DESTDIR=${D} ninja install "$@" || die "died running ninja install"
303 base_src_install_docs
304 @@ -467,7 +472,7 @@
305 local ctestargs
306
307 _check_build_dir
308 - pushd "${CMAKE_BUILD_DIR}" > /dev/null
309 + pushd "${BUILD_DIR}" > /dev/null
310 [[ -e CTestTestfile.cmake ]] || { echo "No tests found. Skipping."; return 0 ; }
311
312 [[ -n ${TEST_VERBOSE} ]] && ctestargs="--extra-verbose --output-on-failure"
313 @@ -479,13 +484,13 @@
314 else
315 if [[ -n "${CMAKE_YES_I_WANT_TO_SEE_THE_TEST_LOG}" ]] ; then
316 # on request from Diego
317 - eerror "Tests failed. Test log ${CMAKE_BUILD_DIR}/Testing/Temporary/LastTest.log follows:"
318 + eerror "Tests failed. Test log ${BUILD_DIR}/Testing/Temporary/LastTest.log follows:"
319 eerror "--START TEST LOG--------------------------------------------------------------"
320 - cat "${CMAKE_BUILD_DIR}/Testing/Temporary/LastTest.log"
321 + cat "${BUILD_DIR}/Testing/Temporary/LastTest.log"
322 eerror "--END TEST LOG----------------------------------------------------------------"
323 die "Tests failed."
324 else
325 - die "Tests failed. When you file a bug, please attach the following file: \n\t${CMAKE_BUILD_DIR}/Testing/Temporary/LastTest.log"
326 + die "Tests failed. When you file a bug, please attach the following file: \n\t${BUILD_DIR}/Testing/Temporary/LastTest.log"
327 fi
328
329 # die might not die due to nonfatal