Skip to content

Instantly share code, notes, and snippets.

@chssch
Last active December 10, 2016 23:55
Show Gist options
  • Save chssch/97ad196612e176f9e15773af02697c26 to your computer and use it in GitHub Desktop.
Save chssch/97ad196612e176f9e15773af02697c26 to your computer and use it in GitHub Desktop.

Requirements: xcode, homebrew

First get ayab and install requirements

Install QT 4.8

Since Qt4 is not supported anymore, brew is also ditching it from their formulas for newer macos versions, this one seems to work still.

brew tap cartr/qt4
brew tap-pin cartr/qt4
brew install qt
brew linkapps qt

Install PyQt4 from source (we need some dylibs later)

Install (configure, make, make install both sip and pyqt)

https://sourceforge.net/projects/pyqt/postdownload?source=dlp https://www.riverbankcomputing.com/software/pyqt/download

Install cxfreeze to convert py to app http://cx-freeze.sourceforge.net/

pip install cx_freeze

Use this setup_mac.py file in ayab/python:

from cx_Freeze import setup, Executable
import sys
sys.path.append('/Library/Python/2.7/site-packages/')
print(sys.path)
# Dependencies are automatically detected, but it might need
# fine tuning.
buildOptions = dict(packages = ['PyQt4'], includes=[])

import sys
base = 'Win32GUI' if sys.platform=='win32' else None

executables = [
    Executable('ayab_devel_launch.py', base=base)
]

setup(name='ayab',
      version = '0.9',
      description = 'ayab',
      options = dict(build_exe = buildOptions),
      executables = executables)


python setup_mac.py build

I had problems with the new mac os x System Integrity Protection, if you get access control errors (like Operation not permitted, even with sudo), you might have to disable it: http://osxdaily.com/2015/10/05/disable-rootless-system-integrity-protection-mac-os-x/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment