Gentoo Archives: gentoo-python

From: "Michał Górny" <mgorny@g.o>
To: gentoo-python@l.g.o
Cc: python@g.o, "Michał Górny" <mgorny@g.o>
Subject: [gentoo-python] [PATCH distutils-r1 1/4] In-source builds: make BUILD_DIR point to the 'build' subdir.
Date: Sun, 24 Feb 2013 12:47:38
Message-Id: 1361710067-8869-1-git-send-email-mgorny@gentoo.org
In Reply to: [gentoo-python] [PATCHES] distutils-r1: making in-source builds more compatible with out-of-source builds by "Michał Górny"
1 Currently BUILD_DIR points to the 'top' source directory. It is not
2 really suitable for adjusting the build paths since 'lib', 'test',
3 'scripts' sub-directories would likely collide.
4
5 The 'safest' way of making BUILD_DIR usable for build locations would be
6 to make it point to the 'build' subdirectory. That subdirectory is used
7 by default for builds and therefore it is very unlikely to cause any
8 collisions.
9
10 Note that this will actually break a few ebuilds relying on BUILD_DIR
11 pointing to the top of source tree. We will need to fix those but that
12 will be straightforward.
13 ---
14 gx86/eclass/distutils-r1.eclass | 11 ++++-------
15 1 file changed, 4 insertions(+), 7 deletions(-)
16
17 diff --git a/gx86/eclass/distutils-r1.eclass b/gx86/eclass/distutils-r1.eclass
18 index df46d59..7a1551b 100644
19 --- a/gx86/eclass/distutils-r1.eclass
20 +++ b/gx86/eclass/distutils-r1.eclass
21 @@ -285,11 +285,6 @@ distutils_install_for_testing() {
22 # 5) 'install' needs to go before 'bdist_egg' or the latter would
23 # re-set install paths.
24
25 - if [[ ${DISTUTILS_IN_SOURCE_BUILD} ]]; then
26 - # use 'build' subdirectory to reduce the risk of collisions
27 - local BUILD_DIR=${BUILD_DIR}/build
28 - fi
29 -
30 TEST_DIR=${BUILD_DIR}/test
31 local bindir=${TEST_DIR}/scripts
32 local libdir=${TEST_DIR}/lib
33 @@ -540,8 +535,9 @@ distutils-r1_python_install_all() {
34 # directory, with BUILD_DIR pointing at the build directory
35 # and PYTHONPATH having an entry for the module build directory.
36 #
37 -# If in-source builds are used, the command is executed in the BUILD_DIR
38 -# (the directory holding per-implementation copy of sources).
39 +# If in-source builds are used, the command is executed in the directory
40 +# holding the per-implementation copy of sources. BUILD_DIR points
41 +# to the 'build' subdirectory.
42 distutils-r1_run_phase() {
43 debug-print-function ${FUNCNAME} "${@}"
44
45 @@ -549,6 +545,7 @@ distutils-r1_run_phase() {
46 if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
47 pushd "${BUILD_DIR}" >/dev/null || die
48 fi
49 + local BUILD_DIR=${BUILD_DIR}/build
50 else
51 local PYTHONPATH="${BUILD_DIR}/lib:${PYTHONPATH}"
52 export PYTHONPATH
53 --
54 1.8.1.4