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"
|
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
|
|
|
|
|
|
|
|
if [[ -e $BINDIR/.bootstrapped ]]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2019-01-02 14:17:20 +00:00
|
|
|
PYPY_VERSION=v6.0.0
|
2015-12-30 21:15:18 +00:00
|
|
|
|
2019-01-02 14:17:20 +00:00
|
|
|
wget -O - https://bitbucket.org/pypy/pypy/downloads/pypy3-$PYPY_VERSION-linux64.tar.bz2 | tar -xjf -
|
|
|
|
mv -n pypy3-$PYPY_VERSION-linux64 pypy3
|
2015-12-30 21:15:18 +00:00
|
|
|
|
|
|
|
## library fixup
|
2019-01-02 14:17:20 +00:00
|
|
|
mkdir -p pypy3/lib
|
2018-07-27 14:34:36 +00:00
|
|
|
if [ -f /lib64/libncurses.so.5.9 ]; then
|
2019-01-02 14:17:20 +00:00
|
|
|
ln -snf /lib64/libncurses.so.5.9 $BINDIR/pypy3/lib/libtinfo.so.5
|
2018-07-27 14:34:36 +00:00
|
|
|
elif [ -f /lib64/libncurses.so.6.1 ]; then
|
2019-01-02 14:17:20 +00:00
|
|
|
ln -snf /lib64/libncurses.so.6.1 $BINDIR/pypy3/lib/libtinfo.so.5
|
2018-07-27 14:34:36 +00:00
|
|
|
fi
|
2015-12-30 21:15:18 +00:00
|
|
|
|
|
|
|
cat > $BINDIR/python <<EOF
|
|
|
|
#!/bin/bash
|
2019-01-02 14:17:20 +00:00
|
|
|
LD_LIBRARY_PATH=$BINDIR/pypy3/lib:$LD_LIBRARY_PATH exec $BINDIR/pypy3/bin/pypy3 "\$@"
|
2015-12-30 21:15:18 +00:00
|
|
|
EOF
|
|
|
|
|
|
|
|
chmod +x $BINDIR/python
|
|
|
|
$BINDIR/python --version
|
|
|
|
|
|
|
|
touch $BINDIR/.bootstrapped
|