public inbox for gentoo-python@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-python@lists.gentoo.org
Cc: python@gentoo.org, "Michał Górny" <mgorny@gentoo.org>
Subject: [gentoo-python] [PATCH distutils-r1 1/4] In-source builds: make BUILD_DIR point to the 'build' subdir.
Date: Sun, 24 Feb 2013 13:47:44 +0100	[thread overview]
Message-ID: <1361710067-8869-1-git-send-email-mgorny@gentoo.org> (raw)
In-Reply-To: <20130224134551.63bd9791@pomiocik.lan>

Currently BUILD_DIR points to the 'top' source directory. It is not
really suitable for adjusting the build paths since 'lib', 'test',
'scripts' sub-directories would likely collide.

The 'safest' way of making BUILD_DIR usable for build locations would be
to make it point to the 'build' subdirectory. That subdirectory is used
by default for builds and therefore it is very unlikely to cause any
collisions.

Note that this will actually break a few ebuilds relying on BUILD_DIR
pointing to the top of source tree. We will need to fix those but that
will be straightforward.
---
 gx86/eclass/distutils-r1.eclass | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/gx86/eclass/distutils-r1.eclass b/gx86/eclass/distutils-r1.eclass
index df46d59..7a1551b 100644
--- a/gx86/eclass/distutils-r1.eclass
+++ b/gx86/eclass/distutils-r1.eclass
@@ -285,11 +285,6 @@ distutils_install_for_testing() {
 	# 5) 'install' needs to go before 'bdist_egg' or the latter would
 	#    re-set install paths.
 
-	if [[ ${DISTUTILS_IN_SOURCE_BUILD} ]]; then
-		# use 'build' subdirectory to reduce the risk of collisions
-		local BUILD_DIR=${BUILD_DIR}/build
-	fi
-
 	TEST_DIR=${BUILD_DIR}/test
 	local bindir=${TEST_DIR}/scripts
 	local libdir=${TEST_DIR}/lib
@@ -540,8 +535,9 @@ distutils-r1_python_install_all() {
 # directory, with BUILD_DIR pointing at the build directory
 # and PYTHONPATH having an entry for the module build directory.
 #
-# If in-source builds are used, the command is executed in the BUILD_DIR
-# (the directory holding per-implementation copy of sources).
+# If in-source builds are used, the command is executed in the directory
+# holding the per-implementation copy of sources. BUILD_DIR points
+# to the 'build' subdirectory.
 distutils-r1_run_phase() {
 	debug-print-function ${FUNCNAME} "${@}"
 
@@ -549,6 +545,7 @@ distutils-r1_run_phase() {
 		if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
 			pushd "${BUILD_DIR}" >/dev/null || die
 		fi
+		local BUILD_DIR=${BUILD_DIR}/build
 	else
 		local PYTHONPATH="${BUILD_DIR}/lib:${PYTHONPATH}"
 		export PYTHONPATH
-- 
1.8.1.4



  reply	other threads:[~2013-02-24 12:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-24 12:45 [gentoo-python] [PATCHES] distutils-r1: making in-source builds more compatible with out-of-source builds Michał Górny
2013-02-24 12:47 ` Michał Górny [this message]
2013-02-24 12:47 ` [gentoo-python] [PATCH distutils-r1 2/4] In-source builds: override build locations as well Michał Górny
2013-02-24 12:47 ` [gentoo-python] [PATCH distutils-r1 3/4] In-source builds: set PYTHONPATH properly Michał Górny
2013-02-24 12:47 ` [gentoo-python] [PATCH distutils-r1 4/4] In-source builds: run *_all() phases in best-impl sources copy Michał Górny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1361710067-8869-1-git-send-email-mgorny@gentoo.org \
    --to=mgorny@gentoo.org \
    --cc=gentoo-python@lists.gentoo.org \
    --cc=python@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox