python3.sh 850 B

12345678910111213141516171819202122232425
  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. fw_get -O http://www.python.org/ftp/python/3.5.1/Python-3.5.1.tar.xz
  8. fw_untar Python-3.5.1.tar.xz
  9. cd Python-3.5.1
  10. ./configure --prefix=$PY3_ROOT --disable-shared --with-computed-gotos --quiet
  11. make -j4 --quiet 2>&1 | tee $IROOT/python3-install.log | awk '{ if (NR%100 == 0) printf "."}'
  12. make install --quiet 2>&1 | tee -a $IROOT/python3-install.log | awk '{ if (NR%100 == 0) printf "."}'
  13. cd ..
  14. $PY3_ROOT/bin/python3 -m ensurepip -U
  15. $PY3_ROOT/bin/pip3 install -U setuptools pip
  16. echo "export PY3_ROOT=${PY3_ROOT}" > $IROOT/py3.installed
  17. echo -e "export PYTHONHOME=\$PY3_ROOT" >> $IROOT/py3.installed
  18. echo -e "export PATH=\$PY3_ROOT/bin:\$PATH" >> $IROOT/py3.installed
  19. source $IROOT/py3.installed