mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
Set PYENV_VERSION on building pypy from source
This commit is contained in:
parent
42bb40a5d8
commit
58e24a64a2
1 changed files with 20 additions and 0 deletions
|
@ -182,6 +182,26 @@ if [[ "${VERSION_NAME}" == [23]"."* ]]; then
|
|||
done
|
||||
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
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Execute `before_install` hooks.
|
||||
for hook in "${before_hooks[@]}"; do eval "$hook"; done
|
||||
|
|
Loading…
Reference in a new issue