Update python version

This commit is contained in:
Dag Heyman 2017-04-21 12:51:06 +02:00
parent ca79a6c92f
commit 2fe285a0ac
No known key found for this signature in database
GPG Key ID: 06FC004369E7D338

View File

@ -34,14 +34,17 @@ install:
if [[ "$TRAVIS_OS_NAME" == "osx" ]]
then
git clone https://github.com/iltommi/macdeployqtfix.git
brew update
brew install qt5 swig
brew link qt5 -f
brew install ykpers libyubikey hidapi libu2f-host libusb
# Build Python 3 with --enable-framework, to be able to distribute it in a .app bundle
brew install pyenv
eval "$(pyenv init -)"
env PYTHON_CONFIGURE_OPTS="--enable-framework CC=clang" pyenv install 3.5.2
pyenv global system 3.5.2
env PYTHON_CONFIGURE_OPTS="--enable-framework CC=clang" pyenv install 3.6.1
pyenv global system 3.6.1
# Upgrade pip
pip3 install --upgrade pip
# Build and install PyOtherside
cd vendor/pyotherside
qmake
@ -85,16 +88,16 @@ after_success:
find /usr/local/Cellar/libu2f-host/ -name '*.dylib' -exec cp '{}' yubioath-desktop.app/Contents/Frameworks/ ';'
find /usr/local/Cellar/libusb/ -name '*.dylib' -exec cp '{}' yubioath-desktop.app/Contents/Frameworks/ ';'
# Copy Python framework
cp -a ~/.pyenv/versions/3.5.2/Python.framework yubioath-desktop.app/Contents/Frameworks/
cp -a ~/.pyenv/versions/3.6.1/Python.framework yubioath-desktop.app/Contents/Frameworks/
sudo find yubioath-desktop.app/Contents/Frameworks/Python.framework -name '*.pyc' -delete
sudo find yubioath-desktop.app/Contents/Frameworks/Python.framework -name '__pycache__' -delete
# Move pymodules from app bundle to site-packages, to be accepted by codesign
mv yubioath-desktop.app/Contents/MacOS/pymodules/* yubioath-desktop.app/Contents/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/
mv yubioath-desktop.app/Contents/MacOS/pymodules/* yubioath-desktop.app/Contents/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/
rm -d yubioath-desktop.app/Contents/MacOS/pymodules
# Fix stuff that macdeployqt does incorrectly.
sudo python macdeployqtfix/macdeployqtfix.py yubioath-desktop.app/Contents/MacOS/yubioath-desktop /usr/local
# Fix linking for PyOtherSide
sudo install_name_tool -change /Users/travis/.pyenv/versions/3.5.2/Python.framework/Versions/3.5/Python @executable_path/../Frameworks/Python.framework/Versions/3.5/Python yubioath-desktop.app/Contents/Resources/qml/io/thp/pyotherside/libpyothersideplugin.dylib
sudo install_name_tool -change /Users/travis/.pyenv/versions/3.6.1/Python.framework/Versions/3.6/Python @executable_path/../Frameworks/Python.framework/Versions/3.6/Python yubioath-desktop.app/Contents/Resources/qml/io/thp/pyotherside/libpyothersideplugin.dylib
# Create .pkg
pkgbuild --install-location /Applications --component yubioath-desktop.app yubioath-desktop-$TRAVIS_BRANCH-HEAD-mac.pkg
# Copy to deploy dir