python3.sh 910 B

1234567891011121314151617181920212223242526
  1. #!/bin/bash
  2. RETCODE=$(fw_exists ${IROOT}/py3.installed)
  3. [ ! "$RETCODE" == 0 ] || { \
  4. source $IROOT/py3.installed
  5. return 0; }
  6. PY3_ROOT=$IROOT/py3
  7. PY3_VERSION=3.5.1
  8. fw_get -O http://www.python.org/ftp/python/${PY3_VERSION}/Python-${PY3_VERSION}.tar.xz
  9. fw_untar Python-${PY3_VERSION}.tar.xz
  10. cd Python-${PY3_VERSION}
  11. ./configure --prefix=$PY3_ROOT --disable-shared --with-computed-gotos --quiet
  12. make -j4 --quiet 2>&1 | tee $IROOT/python3-install.log | awk '{ if (NR%100 == 0) printf "."}'
  13. make install --quiet 2>&1 | tee -a $IROOT/python3-install.log | awk '{ if (NR%100 == 0) printf "."}'
  14. cd ..
  15. $PY3_ROOT/bin/python3 -m ensurepip -U
  16. $PY3_ROOT/bin/pip3 install -U setuptools pip wheel
  17. echo "export PY3_ROOT=${PY3_ROOT}" > $IROOT/py3.installed
  18. echo -e "export PYTHONHOME=\$PY3_ROOT" >> $IROOT/py3.installed
  19. echo -e "export PATH=\$PY3_ROOT/bin:\$PATH" >> $IROOT/py3.installed
  20. source $IROOT/py3.installed