You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
740 B

  1. #!/bin/bash
  2. set -e
  3. BINDIR="/opt/bin"
  4. mkdir -p $BINDIR
  5. cd $BINDIR
  6. if [[ -e $BINDIR/.bootstrapped ]]; then
  7. exit 0
  8. fi
  9. PYPY_VERSION=5.1.0
  10. wget -O - https://bitbucket.org/pypy/pypy/downloads/pypy-$PYPY_VERSION-linux64.tar.bz2 |tar -xjf -
  11. mv -n pypy-$PYPY_VERSION-linux64 pypy
  12. ## library fixup
  13. mkdir -p pypy/lib
  14. if [ -f /lib64/libncurses.so.5.9 ]; then
  15. ln -snf /lib64/libncurses.so.5.9 $BINDIR/pypy/lib/libtinfo.so.5
  16. elif [ -f /lib64/libncurses.so.6.1 ]; then
  17. ln -snf /lib64/libncurses.so.6.1 $BINDIR/pypy/lib/libtinfo.so.5
  18. fi
  19. cat > $BINDIR/python <<EOF
  20. #!/bin/bash
  21. LD_LIBRARY_PATH=$BINDIR/pypy/lib:$LD_LIBRARY_PATH exec $BINDIR/pypy/bin/pypy "\$@"
  22. EOF
  23. chmod +x $BINDIR/python
  24. $BINDIR/python --version
  25. touch $BINDIR/.bootstrapped