Problems with ige-mac-bundle

Hello
Im having problems with creating app bundles, partly because I don't understand how it works.
As far as i know GTK+ cannot be statically linked.

I have installed and built GTK+ and ige-mac-* stuff as per instructions, The application that i would like to bundle is Gobby, http://en.wikipedia.org/wiki/Gobby

it appears that GTK+ was installed into ~/gtk

I have already integrated a menu into the source of this editor and Im very excited to make it into a bundle.

While waiting for your replies I will study the small amount of materials available on this topic. A great help would be if someone could give me instructions how to bundle a very simple application so I can wrap my head around the whole bundling process.

Thank you.

The bloody comment box is

The bloody comment box is getting smaller and smaller !

Anyway, I understand what you are saying about macports but currently there is no other way i can install all the dependencies other than by hand.

Currently i have traced the issue down to the pango atsui stuff. Im experimenting on gtk-demo binary. The one provided by jhbuild works while the one from macports has the "all text is squares" issue.

I suspect I've got to copy something to the bundle manually, But as i don't know what bundle script does, i don't know what to copy manually for pango.

(Another reason behind using macport's gtk is it can be build as universal to be used on intel macs as well as on PPC)

The "all text is squares"

The "all text is squares" issue simply means you built the X11 variant of Pango IIRC, try passing +quartz or something like this (i'm not too knowledgeable at macports, though i remember it's something like that)

Im quite sure my pango

Im quite sure my pango doesn't have anything to do with x11 (seen as i don't have any libraries that link to anything x11 related). I did indeed pass +quartz variant when i built not just pango, but also gtk2, cairo and cairomm.

I have squares problem only when i launch my application from the bundle. If i launch it from terminal like normal applications then everything works perfectly. This means that something is not copied to the bundle.

The way to solve this I think is to go through the bundler script and analyse what pango related stuff is being copied to the final bundle. I will do this when i get some free time, it will be hard as i will have to learn python while doing this.

The bundler is not meant to

The bundler is not meant to be used to macports, so it assume the pango module is built in, as the jhbuild setup does. I'm quite sure the macports build doesn't do that, so you need to set an environment variable and create the pango modules file to point to the module... Pango also needs to be patched so it can find the module from a relative path.

Have you looked at the

Have you looked at the examples in the bundler source and read the README? Links:

http://git.imendio.com/?p=projects/ige-mac-bundler.git;a=tree;f=examples...

http://git.imendio.com/?p=projects/ige-mac-bundler.git;a=blob;f=README;h...

You can also check how the application gossip is bundled at http://svn.gnome.org/viewvc/gossip/trunk/data/packaging/mac/

Thankyou, yes im reading the

Thankyou, yes im reading the README and I came on to several problems:

When trying to bundle giggle in examples folder there is an error asking for giggle binary, I assume I need giggle installed.
My machine is rather slow so Im still compiling giggle (and all its deps) through macports.

You have provided a link to an SVN repos, but what is the url that i can checkout?

You don't need giggle or

You don't need giggle or gossip, those are just other applications that serve as examples. The only thing you need is to create a bundle file and Info.plist file for your application.

If you take the giggle example bundle file and replace the name of the binary to your app's binary name, that should be a good start.

I would rather try to bundle

I would rather try to bundle giggle so I know I can do it in my environment, I have the binary and I get several errors:


/Developer/gobby/integration/ige-mac-bundler/examples$ ~/bin/ige-mac-bundler giggle.bundle
Warning, found X11 library dependency, you most likely don't want that: /usr/X11R6/lib/libSM.6.dylib
Warning, found X11 library dependency, you most likely don't want that: /usr/X11R6/lib/libICE.6.dylib
Warning, found X11 library dependency, you most likely don't want that: /usr/X11R6/lib/libX11.6.dylib
Traceback (most recent call last):
File "/Users/yarek/bin/ige-mac-bundler", line 6, in ?
bundler.main.main(sys.argv[1:])
File "/Developer/gobby/integration/ige-mac-bundler/bundler/main.py", line 18, in main
bundler.run()
File "/Developer/gobby/integration/ige-mac-bundler/bundler/bundler.py", line 469, in run
self.resolve_library_dependencies()
File "/Developer/gobby/integration/ige-mac-bundler/bundler/bundler.py", line 329, in resolve_library_dependencies
self.copy_binaries(new_libraries)
File "/Developer/gobby/integration/ige-mac-bundler/bundler/bundler.py", line 167, in copy_binaries
dest = self.copy_path(path)
File "/Developer/gobby/integration/ige-mac-bundler/bundler/bundler.py", line 197, in copy_path
print "Invalid bundle file, missing or invalid 'dest' property: " + Path.dest
TypeError: cannot concatenate 'str' and 'NoneType' objects

giggle was compiled without x11, I have no idea why the libs are there...

you can view my bundle file here temporarily: http://mr-ox.dynalias.org/giggle.bundle

The bundle file has the X11

The bundle file has the X11 prefix, which definitely is wrong, did you add that or is this some giggle file from macports? My giggle file does not have that. My guess is that some of the libraries you build giggle against link to X11, while they should't. You can check what libraries link to by running the tool otool, e.g.:

otool -L /opt/local/lib/libgtk-quartz-2.0.dylib

the same with executables:

otool -L /opt/local/bin/giggle

The bundler script uses this to see what libraries it needs to copy in to the bundler.

Generally, I try to avoid macports for creating bundles, since you really want to completely control the libraries you put into the bundle yourself.

Ok, i have built gobby from

Ok, i have built gobby from a git repository under the jhbuild shell, figuring that it will use the correct pkg-config this time..

Ok ive built it within the shell but i have major problems with the binary itself, it errors out with some Glib related problems, i suppose it wasnt such a good idea compiling it inside the jhbuild shell... however, the X11 library links are gone.

It does however make the bundle correctly !! just with all the libraries as absolute paths =/ this is slightly more confusing now...

To get it to bundle i have to remove a prefix /opt/local/ but without this prefix all the libraries have absolute paths. If i remove the prefix the ige-mac-bundle script throws warnings like this :

Warning, library not available in any prefix: /opt/local/lib/libxml++-2.6.2.dylib

If I add the prefix so that the libs will be copied i get this error:

print "Invalid bundle file, missing or invalid 'dest' property: " + Path.dest
TypeError: cannot concatenate 'str' and 'NoneType' objects

Can you shed some light on this please? I am so close because the compiled application runs only on my own system...

//EDIT:
To add abit more information into this post i have otooled the binary that was created after compilation in jhbuild shell:


/opt/local/lib/libxml++-2.6.2.dylib
/opt/local/lib/libgtkmm-2.4.1.dylib
/opt/local/lib/libgdkmm-2.4.1.dylib
/opt/local/lib/libatkmm-1.6.1.dylib
/opt/local/lib/libpangomm-1.4.1.dylib
/opt/local/lib/libcairomm-1.0.1.dylib
/opt/local/lib/libglibmm-2.4.1.dylib
/Users/yarek/gtk/inst/lib/libgthread-2.0.0.dylib
/opt/local/lib/libobby-0.4.1.dylib
/opt/local/lib/libnet6-1.3.0.dylib
/opt/local/lib/libgnutls.26.dylib
/opt/local/lib/libtasn1.3.dylib
/opt/local/lib/libgcrypt.11.dylib
/opt/local/lib/libgpg-error.0.dylib
/opt/local/lib/libsigc-2.0.0.dylib
/Users/yarek/gtk/inst/lib/libigemacintegration.0.dylib
/opt/local/lib/libgtksourceview-1.0.0.dylib
/Users/yarek/gtk/inst/lib/libgtk-quartz-2.0.0.dylib
/opt/local/lib/libgnomeprint-2-2.0.dylib
/Users/yarek/gtk/inst/lib/libgdk-quartz-2.0.0.dylib
/Users/yarek/gtk/inst/lib/libatk-1.0.0.dylib
/Users/yarek/gtk/inst/lib/libgdk_pixbuf-2.0.0.dylib
/Users/yarek/gtk/inst/lib/libpangocairo-1.0.0.dylib
/Users/yarek/gtk/inst/lib/libcairo.2.dylib
/opt/local/lib/libpangoft2-1.0.0.dylib
/opt/local/lib/libfreetype.6.dylib
/opt/local/lib/libz.1.dylib
/opt/local/lib/libfontconfig.1.dylib
/opt/local/lib/libart_lgpl_2.2.dylib
/opt/local/lib/libxml2.2.dylib
/Users/yarek/gtk/inst/lib/libpango-1.0.0.dylib
/usr/lib/libSystem.B.dylib
/Users/yarek/gtk/inst/lib/libgobject-2.0.0.dylib
/Users/yarek/gtk/inst/lib/libgmodule-2.0.0.dylib
/Users/yarek/gtk/inst/lib/libglib-2.0.0.dylib
/Users/yarek/gtk/inst/lib/libintl.8.dylib
/opt/local/lib/libiconv.2.dylib
/usr/lib/libstdc++.6.dylib
/usr/lib/libgcc_s.1.dylib

Note the paths starting with /Users/yarek/gtk/ or /usr/ do not show up as errors when bundling. I can only presume that compiling it to use all libraries from jhbuild directory? is this practical ? is there a way around it? whats going on anyway?

First, you don't have to run

First, you don't have to run it in jhbuild and use the gtk+ from your jhbuild build. The reason it complained when you didn't is that the bundle file you are using has "${env:PREFIX}" which refers to an environment variable that jhbuild sets. You can make the default prefix point to macports installation if you want.

Second, I don't know what glib warnings you are talking about as you don't tell me which they are.

A common issue is that most apps hardcode paths to their data files. This means that you almost always have to patch them so they can pick up their data like glade files, images, etc, from any path that is decided during runtime. So if gobby reads data files, you have to patch it to find those dynamically.

Im not sure if I understand

Im not sure if I understand correctly:
I can do several things: i can compile my gobby binary with different pkg-config paths, either from macports /opt/local/lib/pkgconfig or my native pkgconfig in /usr/local/lib/pkgconfig or jhbulid one at ~/gtk/inst/lib/pkgconfig

This changes what i see when i use otool -L on the final binary. if I use jhbuild's pkgconfig gtk+ is linked to ~/gtk/inst/lib/ directory, while if i use macports it links to /opt/local/

Right now compiled gobby normally though macports and in otool -L all path are /opt/local, yet the bundle script fails with the same error as above.

Would it help if I installed all the libraries to /usr/local/ ? this is somewhat difficult as mixing macports' libraries with system's libraries is not advised.

What more information can I provide to help diagnose the problem?

Is there a copy of your

Is there a copy of your latest bundle file so I can take a look?

Yes, the current version is

Yes, the current version is here: http://mr-ox.dynalias.org/gobby.bundle

Try removing the trailing

Try removing the trailing slashes in your paths (like in the prefix definitions). If that helps, I will make the bundler strip those automatically.

No that doesn't help. But i

No that doesn't help. But i think i found the source of the problem. As i built everything with macports it had some stray X11 dependencies. Its a pain to track them down but I think im managing. So far its quite hard to get GTK+ *not* to link against X11 (but then i can try jhbuild version), so as soon as ill get rid of all X11 deps i will call back with my results.
Thanks for the help so far.

OK, but please remove the

OK, but please remove the trailing slashes anyway because they might trip up the bundler once you have fixed the rest.

Ok, there are no trailing

Ok, there are no trailing slashes, i removed them as soon as i seen that another slash is added.

I have compiled gobby without any x11 dependencies, its been a long night =)
The binary is perfect, works perfectly on its own. It required me to install another installation of macports in /aux/local so this will be my prefix from now on. I have not used jhbuild's GTK so i don't think i need ~/gtk/inst anymore but the bundler kept poping up with this error :

Cannot find source to copy: /aux/local/lib/gtk-2.0/2.10.0/loaders/*.so

If i add the prefix to the bundle file it links to the wrong libraries.
if i copy the loaders manually i get bundler errors with the wrong path.

What are these loaders? can i not use them? can i install them manually?

My latest bundle file is here http://mr-ox.dynalias.org/gobby.bundle

I don't know how macports

I don't know how macports packages gtk+ (I really don't support using macports at all...), but when building with jhbuild, you get pixbuf loaders in the prefix you use under lib/gtk-2.0/2.10.0/loaders/. If macports put them somewhere else, the bundler will not work without modifications.

I have commented the line

I have commented the line about the /loaders/*.so and my app appears to bundle correctly, only there is a problem with fonts, all text is replaced by squares. Im aware that this is a pango problem but I dont know how to trace it.
I have found an old post on google about this problem with ige bundler but I have lost it since and cannot find it again.

i get this in the console when running the .app:


(gobby-bin:27920): Gtk-WARNING **: Locale not supported by C library.
Using the fallback 'C' locale.

(gobby-bin:27920): Pango-CRITICAL **: No modules found:
No builtin or dynamically loaded modules were found.
PangoFc will not work correctly.
This probably means there was an error in the creation of:
'/aux/local/etc/pango/pango.modules'
You should create this file by running:
pango-querymodules > '/aux/local/etc/pango/pango.modules'

(gobby-bin:27920): Pango-WARNING **: failed to find shape engine, expect ugly output. engine-type='PangoRenderATSUI', script='latin'

(gobby-bin:27920): Pango-WARNING **: failed to find shape engine, expect ugly output. engine-type='PangoRenderATSUI', script='common'

the current bundle file is in the same location as on my previous posts

Again, I really don't

Again, I really don't support using macports so I don't know how to get things going using macports. Make sure you have built pango with support for the cairo font backend, and that the resulting pango supports ATSUI. Also make sure that the bundle file (which has a reference to the atsui backend) points to the right path. The same for the loaders, you are not supposed to remove it from the bundle but to make sure that it points to the right path where gtk+ installs the loaders.