python3.sh 822 B

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