I have a small python program that depends only on wxPython. I developed this on Linux and I have managed to set up automatic build of a windows executable using wine on Travis CI (seguid_calculator on github).
My solution involves a combination of a recent wine release and Pyinstaller.
I would like to do a similar thing for MacOS. I understand that there is a MacOSX build environment on Travis as well. I have zero experience with the MacOSX os and I do not own a Mac. I have understood that you can install third party packages using something called "homebrew"
Is there an example out there for what I would like to do? An example travis.yml file would be great!
Thanks for any input, /Björn
* Edit *
I have created a sample wxpython app that only opens a window. It is located at https://github.com/BjornFJohansson/macapp. I uses the .travis.yml below which produces executables that do not work.
os:
- osx
language: objective-c
python:
- '2.7'
before_install:
- brew update
- brew outdated xctool || brew upgrade xctool
- brew install python
- brew install wxpython
- pip install pyinstaller
- pyinstaller --noconsole --onefile hw.py
- ls
- ls dist/
- hdiutil create dist/hw.dmg -srcfolder dist/ -ov
install: true
deploy:
skip_cleanup: true
provider: releases
api_key:
secure: VK1oVWQCRomgcFNVua00B3YSsotezzU1p6/fh73/0vwQFzVMolVnAsnfSq6EAwIcJvakU0TI9pqZR+0S3PKnUs+Kn3Ar8OwQ88t2azZNwewBfKua3tM2/7BF4y7O0gOtN1F29Yxyu0zPInIVY17BqGygibQ1kthBTm+tj3YyNW8=
file:
- "dist/hw"
- "dist/hw.dmg"
on:
tags: true
all_branches: true
repo: BjornFJohansson/macapp
basically, first I update xtools (I have seen many do this, so I decided to do it as well). Then I brew install python and wxpython. Then I pip install pyinstaller. I use the pyinstaller command which produces an executable (hw) and an "hw.app" folder under ./dist.
I didnt manage to deploy the .app folder, so I make a .dmg using hdiutil. I then deploy to github releases.
Could someone tell me what might be wrong with this set up?
The travis log can be found here : https://travis-ci.org/BjornFJohansson/macapp
The reason why it didn't work ist that the wxPython version installed via homebrew is not 32bit. You need to install the dmg from the wxPython homepage. I found a script that does that there: https://github.com/ayufan/travis-osx-vm-templates/blob/master/scripts/packages.sh
I forked your example and managed to get it running (https://github.com/paulmueller/macapp/releases).
.travis.yml now looks like this:
language: objective-c
python:
- '2.7'
before_install:
- which python
- brew install python --universal --framework
- brew install wget
- which python
- export VERSIONER_PYTHON_PREFER_32_BIT=yes
- defaults write com.apple.versioner.python Prefer-32-Bit -bool yes
- which python
- python --version
# https://github.com/Homebrew/homebrew/issues/34470
#- arch -i386 brew install wxpython --universal
- mkdir dl
- cd dl
- wget http://downloads.sourceforge.net/wxpython/wxPython3.0-osx-3.0.2.0-cocoa-py2.7.dmg
- ls
- cd ..
- sudo ./packages.sh
- arch -i386 python -c "import wx; print wx.__version__"
- arch -i386 pip install pyinstaller
- arch -i386 pyinstaller --noconsole --onefile hw.py
- ls
- hdiutil create dist/hw.dmg -srcfolder dist/ -ov
- zip -r dist/hw.zip dist/hw.app
- ls dist/
install: true
deploy:
provider: releases
skip_cleanup: true
api_key:
secure: KjdN4hSHWU3ZDg6lpDNMB2we9jLayM9C8pwyQrV/Xzq8HNH5eNHP8ScI64tvnS0yJegOXnHFwUhUrkMtEs3X29TKrom+8tJ5E52IdBO7xO8fqOfeugC2239vLzc3tNI6RJX/K7CZTsSRu5U++1RJVgcWYjrCln87DuXG+HZRdOI=
file:
- "dist/hw.dmg"
- "dist/hw.zip"
on:
tags: true
all_branches: true
repo: paulmueller/macapp
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments