{"action":"created","issue":{"url":"https://api.github.com/repos/shpakovski/MASShortcut/issues/81","labels_url":"https://api.github.com/repos/shpakovski/MASShortcut/issues/81/labels{/name}","comments_url":"https://api.github.com/repos/shpakovski/MASShortcut/issues/81/comments","events_url":"https://api.github.com/repos/shpakovski/MASShortcut/issues/81/events","html_url":"https://github.com/shpakovski/MASShortcut/issues/81","id":127226333,"number":81,"title":"add BridgeSupport generation to build","user":{"login":"glyph","id":716529,"avatar_url":"https://avatars.githubusercontent.com/u/716529?v=3","gravatar_id":"","url":"https://api.github.com/users/glyph","html_url":"https://github.com/glyph","followers_url":"https://api.github.com/users/glyph/followers","following_url":"https://api.github.com/users/glyph/following{/other_user}","gists_url":"https://api.github.com/users/glyph/gists{/gist_id}","starred_url":"https://api.github.com/users/glyph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glyph/subscriptions","organizations_url":"https://api.github.com/users/glyph/orgs","repos_url":"https://api.github.com/users/glyph/repos","events_url":"https://api.github.com/users/glyph/events{/privacy}","received_events_url":"https://api.github.com/users/glyph/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-18T13:27:31Z","updated_at":"2016-01-18T14:14:44Z","closed_at":null,"body":"I was able to use MASShortcut almost immediately from Python, but first I had to do this:\r\n\r\n`gen_bridge_metadata -f ./MASShortcut.framework | sed -e \"s/function_pointer='true'/block='true'/g\" > MASShortcut.framework/Resources/BridgeSupport/MASShortcut.bridgesupport`\r\n\r\nIt would be nice if this were built in to the framework.  (I'm also not sure if a nicer way to do that `sed` exists...)"},"comment":{"url":"https://api.github.com/repos/shpakovski/MASShortcut/issues/comments/172537276","html_url":"https://github.com/shpakovski/MASShortcut/issues/81#issuecomment-172537276","issue_url":"https://api.github.com/repos/shpakovski/MASShortcut/issues/81","id":172537276,"user":{"login":"glyph","id":716529,"avatar_url":"https://avatars.githubusercontent.com/u/716529?v=3","gravatar_id":"","url":"https://api.github.com/users/glyph","html_url":"https://github.com/glyph","followers_url":"https://api.github.com/users/glyph/followers","following_url":"https://api.github.com/users/glyph/following{/other_user}","gists_url":"https://api.github.com/users/glyph/gists{/gist_id}","starred_url":"https://api.github.com/users/glyph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glyph/subscriptions","organizations_url":"https://api.github.com/users/glyph/orgs","repos_url":"https://api.github.com/users/glyph/repos","events_url":"https://api.github.com/users/glyph/events{/privacy}","received_events_url":"https://api.github.com/users/glyph/received_events","type":"User","site_admin":false},"created_at":"2016-01-18T14:14:43Z","updated_at":"2016-01-18T14:14:43Z","body":"The steps are pretty straightforward.  A post-build script that runs that exact command should do it.  (You lucked out; some frameworks require extensive, weird post-processing to speak Python's dialect of BridgeSupport, but MASShortcut seems like it's in good shape out of the box.)\r\n\r\nThe next step is you have to create a Python package that describes the framework.  I put the following into `build/Release` right next to `MASShortcut.py`:\r\n\r\n```python\r\nimport objc as _objc\r\n__bundle__ = _objc.initFrameworkWrapper(\r\n    __name__,\r\n    frameworkIdentifier=\"com.github.shpakovski.MASShortcut\",\r\n    frameworkPath=_objc.pathForFramework(\"MASShortcut.framework\"),\r\n    globals=globals()\r\n)\r\n```\r\n\r\nThis should work out-of-the-box with system python, but if it needs a new pyobjc for some reason, `python -m ensurepip --user && python -m pip install --user pyobjc` should build and install all the relevant dependencies.\r\n\r\nYou can then package this using http://pythonhosted.org/py2app/ by specifying `MASShortcut` as a required framework; it'll bundle it in to the app bundle automatically."}}