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
- Fix a "Can't determine host type" problem with ./configure and
configure.
cd pygimp-1.2/ cp /usr/share/libtool/config.guess . cp /usr/share/libtool/config.sub . ./configure --prefix=/sw
- Optionally, edit python files for gtk-2 as described below.
- Make and install:
make sudo make install
- Fixed problem where gimpmodule.so is not built. The symptom of this problem is that "import gimpfu" fails because
"import gimp" fails. I built gimpmodule.so using Python distutils.
- Create a setup.py file as shown here for gtk+ (ver. 1.2) or use the one below for gtk+2 (ver. 2.0):
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]) - Build gimpmodule.so:
python setup.py build
- Install gimpmodule.so (change python2.2 to subdirectory that
matches your version of python if necessary):
sudo cp build/lib.darwin-7.3.0-PowerMacintosh-2.2/gimpmodule.so /sw/lib/python2.2/site-packages/
- Create a setup.py file as shown here for gtk+ (ver. 1.2) or use the one below for gtk+2 (ver. 2.0):
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):
- Edit gimpfu.py, gimpui.py, plug-ins/gimpcons.py and plug-ins/pdbbrowse.py so that "gtk.Gtk" is replaced with "gtk."
- Disable the logo in gimpfu.py by commenting out (I was too lazy
to fix it). Before:
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() - Edit plug-ins/gtkcons.py to replace "Gtk" with ""
- sudo make install
- Use the following setup.py in the above procedure:
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])

