2017-11-13 09:34:21 +00:00
|
|
|
#!/bin/bash
|
2015-12-30 21:15:18 +00:00
|
|
|
set -e
|
|
|
|
|
2016-02-19 17:48:53 +00:00
|
|
|
BINDIR="/opt/bin"
|
2022-06-14 14:03:35 +00:00
|
|
|
if [[ -e $BINDIR/.bootstrapped ]]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
ARCH=$(uname -m)
|
|
|
|
case $ARCH in
|
|
|
|
"x86_64")
|
|
|
|
PYPY_ARCH=linux64
|
|
|
|
PYPI_HASH=46818cb3d74b96b34787548343d266e2562b531ddbaf330383ba930ff1930ed5
|
|
|
|
;;
|
|
|
|
"aarch64")
|
|
|
|
PYPY_ARCH=aarch64
|
|
|
|
PYPI_HASH=2e1ae193d98bc51439642a7618d521ea019f45b8fb226940f7e334c548d2b4b9
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Unsupported Architecture: ${ARCH}"
|
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
|
|
|
|
PYTHON_VERSION=3.9
|
|
|
|
PYPY_VERSION=7.3.9
|
|
|
|
PYPY_FILENAME="pypy${PYTHON_VERSION}-v${PYPY_VERSION}-${PYPY_ARCH}"
|
|
|
|
PYPI_URL="https://downloads.python.org/pypy/${PYPY_FILENAME}.tar.bz2"
|
2015-12-30 21:15:18 +00:00
|
|
|
|
2016-05-13 09:48:13 +00:00
|
|
|
mkdir -p $BINDIR
|
|
|
|
|
2015-12-30 21:15:18 +00:00
|
|
|
cd $BINDIR
|
|
|
|
|
2020-05-06 11:49:08 +00:00
|
|
|
TAR_FILE=pyp.tar.bz2
|
|
|
|
wget -O "${TAR_FILE}" "${PYPI_URL}"
|
|
|
|
echo "${PYPI_HASH} ${TAR_FILE}" | sha256sum -c -
|
|
|
|
tar -xjf "${TAR_FILE}" && rm "${TAR_FILE}"
|
2022-06-14 14:03:35 +00:00
|
|
|
mv -n "${PYPY_FILENAME}" pypy3
|
2015-12-30 21:15:18 +00:00
|
|
|
|
2019-01-12 14:04:33 +00:00
|
|
|
ln -s ./pypy3/bin/pypy3 python
|
2015-12-30 21:15:18 +00:00
|
|
|
$BINDIR/python --version
|
|
|
|
|
|
|
|
touch $BINDIR/.bootstrapped
|