python2.sh 798 B

1234567891011121314151617181920212223
  1. #!/bin/bash
  2. fw_installed py2 && return 0
  3. PY2_ROOT=$IROOT/py2
  4. PY2_VERSION=2.7.11
  5. fw_get -O http://www.python.org/ftp/python/${PY2_VERSION}/Python-${PY2_VERSION}.tar.xz
  6. fw_untar Python-${PY2_VERSION}.tar.xz
  7. cd Python-${PY2_VERSION}
  8. ./configure --prefix=${IROOT}/py2 --disable-shared --quiet
  9. make -j4 --quiet 2>&1 | tee $IROOT/python-install.log | awk '{ if (NR%100 == 0) printf "."}'
  10. make install --quiet 2>&1 | tee -a $IROOT/python-install.log | awk '{ if (NR%100 == 0) printf "."}'
  11. cd ..
  12. $PY2_ROOT/bin/python -m ensurepip -U
  13. $PY2_ROOT/bin/pip install -U setuptools pip wheel
  14. echo "export PY2_ROOT=${PY2_ROOT}" > $IROOT/py2.installed
  15. echo -e "export PYTHONHOME=\$PY2_ROOT" >> $IROOT/py2.installed
  16. echo -e "export PATH=\$PY2_ROOT/bin:\$PATH" >> $IROOT/py2.installed
  17. source $IROOT/py2.installed