Skip to content

Instantly share code, notes, and snippets.

@robdmc
Last active December 10, 2015 15:44
Show Gist options
  • Select an option

  • Save robdmc/97022d9b090259e5004b to your computer and use it in GitHub Desktop.

Select an option

Save robdmc/97022d9b090259e5004b to your computer and use it in GitHub Desktop.
install python with ucs4 unicode library
#! /usr/bin/env bash
# RUN THIS SCRIPT WITH SUDO !
# You should add the following the the `dependencies` section of your circle file
# cache_directories:
# - ./Python-2.7.9.tgz
# - ./Python-2.7.9
set -x
set -e
if [ "1114111" -ne `./venv/bin/python -c "import sys; print sys.maxunicode"` ]; then
if [ ! -e Python-2.7.9.tgz ]; then
wget https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz
fi
if [ ! -d Python-2.7.9 ]; then
tar -xvf Python-2.7.9.tgz
(cd Python-2.7.9 && ./configure --enable-shared --enable-unicode=ucs4 && make)
fi
(cd Python-2.7.9 && make install)
if [ -e /usr/local/bin/python ]; then
rm -rf ./venv && /home/ubuntu/.pyenv/shims/virtualenv venv -p /usr/local/bin/python
chown -R ubuntu:ubuntu ./venv
else
echo "cant find /usr/local/bin/python"
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment