Skip to content

Instantly share code, notes, and snippets.

@mattbillenstein
Created June 25, 2019 23:33
Show Gist options
  • Save mattbillenstein/21811731d24403eb5e805f7342d35378 to your computer and use it in GitHub Desktop.
Save mattbillenstein/21811731d24403eb5e805f7342d35378 to your computer and use it in GitHub Desktop.
#!/bin/bash -xv
set -eo pipefail
HERE="$(pwd)"
sudo apt-get install gcc make libffi-dev pkg-config zlib1g-dev libbz2-dev \
libsqlite3-dev libncurses5-dev libexpat1-dev libssl-dev libgdbm-dev \
tk-dev libgc-dev python-cffi \
liblzma-dev libncursesw5-dev # these two only needed on PyPy3
PYPY_VERSION="pypy3.6-v7.1.1"
PYPY_ARCH="arm"
VENV=$HERE/pypy3-build
rm -fR $VENV/opt/pypy3 $VENV/build
mkdir -p $VENV/opt $VENV/build
cd $VENV/build
rm -fR /tmp/usession-release-${PYPY_VERSION}-*
wget https://bitbucket.org/pypy/pypy/downloads/${PYPY_VERSION}-src.tar.bz2
tar jxf ${PYPY_VERSION}-src.tar.bz2
cd ${PYPY_VERSION}-src/pypy/goal
python ../../rpython/bin/rpython --opt=jit
PYTHONPATH=../.. ./pypy3-c ../../pypy/tool/build_cffi_imports.py
cd ../tool/release
python ./package.py --archive-name=${PYPY_VERSION}-${PYPY_ARCH}
mv /tmp/usession-release-${PYPY_VERSION}-$(whoami)/build/${PYPY_VERSION}-${PYPY_ARCH} $VENV/opt/pypy3
cd $BUILD_DIR
wget https://bootstrap.pypa.io/get-pip.py
$VENV/opt/pypy3/bin/pypy3 ./get-pip.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment