mirror of https://github.com/docker/compose.git
Make sure we use Python 2.7.9 and OpenSSL 1.0.1 when building OSX binary
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
parent
c571bb485d
commit
8ad11c0bc8
|
@ -1,5 +1,8 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
|
PATH="/usr/local/bin:$PATH"
|
||||||
|
|
||||||
rm -rf venv
|
rm -rf venv
|
||||||
virtualenv -p /usr/local/bin/python venv
|
virtualenv -p /usr/local/bin/python venv
|
||||||
venv/bin/pip install -r requirements.txt
|
venv/bin/pip install -r requirements.txt
|
||||||
|
|
|
@ -2,20 +2,51 @@
|
||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
|
python_version() {
|
||||||
|
python -V 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
|
openssl_version() {
|
||||||
|
python -c "import ssl; print ssl.OPENSSL_VERSION"
|
||||||
|
}
|
||||||
|
|
||||||
|
desired_python_version="2.7.9"
|
||||||
|
desired_python_brew_version="2.7.9"
|
||||||
|
python_formula="https://raw.githubusercontent.com/Homebrew/homebrew/1681e193e4d91c9620c4901efd4458d9b6fcda8e/Library/Formula/python.rb"
|
||||||
|
|
||||||
|
desired_openssl_version="1.0.1j"
|
||||||
|
desired_openssl_brew_version="1.0.1j_1"
|
||||||
|
openssl_formula="https://raw.githubusercontent.com/Homebrew/homebrew/62fc2a1a65e83ba9dbb30b2e0a2b7355831c714b/Library/Formula/openssl.rb"
|
||||||
|
|
||||||
|
PATH="/usr/local/bin:$PATH"
|
||||||
|
|
||||||
if !(which brew); then
|
if !(which brew); then
|
||||||
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
brew update
|
brew update
|
||||||
|
|
||||||
if [ ! -f /usr/local/bin/python ]; then
|
if !(python_version | grep "$desired_python_version"); then
|
||||||
brew install python
|
if brew list | grep python; then
|
||||||
|
brew unlink python
|
||||||
|
fi
|
||||||
|
|
||||||
|
brew install "$python_formula"
|
||||||
|
brew switch python "$desired_python_brew_version"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$(brew outdated | grep python)" ]; then
|
if !(openssl_version | grep "$desired_openssl_version"); then
|
||||||
brew upgrade python
|
if brew list | grep openssl; then
|
||||||
|
brew unlink openssl
|
||||||
|
fi
|
||||||
|
|
||||||
|
brew install "$openssl_formula"
|
||||||
|
brew switch openssl "$desired_openssl_brew_version"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "*** Using $(python_version)"
|
||||||
|
echo "*** Using $(openssl_version)"
|
||||||
|
|
||||||
if !(which virtualenv); then
|
if !(which virtualenv); then
|
||||||
pip install virtualenv
|
pip install virtualenv
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue