Being able to use Python to write GIMP plugins is nice. Here is how I built pygimp 1.2 for GIMP 1.2.5 from Fink 0.6.2 installed to /sw on
Mac OS X 10.3.3. First are what I did for GTK+ (1.2) followed by the differences for GTK+2 (2.0). I make no claims that this is the best
way or that this will be relevant when everyone moves to GIMP 2.0 and beyond, but I hope maybe it will help someone.
Read the rest of the hint for the steps...
[robg adds: I haven't tested or reviewed this one -- if you try it and it works (or doesn't), please post in the comments...]
The pygimp software is available here
cd pygimp-1.2/ cp /usr/share/libtool/config.guess . cp /usr/share/libtool/config.sub . ./configure --prefix=/sw
make sudo make install
from distutils.core import setup, Extension
module1 = Extension('gimpmodule',
sources = ['gimpmodule.c'],
include_dirs = ['/sw/include/', '/sw/include/glib-1.2',
'/sw/lib/glib/include'],
library_dirs = ['/sw/lib'],
libraries=['gimp', 'glib', 'intl'])
setup (name = 'gimpmodule',
version = '1.2',
description = 'Library for PyGimp',
ext_modules = [module1])
python setup.py build
sudo cp build/lib.darwin-7.3.0-PowerMacintosh-2.2/gimpmodule.so /sw/lib/python2.2/site-packages/
If anyone wants to try fixing the makefile, here are the commands that "python setup.py build" used for GTK 1.2:
gcc -DNDEBUG -O3 -Wall -Wstrict-prototypes -I/sw/include/ -I/sw/include/glib-1.2 -I/sw/lib/glib/include -I/sw/include/python2.2 -c gimpmodule.c -o build/temp.darwin-7.3.0-PowerMacintosh-2.2/gimpmodule.o gcc -L/sw/lib -bundle -flat_namespace -undefined suppress build/temp.darwin-7.3.0-PowerMacintosh-2.2/gimpmodule.o -L/sw/lib -o build/lib.darwin-7.3.0-PowerMacintosh-2.2/gimpmodule.so
Optionally, for using pygimp with pygtk for gtk+2 instead of gtk+ (which makes things compatible with RedHat Linux 9):
pix = _get_logo(vbox.get_colormap())
vbox.pack_start(pix, expand=gtk.FALSE)
pix.show()
After:
# pix = _get_logo(vbox.get_colormap())
# vbox.pack_start(pix, expand=gtk.FALSE)
# pix.show()
from distutils.core import setup, Extension
module1 = Extension('gimpmodule',
sources = ['gimpmodule.c'],
include_dirs = ['/sw/include/', '/sw/include/glib-2.0',
'/sw/lib/glib-2.0/include'],
library_dirs = ['/sw/lib'],
libraries=['gimp', 'glib-2.0', 'intl'])
setup (name = 'gimpmodule',
version = '1.2',
description = 'Library for PyGimp',
ext_modules = [module1])
Mac OS X Hints
http://hints.macworld.com/article.php?story=20040406204632810