mirror of
https://github.com/pyenv/pyenv.git
synced 2025-03-11 06:23:22 +00:00
81 lines
2.2 KiB
Text
81 lines
2.2 KiB
Text
VERSION='7.3.11'
|
|
PYVER='3.9'
|
|
|
|
# https://www.pypy.org/checksums.html
|
|
aarch64_hash=09175dc652ed895d98e9ad63d216812bf3ee7e398d900a9bf9eb2906ba8302b9
|
|
linux32_hash=0099d72c2897b229057bff7e2c343624aeabdc60d6fb43ca882bff082f1ffa48
|
|
linux64_hash=d506172ca11071274175d74e9c581c3166432d0179b036470e3b9e8d20eae581
|
|
osarm64_hash=91ad7500f1a39531dbefa0b345a3dcff927ff9971654e8d2e9ef7c5ae311f57e
|
|
osx64_hash=d33f40b207099872585afd71873575ca6ea638a27d823bc621238c5ae82542ed
|
|
s390x_hash=e1f30f2ddbe3f446ddacd79677b958d56c07463b20171fb2abf8f9a3178b79fc
|
|
|
|
### 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'
|