pyenv/plugins/python-build/share/python-build/pypy3.10-7.3.15
Edgar Ramírez Mondragón 2374260efa
Add PyPy v7.3.15 (#2886)
2024-01-18 10:00:11 +03:00

81 lines
2.2 KiB
Text

VERSION='7.3.15'
PYVER='3.10'
# https://www.pypy.org/checksums.html
aarch64_hash=52146fccaf64e87e71d178dda8de63c01577ec3923073dc69e1519622bcacb74
linux32_hash=75dd58c9abd8b9d78220373148355bc3119febcf27a2c781d64ad85e7232c4aa
linux64_hash=33c584e9a70a71afd0cb7dd8ba9996720b911b3b8ed0156aea298d4487ad22c3
osarm64_hash=d927c5105ea7880f7596fe459183e35cc17c853ef5105678b2ad62a8d000a548
osx64_hash=559b61ba7e7c5a5c23cef5370f1fab47ccdb939ac5d2b42b4bef091abe3f6964
s390x_hash=209e57596381e13c9914d1332f359dc4b78de06576739747eb797bdbf85062b8
### 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'