VERSION='7.3.0'
PYVER='2.7'

case "$(pypy_architecture 2>/dev/null || true)" in
"linux" )
  install_package "pypy${PYVER}-v${VERSION}-linux32" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-linux32.tar.bz2#eac1308b7d523003a5f6d20f58406d52ab14611bcec750122ae513a5a35110db" "pypy" "verify_py${PYVER//./}" ensurepip
  ;;
"linux64" )
  install_package "pypy${PYVER}-v${VERSION}-linux64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-linux64.tar.bz2#f4950a54378ac637da2a6defa52d6ffed96af12fcd5d74e1182fb834883c9826" "pypy" "verify_py${PYVER//./}" ensurepip
  ;;
"linux-aarch64" )
  install_package "pypy${PYVER}-v${VERSION}-aarch64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-aarch64.tar.bz2#a3dd8d5e2a656849fa344dce4679d854a19bc4a096a0cf62b46a1be127a5d56c" "pypy" "verify_py${PYVER//./}" ensurepip
  ;;
"osx64" )
  if require_osx_version "10.13"; then
    install_package "pypy${PYVER}-v${VERSION}-osx64" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-osx64.tar.bz2#ca7b056b243a6221ad04fa7fc8696e36a2fb858396999dcaa31dbbae53c54474" "pypy" "verify_py${PYVER//./}" ensurepip
  else
    { echo
      colorize 1 "ERROR"
      echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true), OS X < 10.13."
      echo "try 'pypy${PYVER}-${VERSION}-src' to build from source."
      echo
    } >&2
    exit 1
  fi
  ;;
"win32" )
  install_zip "pypy${PYVER}-v${VERSION}-win32" "https://downloads.python.org/pypy/pypy${PYVER}-v${VERSION}-win32.zip#a9e3c5c983edba0313a41d3c1ab55b080816c4129e67a6c272c53b9dbcdd97ec" "pypy" "verify_py${PYVER//./}" ensurepip
  ;;
* )
  { echo
    colorize 1 "ERROR"
    echo ": The binary distribution of PyPy is not available for $(pypy_architecture 2>/dev/null || true)."
    echo "try 'pypy${PYVER}-${VERSION}-src' to build from source."
    echo
  } >&2
  exit 1
  ;;
esac
