forked from angr/angr-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pypy_venv.sh
executable file
·46 lines (36 loc) · 1.12 KB
/
pypy_venv.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash -e
NAME=$1
DIR=$(dirname $0)
cd $DIR
#sudo apt-get install cmake libreadline-dev
# setup
mkdir -p pypy
cd pypy
if [ -f "/etc/arch-release" ]; then
echo "This is an arch distro"
ARCH=$(uname -m)
VERSION=${2-pypy-5.3.1-1-$ARCH}
# get pypy
[ ! -e $VERSION.pkg.tar.xz ] && wget https://mirrors.kernel.org/archlinux/community/os/$ARCH/$VERSION.pkg.tar.xz
if [ ! -e $VERSION ]; then
tar xf $VERSION.pkg.tar.xz
mv ./opt/pypy ./$VERSION
fi
else
VERSION=${2-pypy2-v5.3.1-linux64}
# get pypy
[ ! -e $VERSION ] && wget https://bitbucket.org/pypy/pypy/downloads/$VERSION.tar.bz2 --local-encoding=utf-8 -O - | tar xj
fi
# virtualenv
set +e
source /etc/bash_completion.d/virtualenvwrapper
mkvirtualenv -p $PWD/$VERSION/bin/pypy $NAME
set -e
pip install -U setuptools
# readline
[ ! -e pyreadline-cffi ] && git clone https://github.com/yuyichao/pyreadline-cffi.git
cd pyreadline-cffi && cmake CMakeLists.txt && make && make install
rm -f $VIRTUAL_ENV/lib_pypy/readline.*
ln -s $VIRTUAL_ENV/site-packages/readline $VIRTUAL_ENV/lib_pypy/readline
echo "installed pypy in $NAME"
exit 0