mirror of
https://github.com/pyenv/pyenv.git
synced 2024-12-22 22:41:16 +00:00
Check existence of curses
module before start building PyPy (#244)
This commit is contained in:
parent
6e02ad2fe4
commit
fc41c87395
1 changed files with 15 additions and 14 deletions
|
@ -184,22 +184,23 @@ fi
|
|||
|
||||
# PyPy requires existing Python 2.x to build
|
||||
if [[ "${VERSION_NAME}" == "pypy-"*"-src" ]]; then
|
||||
PYENV_VERSION="$(pyenv-whence "python2.7" 2>/dev/null | tail -n 1 || true)"
|
||||
if [ -n "${PYENV_VERSION}" ]; then
|
||||
export PYENV_VERSION
|
||||
else
|
||||
PYENV_VERSION="$(pyenv-whence "python2.6" 2>/dev/null | tail -n 1 || true)"
|
||||
if [ -n "${PYENV_VERSION}" ]; then
|
||||
export PYENV_VERSION
|
||||
else
|
||||
PYENV_VERSION="$(pyenv-whence "python2.5" 2>/dev/null | tail -n 1 || true)"
|
||||
if [ -n "${PYENV_VERSION}" ]; then
|
||||
export PYENV_VERSION
|
||||
else
|
||||
echo "pyenv-install: $VERSION_NAME requires CPython 2.[567] to build" >^2
|
||||
exit 1
|
||||
if [ -z "$PYENV_RPYTHON_VERSION" ]; then
|
||||
for version in $(pyenv-versions --bare | sort -r); do
|
||||
if [[ "$version" == 2.[567] ]] || [[ "$version" == 2.[567].* ]]; then
|
||||
PYENV_RPYTHON_VERSION="$version"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
if [ -n "$PYENV_RPYTHON_VERSION" ]; then
|
||||
if PYENV_VERSION="$PYENV_RPYTHON_VERSION" pyenv-exec python -c 'import curses' 1>/dev/null 2>&1; then
|
||||
export PYENV_VERSION="$PYENV_RPYTHON_VERSION"
|
||||
else
|
||||
echo "pyenv-install: $VERSION_NAME: PyPy requires \`curses' in $PYENV_RPYTHON_VERSION to build from source." >&2
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "pyenv-install: $VERSION_NAME: PyPy requires Python 2.5, 2.6 or 2.7 to build from source." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue