Re: [Pythonmac-SIG] How to make py2app app stub link to Cocoa framework?
On 31 Mar, 2013, at 3:28, Kevin Walzer k...@codebykevin.com wrote: On 3/30/13 7:37 PM, sameer wrote: Does anyone have any hints about how I can make this work? I am new to Mac Apps and sandboxing. This appears to be the error: 3/30/13 7:04:02.050 PM [0x0-0xb15b15].com.falkorsystems.defisheye: ImportError: dlopen(/Users/sameer/Documents/Falkor Systems/gopro_calibration/DeFisheye/dist/DeFisheye.app/Contents/Resources/lib/python2.7/lib-dynload/cv2.so, 2): Library not loaded: /usr/X11/lib/libpng15.15.dylib 3/30/13 7:04:02.050 PM [0x0-0xb15b15].com.falkorsystems.defisheye: Referenced from: /Users/sameer/Documents/Falkor Systems/gopro_calibration/DeFisheye/dist/DeFisheye.app/Contents/MacOS/../Frameworks/libopencv_highgui.2.4.4.dylib 3/30/13 7:04:02.050 PM [0x0-0xb15b15].com.falkorsystems.defisheye: Reason: no suitable image found. Did find: 3/30/13 7:04:02.050 PM [0x0-0xb15b15].com.falkorsystems.defisheye: /usr/X11/lib/libpng15.15.dylib: open() failed with errno=1 3/30/13 7:04:02.119 PM DeFisheye: DeFisheye Error Some linking error to libpng, apparently. This wouldn't seem to have anything to do with the Cocoa linking issue in py2app. Right. This appears to be an issue with copying shared libraries into the application bundle, py2app is supposed to recursively copy all libraries used into the bundle and rewrite the load commands, but for some reason han't done so for the dependencies of libopencv_highgui.2.4.4.dylib. There is little I can do about this without a script to reproduce the problem. Ronald --Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
Re: [Pythonmac-SIG] How to make py2app app stub link to Cocoa framework?
Hello all. I'm trying to make a Mac App using py2app that will go on the Mac App store. I enabled sandboxing and now my app crashes. I noticed on the py2app bitbucket issue #85 https://bitbucket.org/ronaldoussoren/py2app/issue/85/sandboxing-interaction-issue which led me to find this thread about linking Cocoa. I applied the following patch to my py2app And now when I launch my app it still crashes with the following errors (which is the same as before I did the LDFLAGS change): Does anyone have any hints about how I can make this work? I am new to Mac Apps and sandboxing. Thanks, -s -- View this message in context: http://python.6.n6.nabble.com/How-to-make-py2app-app-stub-link-to-Cocoa-framework-tp2157525p5012541.html Sent from the Python - pythonmac-sig mailing list archive at Nabble.com. ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
Re: [Pythonmac-SIG] How to make py2app app stub link to Cocoa framework?
On 3/30/13 7:37 PM, sameer wrote: Does anyone have any hints about how I can make this work? I am new to Mac Apps and sandboxing. This appears to be the error: 3/30/13 7:04:02.050 PM [0x0-0xb15b15].com.falkorsystems.defisheye: ImportError: dlopen(/Users/sameer/Documents/Falkor Systems/gopro_calibration/DeFisheye/dist/DeFisheye.app/Contents/Resources/lib/python2.7/lib-dynload/cv2.so, 2): Library not loaded: /usr/X11/lib/libpng15.15.dylib 3/30/13 7:04:02.050 PM [0x0-0xb15b15].com.falkorsystems.defisheye: Referenced from: /Users/sameer/Documents/Falkor Systems/gopro_calibration/DeFisheye/dist/DeFisheye.app/Contents/MacOS/../Frameworks/libopencv_highgui.2.4.4.dylib 3/30/13 7:04:02.050 PM [0x0-0xb15b15].com.falkorsystems.defisheye: Reason: no suitable image found. Did find: 3/30/13 7:04:02.050 PM [0x0-0xb15b15].com.falkorsystems.defisheye: /usr/X11/lib/libpng15.15.dylib: open() failed with errno=1 3/30/13 7:04:02.119 PM DeFisheye: DeFisheye Error Some linking error to libpng, apparently. This wouldn't seem to have anything to do with the Cocoa linking issue in py2app. --Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
Re: [Pythonmac-SIG] How to make py2app app stub link to Cocoa framework?
On 9 Nov, 2011, at 5:41, Kevin Walzer wrote: I've been trying to get one of my Python-Tk applications to integrate with Lion's sandboxing framework (for Mac App Store submission) and have been having difficulty. Based on some feedback I received in the Apple Developer forums, it appears that part of the issue is that the executable stub created by py2app does not link to the Cocoa frameworks. What kind of problem did you run into? Are those something that can be easily reproduced by signing a trivial application? A quick run of otool -L confirms this: Kevin-Walzers-MacBook:~ kevin$ otool -L /Users/kevin/Programming/quickwho/cbk/QuickWho.app/Contents/MacOS/QuickWho /Users/kevin/Programming/quickwho/cbk/QuickWho.app/Contents/MacOS/QuickWho: /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 832.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.10) Is there any way I can get this executable linked to /System/Library/Frameworks/Cocoa.framework? I didn't think install_name_tool would do the trick, as that just rewrites links, rather than adding them. A Any suggestions are appreciated. You'll have to rebuild the stubs, and as you already noticed you can do this by patching the setup.py in py2app/apptemplate. BTW. The reason py2app doesn't link with Cocoa is to avoid Cocoa's triggering backward compatibility modes. That is, when you link to Cocoa.framework with the 10.4 SDK a number of classes will behave slightly different than they do when linking to the 10.6 SDK. The precisedetails elude me at the moment though. It might be useful to add separate stubs for codesigning (possibly with additional flags in py2app to trigger codesigning from your setup.py file), or even replace the current stubs by ones that link to the Cocoa frameworks. Ronald --Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG smime.p7s Description: S/MIME cryptographic signature ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
Re: [Pythonmac-SIG] How to make py2app app stub link to Cocoa framework?
On 11/10/11 5:39 AM, Ronald Oussoren wrote: What kind of problem did you run into? Are those something that can be easily reproduced by signing a trivial application? It wouldn't display a save dialog. Under the hood Tkinter/Tk's save dialog calls into NSSavePanel. In a sandboxed app, the call to NSSavePanel is supposed to be intercepted by the Powerbox (sandbox save dialog), but no dialog would display. You'll have to rebuild the stubs, and as you already noticed you can do this by patching the setup.py in py2app/apptemplate. BTW. The reason py2app doesn't link with Cocoa is to avoid Cocoa's triggering backward compatibility modes. That is, when you link to Cocoa.framework with the 10.4 SDK a number of classes will behave slightly different than they do when linking to the 10.6 SDK. The precisedetails elude me at the moment though. It might be useful to add separate stubs for codesigning (possibly with additional flags in py2app to trigger codesigning from your setup.py file), or even replace the current stubs by ones that link to the Cocoa frameworks. Rebuilding the stubs was easy enough to do, and sufficient for my needs, but if you decide to add this capability to py2app, I'm sure other folks would find it useful. --Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
Re: [Pythonmac-SIG] How to make py2app app stub link to Cocoa framework?
On 11/8/11 11:41 PM, Kevin Walzer wrote: Is there any way I can get this executable linked to /System/Library/Frameworks/Cocoa.framework? I didn't think install_name_tool would do the trick, as that just rewrites links, rather than adding them. A Any suggestions are appreciated. I solved the problem by hacking the setup.py file in apptemplates (in the py2app source tree) to add an LDFLAGS parameter with a '-framework Cocoa' linker flag. Ugly, but it meets my needs. Probably not worth it to submit a patch. -- Kevin Walzer Code by Kevin http://www.codebykevin.com ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
[Pythonmac-SIG] How to make py2app app stub link to Cocoa framework?
I've been trying to get one of my Python-Tk applications to integrate with Lion's sandboxing framework (for Mac App Store submission) and have been having difficulty. Based on some feedback I received in the Apple Developer forums, it appears that part of the issue is that the executable stub created by py2app does not link to the Cocoa frameworks. A quick run of otool -L confirms this: Kevin-Walzers-MacBook:~ kevin$ otool -L /Users/kevin/Programming/quickwho/cbk/QuickWho.app/Contents/MacOS/QuickWho /Users/kevin/Programming/quickwho/cbk/QuickWho.app/Contents/MacOS/QuickWho: /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 832.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.10) Is there any way I can get this executable linked to /System/Library/Frameworks/Cocoa.framework? I didn't think install_name_tool would do the trick, as that just rewrites links, rather than adding them. A Any suggestions are appreciated. --Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG