Re: [Gtk-osx-users] Bundling GTK into my App

On Sep 25, 2009, at 11:45 PM, John Pye wrote:

> Hi all
> I'm looking for any suggestions on how to about putting all the PyGTK
> and GTK dependencies for my program into its .app application  
> bundle. Is
> there an easy script that anyone's got that will pull in all the
> necessary files?
> It almost seems like the best way to do this would be to create a
> PyGTK.framework that could be reused by various PyGTK projects for  
> Mac...?
> How might this relate to the work that's been done up to now on  
> creating
> the GTK+ framework for use with XCode?
> What must/can I do as far as assuming a certain version of Python
> installed on the target system? If Python were to be updated, it would
> break PyGTK bindings...

 From what feedback we've gotten from other PyGtk devs, it's still  
mostly a manual process. I think that you can get pretty close by  
telling ige-mac-bundler that libpygtk.dylib (or whatever the top level  
shared library is called) is the main binary. Your setup shell script  
should set the PYTHON_PATH to somewhere in the bundle (the example  
script in ige-mac-bundler will show you how to get the bundle's path)  
and start your module.

Another approach, which I don't know if anyone has tried out, is to  
use py2app ( 
index.html). It is supposed to have the required smarts to find all of  
your python modules and their dependent libraries.

I think that to deal with the different versions of Python on  
different versions of OSX (2.3 on Tiger, 2.5 on Leopard, and 2.6 on  
Snow Leopard, plus the possibility that users may have installed  
MacPython of various versions) you should build Python with jhbuild  
and include it in the bundle.

Yes, a framework for PyGtk makes sense -- perhaps more sense than does  
one for C. I haven't had much time lately to work on the updated  
frameworks, which are now two major releases behind Gtk+.

John Ralls

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]