[cross posted to wxPython-mac, original messages are in wxPython-users]
Kevin Ollivier wrote:
[...bundlebuilder...]
I've made some modifications to this tool (patch submitted back to the Python project) that make it easy to add an icon to the bundle. The version I use in the Py2.3 build to make bundles of the Demo, PyShell, and etc. is located at this URL if you're interested:
http://cvs.wxwindows.org/viewcvs.cgi/wxPython/distrib/mac/Attic/ bundlebuilder.py
Cool, thanks! Now I just need to figure out how to make an icon that doesn't look cheesy on OS X. @_@
Yeah, it took me two days to make one for PyShell, but even so it doesn't look that good at smaller resolutions... http://www.xicons.com/ is a good source of premade OS X icons.
I've scoured most of the icon sites, but in most cases there are copyright issues with using them. However, checking back, I saw a set of 'copyleft' icons which look promising. =)
Eventually, it will allow you to build standalone apps,
It can already, but requires another module or two from Python 2.3, (modulefinder.py I think.)
I picked up modulefinder.py and I tried using "--standalone" (which finished without errors), but when running the app I got a "Bad Magic Number" error importing wxPython. I just haven't tracked it down yet. Could quite possibly be "operator error". =) I'm wondering if having two Pythons (Jaguar + Framework Python) is confusing it somehow and it's importing modules or maybe Python itself from Jaguar Python. In
It looks like when doing standalone that it copies the python executable out of Python.app or someplace into the bundle, my guess is that in your case it is getting the wrong one. I havn't looked to be sure how it finds which to copy there by default but I think there was an option to let you specify one yourself.
This was operator error. When I originally wrote the build script, I planned to "piggy-back" the .app off of Jaguar's installed Python. So I actually set executable=/usr/bin/python and set --sym-link. When I took sym-link off and changed it to standalone, I forgot to get rid of the reference to the old Python. ^_^; I was able to get it working, and I'll try to post some instructions so others can do this as well!
any case, I'll try to take a look at this sometime soon as I like the idea of being able to say "drag into Applications to install". =)
but for now you can configure it to use Jaguar's built-in python. Just copy in any modules (like wxPython) that do not come standard with Jaguar into the Resources folder of the bundle. You will still need to install the wxMac libraries on the user's system though. I'm not sure you can get around this, even with tools like >> bundlebuilder.
You can probably copy them into a folder inside the bundle, and then just ensure that the DYLIB_LIBRARY_PATH is set to this path in the little script created in .../Contents/MacOS. This part could easily be added to bundlebuilder.py. The tricky part would be getting it to automatically find nonstandard dynamic libraries that are needed so maybe that would just have to be handled by command-line options... If you hav etime to work on this it would be nice to get a patch to the Python folks before the 2.3beta so it can maybe make it into 2.3 > final.
Neat! I'll take a look and see what I can do. I think for now adding a "--dylib=/my/path/to/lib" would suffice.
You'll want to be able to specify more than one and more than just libs as wxMac loads the resources dynamically based on where the dylib is located. So it should probably append to a list for each --dylib parameter given, or accept a list of filenames if using buildapp() from a python script.
Done. You should have a patch in your inbox. =) The final name I chose was --lib, because it should also work on Frameworks.
Another thought I just had was I seem to recall reading somewhere that there is a location within the bundle that will automatically be checked for dylibs when the bundle.app is run. If so then bundlebuilder doesn't have to mess with the script at all, just copy the dylibs and such to the right place.
I checked into this, and it did look in a folder called "Frameworks" for both frameworks and dylibs. However, the bad news is that (for whatever reason) it did not pick up the wxMac libraries in here. Setting DYLD_LIBRARY_PATH equal to the "Content/Frameworks" folder did the trick though. =)
The only other way I could think of is to hook into distutils somehow, and pick up the libs from there. (In fact, in the long term, it probably makes sense to make bundlebuilder an extension of distutils.)
As py2exe and others have shown us the task of finding imported dynamic libraries is always a tricky and inexact science, so you will usually need a way to manually include or exclude them anyway, so you may as well start with that.
Yeah, in fact it missed some libraries in my app. What's interesting is that all the modules it missed (_xmlplus, encodings and conman - my own package) were not present in my main program, but inside conman. I'll bring this up with the MacPython folks to see if there isn't an easy solution.
[...]
weekend. BTW, that was something I was meaning to ask you. When we talk about wxPythonOSX, is it considered in a 'beta' state or on par with other distros now?
That's a good question... There are still a few things that are not quite as stable, or behave in minor unexpected ways, but it's getting lots closer to the other platforms.
I updated the documentation to say that it's in a 'beta' state, but that for the most part it works like the other platforms; it just needs more testing. I also sent you build instructions that use MacPython 2.3a1 if you want to use those. =)
Thanks,
Kevin
ยทยทยท
On Friday, January 31, 2003, at 02:04 PM, Robin Dunn wrote: