Installing Retexturizer plugin for Gimp on OSX

Resynthesizer is an amazing plugin for the Gimp, an amazing open-source photo editing program. Since I usually run OSX, I like to use Gimp.app, but it does not include the Resynthesizer plugin. Gimpshop, a version of Gimp modified to be more like photoshop, is supposed to include Resynthesizer, but the version that I downloaded did not seem to have it. So I’ve decided to try to build the Resynthesizer plugin from source to see if I can use it in either Gimp from fink, Gimp.app, or Gimpshop.

First, to build the plugin  you need to have the gimp2 headers. Since I use Fink, an OSX software package manager, I used that to obtain the gimp-dev packages. First though, since that is in the unstable tree, you need to add unstable/main to list of trees in /sw/etc/fink.conf

After that, you can run fink install gimp2-dev. That sucked in a lot of stuff, and took quite a while. I also needed to do a fink install gimp2 to pick up gimptool-2.0.

I needed to modify the Makefile that came with resythesizer, and point it to the correct gimptool (/sw/bin/gimptool-2.0 for me).

Of course, I ran into an error:


/usr/bin/ld: Undefined symbols:
_libintl_gettext
_libintl_textdomain

This seems strange to me because the Makefile is properly including /sw/lib on the library path, that does have libgettext and libgettext.a does binary
match to the undefined symbols. A fairy on the interweb told me that fink install libgettext3-dev might help, so I gave that a try.

Shockingly, that worked! A make followed by make install worked just fine! I ran gimp-2.0, and under the Filters menu, Map->Resynthesizer was there, as was Script-Fu->Enhance->Smart Remove selection and friends. yay! Just for fun I fired up Gimp.app, and the plugin did not show up there. The plugin is installed in ~/.gimp-2.0/plug-ins but needs to be in ~/.gimp-2.2/plug-ins for Gimp.app to pick it up. Copying the resynth file over to the correct location fixes that, but it does not show up. Starting Gimp.app on the command line shows this error message:


dyld: Library not loaded: /sw/lib/libatk-1.0.0.dylib
Referenced from: /Users/devans/.gimp-2.2/plug-ins/resynth
Reason: Incompatible library version: resynth requires version 1115.0.0 or later, but libatk-1.0.0.dylib provides version 1012.0.0

So, what is libatk? It is some sort of library tool, and it is included with fink, a few versions of it, but apparently not the one that I need to use with Gimp.app. Anyway, I did some searching, but didn’t find much useful information, and I don’t want to mess with it much more than this. I’ll just use the fink version of Gimp2 when I need to use resynthesizer.

Now, off to compile and set this up on the dual core MacBook Pro. It took about five hours to compile everything (including a fink upgrade) on the PowerPC, but I bet it will be two to four times faster on the MacBook Pro. heh heh.

Turns out that it did take quite a while on the MacBook Pro also (especially because I had to uninstall fink and re-install it to pick up the proper i386 architecture stuff) and I ran into another error:


resynth.cc:42:21: error: libintl.h: No such file or directory
resynth.cc: In function ‘bool get_parameters_by_asking(Parameters*, int)’:
resynth.cc:395: error: ‘gettext’ was not declared in this scope
resynth.cc: In function ‘void run(const gchar*, gint, const GimpParam*, gint*, GimpParam**)’:
resynth.cc:718: error: ‘textdomain’ was not declared in this scope
resynth.cc:762: error: ‘gettext’ was not declared in this scope
resynth.cc:778: error: ‘gettext’ was not declared in this scope
resynth.cc:782: error: ‘gettext’ was not declared in this scope
resynth.cc:786: error: ‘gettext’ was not declared in this scope
resynth.cc:812: error: ‘gettext’ was not declared in this scope

This was fixed by noticing that the CFLAGS set by the Makefile with gimptool-2.0 --cflags did not include /sw/include (which actually has the requested libintl.h file) and manually setting the CLFAGS variable in the Makefile to the output of gimptool-2.0 --cflags and an additional -I/sw/include. Things installed just fine after that.

If anyone is interested in binaries, drop me a line. I can be reached via email as fugu at this domain.


Posted

in

,

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *