Skip to content

Instantly share code, notes, and snippets.

@paulwinex
Created April 20, 2020 08:32
Show Gist options
  • Save paulwinex/5b6f9d0e12371fec6b34860f0b8c1621 to your computer and use it in GitHub Desktop.
Save paulwinex/5b6f9d0e12371fec6b34860f0b8c1621 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bas
# start as SUDO
# install libs
apt-get install -y libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev curl
mkdir ~/build
# build ssl
cd ~/build
wget https://www.openssl.org/source/openssl-1.1.1f.tar.gz
tar xzf openssl-1.1.1f.tar.gz
cd openssl-1.1.1f
./config --prefix=${HOME}/openssl --openssldir=${HOME}/openssl
make
make test
make install
# build python
cd ~/build
wget https://www.python.org/ftp/python/3.7.7/Python-3.7.7.tgz
tar xzf Python-3.7.7.tgz
cd Python-3.7.7
export LD_LIBRARY_PATH=${HOME}/openssl/lib:$LD_LIBRARY_PATH
export LDFLAGS="-L${HOME}/openssl/lib"
export CPPFLAGS="-I${HOME}/openssl/include"
./configure --with-openssl=${HOME}/openssl LDFLAGS="-Wl,-rpath=${HOME}/openssl/lib -L${HOME}/openssl/lib" --with-address-sanitizer --with-undefined-behavior-sanitizer --with-pymalloc --with-ssl
make
make install
# check version
python3 -V
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment