RSS/Atom feed Twitter
Site is read-only, email is disabled

OSX app-bundle-ability of gimp and other gtk2 apps

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

9 of 10 messages available
Toggle history

Please log in to manage your subscriptions.

OSX app-bundle-ability of gimp and other gtk2 apps Kurt Bigler 19 Aug 08:38
  OSX app-bundle-ability of gimp and other gtk2 apps Sven Neumann 19 Aug 10:14
  OSX app-bundle-ability of gimp and other gtk2 apps Martin Costabel 19 Aug 18:52
   OSX app-bundle-ability of gimp and other gtk2 apps Brion Vibber 19 Aug 19:35
    OSX app-bundle-ability of gimp and other gtk2 apps Martin Costabel 19 Aug 22:14
     OSX app-bundle-ability of gimp and other gtk2 apps Brion Vibber 19 Aug 23:34
     OSX app-bundle-ability of gimp and other gtk2 apps Sven Neumann 19 Aug 23:45
      OSX app-bundle-ability of gimp and other gtk2 apps Martin Costabel 20 Aug 09:29
Pine.BSF.4.58.0408201455510... 07 Oct 20:23
  OSX app-bundle-ability of gimp and other gtk2 apps Kurt Bigler 21 Aug 01:27
Kurt Bigler
2004-08-19 08:38:58 UTC (over 19 years ago)

OSX app-bundle-ability of gimp and other gtk2 apps

I am porting a GTK+-2.0 -based application to OS X as an X11 application. I was trying to ship the app as an OS X "application bundle" with all non-system shared libraries included within the app bundle.

I originally planned on achieving this based on someone's suggestion of using the otool -L output to drive a script that uses install_name_tool to permit me to relocate the shared libraries to a different directory, also utilizing the @executable_path mechanism to permit the new directory to be located inside the app bundle.

Upon attempting to do this I ran into some problems and posted a question to the darwinports mailing list (because I currently build GTK+-2.0 via the darwinports "gtk2" port). Someone replied to my query with the information that the GIMP application had achieved the application-bundle-relative situation that I have been trying to achieve.

So I'm posting this question here not to find out more about how GIMP achieved that and whether it will be easy for me to do the same thing GIMP did in the gtk app that I am porting, and whether I can continue to use darwinports to do my build or whether I need to go another route. I am hoping that it is a simple matter of configuring the gtk build differently (something I'm hoping darwinports will allow) and that little or no application source changes are needed to support this. I'd be glad to switch from darwinports if necessary as long as there is a known way to do the build. Prior to using darwinports I spent a whole month trying to do the build and failed miserably.

I have already ironed out the problems of creating an X11 application bundle (with a helper app that launches the real x11 app), so I need no help with that part.

So the problems lie with allowing the shared libraries to exist within the app bundle, *plus* any other files (e.g. stuff in an etc directory) that gtk2 or any of its components require. Actually I *might* have the library side of the problem solved although I can't be sure that I have covered all of the code that might load libraries (possibly in the form of plugins) at run-time, possibly based on hard-coded constant pathnames. But for sure I have some "etc" problems. These are the errors I am currently getting:

(scalamod:1650): GdkPixbuf-WARNING **: Can not open pixbuf loader module file '/opt/local/etc/gtk-2.0/gdk-pixbuf.loaders': No such file or directory

(scalamod:1650): GdkPixbuf-WARNING **: Error loading XPM image loader: Image type 'xpm' is not supported
Fontconfig error: Cannot load default config file No fonts found; this probably means that the fontconfig library is not correctly configured. You may need to edit the fonts.conf configuration file. More information about fontconfig can be found in the fontconfig(3) manual page and on http://fontconfig.org

I am hoping that someone here has been through the whole gamut of possible problems and has come up with a complete solution for relocating gtk2 and all its required libraries and associated data into an app bundle.

Just in case it is relevant I'll mention that the app is written in Ada and utilizes the gtkada glue layer over gtk2.

Thanks for any help.

-Kurt Bigler

Sven Neumann
2004-08-19 10:14:13 UTC (over 19 years ago)

OSX app-bundle-ability of gimp and other gtk2 apps

Hi,

Kurt Bigler writes:

Upon attempting to do this I ran into some problems and posted a question to the darwinports mailing list (because I currently build GTK+-2.0 via the darwinports "gtk2" port). Someone replied to my query with the information that the GIMP application had achieved the application-bundle-relative situation that I have been trying to achieve.

See http://gimp-app.sourceforge.net/ (linked from http://gimp.org/macintosh/). There's a script linked from that page that is used to build the application bundle. That should answer your questions.

But for sure I have some "etc" problems. These are the errors I am currently getting:

(scalamod:1650): GdkPixbuf-WARNING **: Can not open pixbuf loader module file '/opt/local/etc/gtk-2.0/gdk-pixbuf.loaders': No such file or directory

You need to run gdk-pixbuf-query-loaders to create this file. Usually this is done when 'make install' is being run for gtk+.

Fontconfig error: Cannot load default config file No fonts found; this probably means that the fontconfig library is not correctly configured. You may need to edit the fonts.conf configuration file. More information about fontconfig can be found in the fontconfig(3) manual page and on http://fontconfig.org

That error message contains the answer to your problem.

Sven

Martin Costabel
2004-08-19 18:52:23 UTC (over 19 years ago)

OSX app-bundle-ability of gimp and other gtk2 apps

Kurt Bigler wrote:
[]

So I'm posting this question here not to find out more about how GIMP achieved that and whether it will be easy for me to do the same thing GIMP did in the gtk app that I am porting, and whether I can continue to use darwinports to do my build or whether I need to go another route. I

If you download the gimp-app bundle, you find a couple of scripts inside that show tricks with which you can achieve some of these things. In particular, it shows the use of environment variables like FONTCONFIG_PATH, DYLD_LIBRARY_PATH, GDK_PIXBUF_MODULE_FILE and some others.

AFAICT the whole gtk stuff is just taken from Fink.

am hoping that it is a simple matter of configuring the gtk build differently (something I'm hoping darwinports will allow) and that little or no application source changes are needed to support this. I'd be glad to switch from darwinports if necessary as long as there is a known way to do the build. Prior to using darwinports I spent a whole month trying to do the build and failed miserably.

Unfortunately, gimp-app does not give any information whether the gtk build needed to be configured differently. If gimp-app were open source in the sense of the GPL (which it pretends to be but isn't), you could just look at the sources from which it was built and see for yourself.

Brion Vibber
2004-08-19 19:35:13 UTC (over 19 years ago)

OSX app-bundle-ability of gimp and other gtk2 apps

Martin Costabel wrote:

Unfortunately, gimp-app does not give any information whether the gtk build needed to be configured differently. If gimp-app were open source in the sense of the GPL (which it pretends to be but isn't), you could just look at the sources from which it was built and see for yourself.

If you believe something is missing from the package, please e-mail Aaron Voisine and ask him about it.

-- brion vibber (brion @ pobox.com)

Martin Costabel
2004-08-19 22:14:55 UTC (over 19 years ago)

OSX app-bundle-ability of gimp and other gtk2 apps

Brion Vibber wrote:

Martin Costabel wrote:

Unfortunately, gimp-app does not give any information whether the gtk build needed to be configured differently. If gimp-app were open source in the sense of the GPL (which it pretends to be but isn't), you could just look at the sources from which it was built and see for yourself.

If you believe something is missing from the package, please e-mail Aaron Voisine and ask him about it.

I think it is good standard practice, in particular on sourceforge where there is plenty of space, not to wait until users request sources, but to publish them alongside with the binaries. I don't see any sources on the gimp-app site; maybe I didn't look at the right place?

By sources I mean the things defined by the GPL which says

For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable.

Brion Vibber
2004-08-19 23:34:34 UTC (over 19 years ago)

OSX app-bundle-ability of gimp and other gtk2 apps

Martin Costabel wrote:

Brion Vibber wrote:

Martin Costabel wrote:

Unfortunately, gimp-app does not give any information whether the gtk build needed to be configured differently. If gimp-app were open source in the sense of the GPL (which it pretends to be but isn't), you could just look at the sources from which it was built and see for yourself.

If you believe something is missing from the package, please e-mail Aaron Voisine and ask him about it.

I think it is good standard practice, in particular on sourceforge where there is plenty of space, not to wait until users request sources, but to publish them alongside with the binaries. I don't see any sources on the gimp-app site; maybe I didn't look at the right place?

Are you going to sit around and pout, or are you going to let Aaron know that you think something is missing so he can fix it?

Reporting problems to the maintainer is good standard practice, in particular in the FOSS world where many things are done by volunteers in their spare time.

-- brion vibber (brion @ pobox.com)

Sven Neumann
2004-08-19 23:45:53 UTC (over 19 years ago)

OSX app-bundle-ability of gimp and other gtk2 apps

Hi,

Martin Costabel writes:

I think it is good standard practice, in particular on sourceforge where there is plenty of space, not to wait until users request sources, but to publish them alongside with the binaries. I don't see any sources on the gimp-app site; maybe I didn't look at the right place?

By sources I mean the things defined by the GPL which says

For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable.

I've asked Aaron a while ago to provide everything that's needed to recreate the package and he added the link to ScriptExec.tar.gz at the bottom in response to that request. I have to admit that I have never verified that the application bundle can be created using this script and a GIMP tarball. If that is not the case then Aaron will have to add the missing pieces.

Sven

Martin Costabel
2004-08-20 09:29:33 UTC (over 19 years ago)

OSX app-bundle-ability of gimp and other gtk2 apps

Sven Neumann wrote:
[]

I've asked Aaron a while ago to provide everything that's needed to recreate the package and he added the link to ScriptExec.tar.gz at the bottom in response to that request. I have to admit that I have never verified that the application bundle can be created using this script and a GIMP tarball. If that is not the case then Aaron will have to add the missing pieces.

This may turn out to be not so easy. It is a problem specific for Mac OSX app bundles where you include all the required libraries with your executable, and this is why I think this discussion is pertinent to the original question about what is needed for packaging libraries in a Mac OSX app bundle. There you don't tell the users "Install this and that library before you can build or run the Gimp", but you distribute the libraries yourself. The GPL then forces you to publish yourself all the sources and the build scripts for the precise versions of these libraries that you are using. And there are *lots* of libraries involved here.

If the libraries are taken directly from Fink without modification, for example (the same would hold for opendarwin instead of Fink), then it would probably be sufficient to provide a link to the Fink package descriptions, as long as the versions are identical, because Fink has all the sources and build scripts. If Fink moves to a different version, however, you would either need to change versions, too, or provide the sources and the build scripts yourself.

I am not interested in legal aspects here, but rather in the point raised by the original question in this thread: If you distribute binaries based on GPLed software, you need to let others know how exactly you did it so that they can learn from your work. It's about sharing knowledge, and maybe a little also about attributing authorship to previous porting efforts.

It is at this point where many distributors of GPL-based Mac OSX software are sinning. They adhere more to the shareware philosophy than to the GPL. This is why many people would not touch places like gnu-darwin, osxgnu, and macgimp with a long pole. Others are happily giving them money, of course.

Kurt Bigler
2004-08-21 01:27:56 UTC (over 19 years ago)

OSX app-bundle-ability of gimp and other gtk2 apps

Hi, Mat and others,

On Aug 20, 2004, at 2:08 PM, Mat Caughron wrote:

The issues raised seems to be mostly to be in point of documentation. When
I do have time to maintain things, it is usually focused on doing a new build, rather than documenting the process. This seems to be the preference of MacGIMP purchasers who (in typical Mac style) want everything to "just work". Last fall (pre GIMP2), I wrote up a description
here that may be useful: http://howto.macgimp.org The plans are for me
torewrite that for the latest MacGIMP builds. Aaron Voisine has done some
great work with gimp-app and with his example, I figured out how to build
application wrappers for XDarwin/X11.

I took out an apple tech support incident to find that out. It required creating a tiny helper app in the bundle that calls launch services to run the real x11 app, like this:

CFBundleRef mainBundle = CFBundleGetMainBundle (); CFURLRef x11AppURLRef = CFBundleCopyResourceURL (mainBundle, CFSTR("example.x11app"), NULL, NULL); LSOpenCFURLRef (x11AppURLRef, NULL);

Is that the way you did it? It seemed kind of lame to me that launch services is so non-orthogonal that this didn't just fall out.

Darwinports can be used instead of fink for building a wrapped gtk app.

Whichever way requires less time investigating how to configure things is probably the way to go.

So I take it that there is no application code needed to achieve this, that it is just a matter of configuring gtk2 and all its subcomponents? If so, then even with no more help from you what would be involved in just cloning what GIMP2 does for my gtk2 build (and be able to link my app against it)? Do I have to look in a hundred different places to find all the configuration info? If so, then I probably have to wait for your doc before attempting this.

One downside to this is that each app brings along with itself a complete
GTK build, so you don't get the disk savings of single libraries

This is for a binary-installable application. I can see no way to take advantage of disk savings without risking creating conflicts on the users system when installing libraries.

So as far as I'm concerned, I'll take your note as a recommendation to get the documentation for building gimp-app style builds done shortly and
I'll CC this list when I get a rough draft written up and posted.

That will be great. I know its a freebie but I still have to ask, how soon is shortly? Just because shipping our freeware app has already been delayed a few months figuring this out (unpaid work tends to be slow that way, of course). I just have to decide whether to do it another way in the meantime to get it out.

Thanks to you and to everyone for their replies.

-Kurt Bigler