Skip to content

Instantly share code, notes, and snippets.

@miyakogi
Created May 17, 2016 12:00
Show Gist options
  • Save miyakogi/683467ed969d297250c638e44ba4c98a to your computer and use it in GitHub Desktop.
Save miyakogi/683467ed969d297250c638e44ba4c98a to your computer and use it in GitHub Desktop.
pythonのビルドに使ってるスクリプト
#!/usr/bin/env bash
cd cpython
make distclean
install_dir=$HOME/opt
# Install python2
version=2.7.11
pydir=$install_dir/python-$version
hg update -r v$version
./configure \
--prefix=$pydir \
--enable-shared \
LDFLAGS=-Wl,-rpath,$pydir/lib
make -j 4
make install
make distclean
# Install pip for python2
# curl -kL https://raw.github.com/pypa/pip/master/contrib/get-pip.py | \
# $pydir/bin/python
# Install python3
version=3.5.1
pydir=$install_dir/python-$version
hg update -r v$version
./configure \
--prefix=$pydir \
--enable-shared \
LDFLAGS=-Wl,-rpath,$pydir/lib
make -j 4
make install
if [ -e $pydir/bin/python ]; then
rm $pydir/bin/python
fi
ln -s $pydir/bin/python3 $pydir/bin/python
ln -s $pydir/bin/pip3 $pydir/bin/pip
make distclean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment