Skip to content

Instantly share code, notes, and snippets.

@mattbornski
Created March 2, 2012 18:27
Show Gist options
  • Save mattbornski/1960213 to your computer and use it in GitHub Desktop.
Save mattbornski/1960213 to your computer and use it in GitHub Desktop.
Installing PyPy
#/bin/bash
# Dependencies
#sudo apt-get install gcc make python-dev libffi-dev pkg-config libz-dev libbz2-dev libncurses-dev libexpat1-dev libssl-dev libgc-dev python-sphinx python-greenlet
# To build from source (WARNING will take fucking forever)
#wget https://bitbucket.org/pypy/pypy/get/release-1.8.tar.bz2
#tar jxvf release-1.8.tar.bz2
#cd pypy-pypy-2346207d9946/pypy/translator/goal/
#python translate.py -Ojit
# To download pre-built binary
UNAME=$(uname)
if [[ "$UNAME" == "Linux" ]]; then
BITS=$(uname -m)
if [[ "$BITS" == "x86_64" ]]; then
FILENAME="pypy-1.8-linux64.tar.bz2"
else
FILENAME="pypy-1.8-linux.tar.bz2"
fi
elif [[ "$UNAME" == "Darwin"]]; then
FILENAME="pypy-1.8-osx64.tar.bz2"
else
echo "Could not determine OS"
exit 1;
fi
wget https://bitbucket.org/pypy/pypy/downloads/$FILENAME
tar jxvf $FILENAME
# Add to path
MAKE_SYMLINK="ln -s $PWD/pypy-1.8/bin/pypy /usr/local/bin/pypy"
$(MAKE_SYMLINK)
if [[ "$?" == "1" ]]; then
sudo $(MAKE_SYMLINK)
fi
# Bootstrap important tools for package management
wget http://python-distribute.org/distribute_setup.py
pypy distribute_setup.py
rm distribute_setup.py
wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py
pypy get-pip.py
rm get-pip.py
# Add to path
# I'm calling the pypy pip "pyp" because I can.
MAKE_SYMLINK="ln -s $PWD/pypy-1.8/bin/pip /usr/local/bin/pyp"
$(MAKE_SYMLINK)
if [[ "$?" == "1" ]]; then
sudo $(MAKE_SYMLINK)
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment