Kevin Ollivier wrote:
Is it possible to use freeze to use a wxPython application on a MacOSX
box that doesn't have python installed? My attempt to do so resulted in
the following:MacPython has it's own tools for building standalone applications, but Mac OS X versions are still in development. However, it is currently possible to build an application that uses Jaguar's built-in Python so the user doesn't need to install Python themselves.
To do this, you'll need MacPython 2.3a1, which you can download from the wxPython SF site. (It's at the bottom of the page.) The script you're looking for is "bundlebuilder.py", and it will be located at: /Library/Frameworks/Python.framework/Versions/2.3/lib/python-2.3/plat- mac/bundlebuilder.py.I've made some modifications to this tool (patch submitted back to the Python project) that make it easy to add an icon 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. @_@
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 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 DYNLIB_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. 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.)
If you are running Jaguar and want to see an example of all this, I've created a ".app" bundle from a wxPython application I have been working on. To see it, go to http://www.eclass.net/download.html and click on the "for Mac" link. The installer installs the wxMac libraries and copies the EClass.Builder program to /Applications. It is totally transparent that the application was built in Python, and for most purposes, it looks and acts like a native Mac application. =) If you want, I can also send you the bundlebuilder script I use to package up this application, but I actually have to update it to work with Robin's 2.3a1 distribution.
If you could write a page for the wiki that describes why you did what you did, and some examples of how to do it I would really appreciate it.
I've been thinking about that. =) The wxPythonOSX documentation needs a major update anyways, so I'll try to put a couple hours in this 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?
Thanks,
Kevin
ยทยทยท
On Friday, January 31, 2003, at 12:17 PM, Robin Dunn wrote:
On Thursday, January 30, 2003, at 11:32 AM, Brian Victor wrote:
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org