exurd 2439bee2c5
Add PyPy v8.0.0 (#3552)
* remove OpenSSL source build
PyPy searches dependencies with pkg-config which XCode CLT do not ship, so it cannot build without Homebrew or MacPorts anyway
* Use Homebrew/MacPorts OpenSSL

---------

Co-authored-by: Ivan Pozdeev <vano@mail.mipt.ru>
2026-09-28 02:01:44 +03:00

78 lines
2.1 KiB
Plaintext

VERSION='8.0.0'
PYVER='2.7'
# https://www.pypy.org/checksums.html
aarch64_hash=9ece5a6f575514ed38dde663e7f54e59de01c35b2df6d1ef83e25490d6b7c7b8
linux32_hash=74d09cafbe0c85ae4c4d17d54099c6b31354235ffdd5277c01601434cc23e459
linux64_hash=714e8c41608d0d66588c3ba48fb788dc33a1e8a865168d165585d1660beade0d
osarm64_hash=167966aa205ca29b8d3ac6994e3d0d1741f3bf03e9e300737ed591304347c7b0
osx64_hash=4e4f27669b27a7ff950058eb07e22687f5a04ba04220bb3df24411f07d5c0340
### 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.gz"
{ 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'
local pkg="${ARCH}" # assume matches
local ext='tar.gz' # v8.0.0+ now uses gz instead of 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.15"; then
hash="${osx64_hash}"
pkg='macos_x86_64'
else
err_no_binary "${ARCH}, OS X < 10.15"
fi
;;
* )
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_lt21'