[Pythonmac-SIG] sanity checks: building MacOS X app

Jason Petrone jpetrone@cnri.reston.va.us
Tue, 25 Feb 2003 17:22:12 -0500


On Tue, Feb 25, 2003 at 10:50:34PM +0100, Just van Rossum wrote:
> Jack Jansen wrote:
> > Yes, you should be able to get this to work, but you will have to
> > build the Python.framework yourself. I've been looking at creating
> > the framework in such a way that it would allow just copying 
> > /Library/Frameworks/Python.framework
> > into a private frameworks directory, but I haven't gotten it to work.
> > (Or, in other words: if you *did* get this to work I would be very
> > interested).
> > 
> > If you could write a howto document for doing this that would be very
> > helpful, I'd love to put such information on the MacPython website.
> 
> My request would be simpler: write it down in simple steps so I can
> automate it in bundlebuilder.py ;-)

I've been distributing a package from a framework build.  I might be
doing something silly, but it works.  I'm also using wxWindows, not
Tkinter.

Basically, I just use bundlebuilder.py, but with three minor changes:

0) Under MyApp.app/Contents/MacOS I create a directory 'lib' and copy
   any libraries needed(in my case, /usr/local/lib/libwx_mac-2.4*)

1) Under that new lib dir I also create a subdirectory
   /Python.framework/Versions/2.3 and copy
   /Library/Frameworks/Python.framework/Versions/2.3/Python to it.

2) I add the following lines to the start script generated by bundlebuilder:
    DYLD_LIBRARY_PATH=${execdir}/lib
    export DYLD_LIBRARY_PATH
    DYLD_FRAMEWORK_PATH=${execdir}/lib
    export DYLD_FRAMEWORK_PATH

Seems to work fine, and be fully portable.  The dmg I distribute is 9MB,
vs. 6MB for my win32 pyexe version.

Hope we're talking about the same thing here...

Jason