This may help a few test suites and shouldn't hurt much of the others
(which weren't broken already).

Done only for out-of-source builds as that's where we control the build
directories.
---
 gx86/eclass/distutils-r1.eclass | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/gx86/eclass/distutils-r1.eclass b/gx86/eclass/distutils-r1.eclass
index 3b86afd..d748621 100644
--- a/gx86/eclass/distutils-r1.eclass
+++ b/gx86/eclass/distutils-r1.eclass
@@ -331,12 +331,22 @@ distutils-r1_python_install_all() {
 # @USAGE: [<argv>...]
 # @INTERNAL
 # @DESCRIPTION:
-# Run the given command in BUILD_DIR.
+# Run the given command.
+#
+# If out-of-source builds are used, the phase function is run in source
+# 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).
 distutils-r1_run_phase() {
        debug-print-function ${FUNCNAME} "${@}"
 
        if [[ ${DISTUTILS_IN_SOURCE_BUILD} ]]; then
                pushd "${BUILD_DIR}" &>/dev/null || die
+       else
+               local PYTHONPATH="${BUILD_DIR}/lib:${PYTHONPATH}"
+               export PYTHONPATH
        fi
 
        "${@}" || die "${1} failed."
-- 
1.7.12.4


Reply via email to