You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
974 B

  1. #!/bin/bash
  2. set -e
  3. BINDIR="/opt/bin"
  4. if [[ -e $BINDIR/.bootstrapped ]]; then
  5. exit 0
  6. fi
  7. ARCH=$(uname -m)
  8. case $ARCH in
  9. "x86_64")
  10. PYPY_ARCH=linux64
  11. PYPI_HASH=46818cb3d74b96b34787548343d266e2562b531ddbaf330383ba930ff1930ed5
  12. ;;
  13. "aarch64")
  14. PYPY_ARCH=aarch64
  15. PYPI_HASH=2e1ae193d98bc51439642a7618d521ea019f45b8fb226940f7e334c548d2b4b9
  16. ;;
  17. *)
  18. echo "Unsupported Architecture: ${ARCH}"
  19. exit 1
  20. esac
  21. PYTHON_VERSION=3.9
  22. PYPY_VERSION=7.3.9
  23. PYPY_FILENAME="pypy${PYTHON_VERSION}-v${PYPY_VERSION}-${PYPY_ARCH}"
  24. PYPI_URL="https://downloads.python.org/pypy/${PYPY_FILENAME}.tar.bz2"
  25. mkdir -p $BINDIR
  26. cd $BINDIR
  27. TAR_FILE=pyp.tar.bz2
  28. wget -O "${TAR_FILE}" "${PYPI_URL}"
  29. echo "${PYPI_HASH} ${TAR_FILE}" | sha256sum -c -
  30. tar -xjf "${TAR_FILE}" && rm "${TAR_FILE}"
  31. mv -n "${PYPY_FILENAME}" pypy3
  32. ln -s ./pypy3/bin/pypy3 python
  33. $BINDIR/python --version
  34. # install PyYAML
  35. ./python -m ensurepip
  36. ./python -m pip install pyyaml
  37. touch $BINDIR/.bootstrapped