Shrihari Sankaran wrote:

>> It's not possible to fit the new "@executable_path/../" style paths to
>> where the "/opt/gtk/" used to be, without relinking all the libraries.
>> 
>> i.e. using the ld(1) flag of -headerpad_max_install_names to make sure
>> that all paths are padded to MAXPATHLEN for later install_name_tool use
>> 
>> > Now, I have a proper PyGTK app that runs perfectly fine. I need a way to 
>> > bundle it properly.
>> 
>> You might want to look at: http://live.gnome.org/GTK%2B/OSX/Bundling ?
>> That is the official way to build and bundle PyGTK and Python on OS X.
>> 
> I did check out GTK-OSX. But, they don't seem to have much documentation for 
> PyGTK. And, I'm not very familiar with what happens when an App bundle is to 
> be built.

The app bundle itself isn't much, it's just a directory structure:

YourApp.app
└── Contents
    ├── Info.plist
    ├── MacOS
    │   └── yourapp
    └── Resources
        └── yourapp.icns

The tricky part is when using an interpreted language like Python,
and including all the libraries used (like GTK+) inside the bundle.
In order to use a relative path, like "@executable_path/../*", one
also has to include the interpreter - in this case a "python" binary.

That's the magic that the "ige-mac-bundler" helper is doing for you.

But the app bundle isn't all that different from a .desktop file,
and the executable and icon associated with that, just that it is
using the XML .plist format rather than the INI .desktop format
and that it uses an Application Directory rather than a hier(7) ?

You'd have the same issues bundling PyGTK and Python on other OSes.

> I even followed Winswitch's instructions at 
> http://winswitch.org/dev/macosx.html. But I'm stuck after the "jhbuild build" 
> step. I just went ahead and executed my application from inside the jhbuild 
> shell. I got a huge list of errors: http://pastebin.com/78AMZ3Tg - I couldn't 
> make head or tail of it.
> 
> Should I install gtk-osx after removing /opt/gtk? It would be great if 
> someone could come up with a PyGTK-specific guide for building and bundling 
> apps using GTK-OSX.

I think the procedure at http://live.gnome.org/GTK%2B/OSX/Building
is rather clear on how to build using the GTK-OSX system (JHBuild) ?

There's additional stuff at http://live.gnome.org/GTK%2B/OSX/Python,
do note that gtk-osx.sourceforge.net is moving to gtk.org/gnome.org!



The stand-alone installation was for just using PyGTK without having
to build and bundle it, similar to using it on Windows (or Linux) ?
So there were no important differences or patches done, and all the
development on GTK+ 3, or Integration, or whatever, happens elsewhere.

But if it's just that linker issue that is stopping you from using
the all-in-one bundle, it would be possible to do a relocatable one...
(one does have to patch a few other packages, to not hardcode paths)
I could take a look at it, after transitioning to the new project*.

* The PyGTK.pkg got relocated to: http://macpkg.sourceforge.net/
It also got upgraded from 2.22 to 2.24, and had Lion support added.
That is, it supports 32-bit and 64-bit Python 2.5, 2.6 and 2.7 on
Mac OS X 10.5 Leopard and above - but it is (not yet?) relocatable.

The patches are in https://bugzilla.gnome.org/show_bug.cgi?id=658772
for the --enable-quartz-relocation option when building gtk+ itself.
The "problem" is that it's still a compile-time setting, so you can't
just go around tweaking it later (with something like py2app) anyway!

--anders

_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to