BACKPORT: dev-lang/python: Fix epython.py module first install
Fix the issues in obtaining sitedir for epython.py module install when
dev-lang/python is not yet installed.
Cherry-picked from bc46e49ff67cf1e5157ab95b41e780067f433685
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
[djkurtz: keeping PYTHON_SCRIPTDIR]
BUG=chromium:736313
TEST=PreCQ and SDK tryjob
Change-Id: I3ac661bb56a722766a1a982d1e421db1555f12db
Reviewed-on: https://chromium-review.googlesource.com/1623915
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Chris McDonald <cjmcdonald@chromium.org>
diff --git a/dev-lang/python/python-2.7.10.ebuild b/dev-lang/python/python-2.7.10.ebuild
index bd0dd0b..9b468da 100644
--- a/dev-lang/python/python-2.7.10.ebuild
+++ b/dev-lang/python/python-2.7.10.ebuild
@@ -448,16 +448,18 @@
-i "${ED}etc/conf.d/pydoc-${SLOT}" "${ED}etc/init.d/pydoc-${SLOT}" || die "sed failed"
# for python-exec
- python_export python${SLOT} EPYTHON PYTHON PYTHON_SCRIPTDIR
- export PYTHON_SITEDIR="${EPREFIX}/usr/$(get_libdir)/python${SLOT}/site-packages"
+ local vars=( EPYTHON PYTHON_SITEDIR PYTHON_SCRIPTDIR )
# if not using a cross-compiler, use the fresh binary
if ! tc-is-cross-compiler; then
- local PYTHON=./python
+ local -x PYTHON=./python
local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}.
+ else
+ vars=( PYTHON "${vars[@]}" )
fi
- echo "EPYTHON='${EPYTHON}'" > epython.py
+ python_export "python${PYVER}" "${vars[@]}"
+ echo "EPYTHON='${EPYTHON}'" > epython.py || die
python_domodule epython.py
# python-exec wrapping support