VERSION='7.3.19' PYVER='2.7' # https://www.pypy.org/checksums.html aarch64_hash=fe89d4fd4af13f76dfe7315975003518cf176520e3ccec1544a88d174f50910e linux32_hash=cc52df02b6926bd8645c1651cd7f6637ce51c2f352d0fb3c6b9330d15194b409 linux64_hash=d38445508c2eaf14ebb380d9c1ded321c5ebeae31c7e66800173d83cb8ddf423 osarm64_hash=28780e0b908ad6db4b4e096f4237124be79ecc9731946d840d9c8749eb67a759 osx64_hash=6be28d448d8e64fffc586d9b0ae4d09064a83ccaeb5b8060c651c5cd9ae06878 ### 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 ;; * ) 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'