Skip to content

Instantly share code, notes, and snippets.

@amane-katagiri
Last active July 30, 2020 02:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amane-katagiri/1df71cd8677864f260ea3ffa96854be5 to your computer and use it in GitHub Desktop.
Save amane-katagiri/1df71cd8677864f260ea3ffa96854be5 to your computer and use it in GitHub Desktop.
パイソンのビルドは温かみのある手で
#!/bin/bash -ue
VERSION="$1"
sudo apt install build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev \
libjpeg-dev libncurses5-dev libncursesw5-dev liblzma-dev tk-dev xz-utils libffi-dev \
libgdbm-dev libdb-dev libffi-dev uuid-dev wget
cd /tmp
wget -O - "https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tgz" | tar zxvf -
cd "Python-$VERSION"
./configure --prefix="$HOME/usr" --enable-optimizations
make 2>&1 | tee make.log
set +e
if grep -A 3 "The necessary bits to build these optional modules were not found:" make.log 1>&2; then
echo "Add required packages and re-run ./configure and make." 1>&2
else
make install
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment