mirror of
https://github.com/pyenv/pyenv.git
synced 2024-12-19 00:53:49 -05:00
81 lines
2.2 KiB
Text
81 lines
2.2 KiB
Text
VERSION='7.3.10'
|
|
PYVER='3.9'
|
|
|
|
# https://www.pypy.org/checksums.html
|
|
aarch64_hash=657a04fd9a5a992a2f116a9e7e9132ea0c578721f59139c9fb2083775f71e514
|
|
linux32_hash=b6db59613b9a1c0c1ab87bc103f52ee95193423882dc8a848b68850b8ba59cc5
|
|
linux64_hash=95cf99406179460d63ddbfe1ec870f889d05f7767ce81cef14b88a3a9e127266
|
|
osarm64_hash=e2a6bec7408e6497c7de8165aa4a1b15e2416aec4a72f2578f793fb06859ccba
|
|
osx64_hash=f90c8619b41e68ec9ffd7d5e913fe02e60843da43d3735b1c1bc75bcfe638d97
|
|
s390x_hash=ca6525a540cf0c682d1592ae35d3fbc97559a97260e4b789255cc76dde7a14f0
|
|
|
|
### end of manual settings - following lines same for every download
|
|
|
|
function err_no_binary {
|
|
local archmsg="${1}"
|
|
local ver="pypy${PYVER}-v${VERSION}-src"
|
|
local url="https://downloads.python.org/pypy/${ver}.tar.bz2"
|
|
{ echo
|
|
colorize 1 "ERROR"
|
|
echo ": The binary distribution of PyPy is not available for ${archmsg}."
|
|
echo "try '${url}' to build from source."
|
|
echo
|
|
} >&2
|
|
exit 1
|
|
}
|
|
|
|
function pypy_pkg_data {
|
|
# pypy architecture tag
|
|
local ARCH="${1}"
|
|
|
|
# defaults
|
|
local cmd='install_package' # use bz2
|
|
local pkg="${ARCH}" # assume matches
|
|
local ext='tar.bz2'
|
|
local hash='' # undefined
|
|
|
|
# select the hash, fix pkg if not match ARCH
|
|
case "${ARCH}" in
|
|
'linux-aarch64' )
|
|
hash="${aarch64_hash}"
|
|
pkg='aarch64'
|
|
;;
|
|
'linux' )
|
|
hash="${linux32_hash}"
|
|
pkg='linux32'
|
|
;;
|
|
'linux64' )
|
|
hash="${linux64_hash}"
|
|
;;
|
|
'osarm64' )
|
|
hash="${osarm64_hash}"
|
|
pkg='macos_arm64'
|
|
;;
|
|
'osx64' )
|
|
if require_osx_version "10.13"; then
|
|
hash="${osx64_hash}"
|
|
pkg='macos_x86_64'
|
|
else
|
|
err_no_binary "${ARCH}, OS X < 10.13"
|
|
fi
|
|
;;
|
|
's390x' )
|
|
hash="${s390x_hash}"
|
|
;;
|
|
* )
|
|
err_no_binary "${ARCH}"
|
|
;;
|
|
esac
|
|
|
|
local basever="pypy${PYVER}-v${VERSION}"
|
|
local baseurl="https://downloads.python.org/pypy/${basever}"
|
|
|
|
# result - command, package dir, url+hash
|
|
echo "${cmd}" "${basever}-${pkg}" "${baseurl}-${pkg}.${ext}#${hash}"
|
|
}
|
|
|
|
# determine command, package directory, url+hash
|
|
declare -a pd="$(pypy_pkg_data "$(pypy_architecture 2>/dev/null || true)")"
|
|
|
|
# install
|
|
${pd[0]} "${pd[1]}" "${pd[2]}" 'pypy' "verify_py${PYVER//./}" 'ensurepip'
|