So You Want to Compile Gimp
Building Gimp
Now that we have done the groundwork, we are ready to build Gimp. If you are not familiar with the groundwork, please read that article first. Then you can come back here and see how I did the compilation.
You have to build Gimp in this strict order. First you build BABL, then you build GEGL and then lastly you build GIMP in that order. We are going to build Gimp in the
BABL
Download the git-master of babl - babl-git-master.tar.bz from the flamingtext website (see sidebar) in your
and for the Windows 64-bit version:
I always use the the build qualifier to be sure that it is in fact a 64-bit build.
Once configured, you make and make install as before. This will install BABL into
GEGL
Download the git-master of gegl - gegl-git-master.tar.bz from the above website. Once you download, unzip and change over to the gegl-0.1.7 directory. Then execute the following command:
with the corresponding 64-bit
Libintl Issues (Windows 32-bit)
There are two issues with libintl -
#undef setlocale
#endif
When I used this piece of code in gegl-int.c, it compiled. That is, at about line 434 add the above. You are going to need this code for compiling Gimp as well.
Gimp
Download the git-master gimp - gimp-git-master.tar.bz from the above site. Once downloaded, unzip and change over to the gimp-2.7.3 directory. Then you can execute the command for Window 32-bit:
and for Windows 64-bit:
It is important to put the
Python Support
For Python there is a wrinkle.
prefix=c:/Python27
exec_prefix=${prefix}
pygobject_script=${exec_prefix}/pygobject-codegen-2.0
echo "note: pygtk-codegen-2.0 is deprecated, use pygobject-codegen-2.0 instead" > /dev/stderr
echo "note: I will now try to invoke pygobject-codegen-2.0 in the same directory" > /dev/stderr
exec $pygobject_script "$@"
So you also need pygobject-codegen-2.0 in the same directory. Mine looks like:
prefix=@prefix@
datarootdir=@datarootdir@
datadir=c:/Python27
codegendir=${datadir}/site-packages/gtk-2.0/codegen
PYTHONPATH=$codegendir
export PYTHONPATH
exec c:/Python27/python.exe c:/Python27/Lib/site-packages/gtk-2.0/codegen/codegen.py "$@"
Also, make sure to do this:
libtool looks for
Libintl revisited (Windows-32bit)
As mentioned above, libintl_setlocale and libintl_printf are going to be undefined based on the mingw version of libintl.dll.a. You will have to patch the source code with the libintl_setlocale undef as done above. You will have to modify gimp.c app.c and main.c and add the above to get rid of this error.
You will also find that libintl_printf is undefined. You will need to add this code
in a number of files. I get this error in the files app/core/gimptagcache.c (line 599), plug-ins/file-sgi/sgi.c (line 456), plug-ins/common/animation-play.c (line 822), plug-ins/common/curve-bend.c (line 941 etc.), plug-ins/common/file-xwd.c (line 893 etc.), plug-ins/common/jigsaw.c (line 609 etc.), plug-ins/common/newprint.c and plug-ins/common/sample-colorize.c (line 2629). In all these files, just add the "#define" somewhere in the begining of these files.
Plug-ins.ico
The compile will stop with an error that plug-ins.ico is missing in the directory builds/windows. There is no such file in the source. So, I found a set of icons for ico files, renamed it plug-ins.ico and put it in the build/windows directory. The compile then proceed normally.
Next, while compiling I get the following error:
According to the developers, I am trying to compile against a too old version of gtk+-2.0
Well, my version is 2.24.4, so that can't be it unless my compilation of gtk+-2.0 somehow
did not export gdk_win32_window_foreign_new_for_display. However, gdk_window_foreign_new_for_display
is exported and so I changed this in two places:
TWAIN Issues
Another snag that has recently arisen is that twain does not compile. Why twain is not optional is beyond me. In any case,
the issue seems to be that cairo and gdk-pixbuf headers are no longer found. The solution that worked for me was to add the
respective headers directly into the Makefile in plug-ins/twain. So, modify line 83 (or thereabouts) of the Makefile and add the following at the end:
Little CMS Issues (Windows 32-bit)
Little CMS throws up a lot of errors during the build if you have lcms support. I found the problem to be the following. In the file
Uncomment only #include
That should be it. Now you should have gimp-2.7.3 compiled. Do make and make install and you are done.
If you wish to use the official version then Gimp 2.7.1 is available from here.
If you are inclined to leave a comment...>
Return to Partha's home.