This resolves a testing failure in dev-python/cryptography-1.6.1.

cryptography.hazmat.backends._available_backends() scans the available
setuptools entry_points, and so depends on having a valid
egg-info/entry_points.txt file available.

Without this PYTHONPATH update, it uses the egg-info from ${S}, which is not
valid on Linux systems as shipped from upstream.

I move egg-base to a subdirectory of ${BUILD_DIR} to avoid adding ${BUILD_DIR}
to PYTHONPATH. This seems less likely to randomly break other packages.

--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -362,7 +362,7 @@
                build-scripts = %(build-base)s/scripts
 
                [egg_info]
-               egg-base = ${BUILD_DIR}
+               egg-base = ${BUILD_DIR}/eggs
 
                # this is needed by distutils_install_for_testing since
                # setuptools like to create .egg files for install --home.
@@ -397,9 +397,9 @@
 # egg-base in esetup.py). This way, we respect whatever's in upstream
 # egg-info.
 _distutils-r1_copy_egg_info() {
-       mkdir -p "${BUILD_DIR}" || die
+       mkdir -p "${BUILD_DIR}/eggs" || die
        # stupid freebsd can't do 'cp -t ${BUILD_DIR} {} +'
-       find -name '*.egg-info' -type d -exec cp -pr {} "${BUILD_DIR}"/ ';' || 
die
+       find -name '*.egg-info' -type d -exec cp -pr {} "${BUILD_DIR}/eggs"/ 
';' || die
 }
 
 # @FUNCTION: distutils-r1_python_compile
@@ -605,7 +605,7 @@
                fi
                local BUILD_DIR=${BUILD_DIR}/build
        fi
-       local -x PYTHONPATH="${BUILD_DIR}/lib:${PYTHONPATH}"
+       local -x PYTHONPATH="${BUILD_DIR}/eggs:${BUILD_DIR}/lib:${PYTHONPATH}"
 
        if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
                local -x TMPDIR=${T}/${EPYTHON}

Reply via email to