So You Want to Compile Gimp
The Groundwork
Building Gimp is not relatively straightfoward on Windows as it is on a Linux distribution. You have to do a lot of up front work to be able to accomplish this. In the following, I hope I am able to articulate clearly what you need and what kind of investigations and trial-and-error I had to do. Moreover, I will interlace the build process with both 64-bit and 32-bit. If a specific section is independent of this, it will not mention 64 or 32. In any case, if you have any questions, please feel free to drop me a line.
Collecting the necessary bits
Firstly, download the the mingw-gcc compiler and msys environment. For 64-bit compilation, I used the Sezero personal build and for 32-bit I used the daily build. I prefer to install the mingw-gcc compiler under c:\mingw64 for 64-bit and c:\mingw for 32-bit. Next install msys under c:\msys. Note that, if you download the gcc-compiler installer, then it will offer to install msys development environment as well. I would advise that you do that, but move msys\1.0 to c:\msys.
Next, you will need to install Python 2.7.1 and Perl since the Perl version that is included with msys does not include the XML parser and is older than the version required by Gimp. It is best to get Python 2.7.1 from the official distribution and Perl from ActiveState. I installed Python 2.7 at c:\Python27 and Perl on c:\Perl64 (c:\Perl under 32-bit). Next download and install Notepad++ which is what I use for all editing. Feel free to use any text editor or IDE that you are comfortable using.
You now have the basis for a functional Unix-style environment and you can use all your Unix knowledge in this environment. From this point, I will use forward slashes for directory as opposed to Windows style backslash. Note that foward slashes are perfectly valid in almost all situations under Windows. After installing Perl, I simply copied the whole Perl directory to the msys/opt directory.
Msys includes a batch file msys.bat that you can use to launch the bash shell. Verify that everything is working so far. That is, you have
a functional shell and you can use Unix commands like
Now you need to modify this environment to work on your computer.
Edit
C:\win32\src\ /usr/src
C:\win32\Python27 /usr/python
C:\win32\gtk /usr/gtk
Change the directory structure to reflect where you installed the above. Verify your edits so that when you do
you get the above. Note that the src directory is where we will put our source codes so that they are all in one place.
Notice that we have not installed GTK+2.0 so far. Download the cross-built mingw GTK+ availabe from OpenSUSE. You must download these builds for GTK+-2.0 and GLIB. They will be in the Red Hat RPM format. Once you do that, use 7zip to unarchive these RPMs in c:\gtk.
From the GNOME binary/source website, download the following:
| atk-dev_1.32.0-1_win32.zip | atk_1.32.0-1_win32.zip |
| cairo-dev_1.10.2-1_win32.zip | cairo_1.10.2-1_win32.zip |
| expat-dev_2.0.1-1_win32.zip | expat_2.0.1-1_win32.zip |
| fontconfig-dev_2.8.0-2_win32.zip | fontconfig_2.8.0-2_win32.zip |
| freetype-dev_2.4.4-1_win32.zip | freetype_2.4.4-1_win32.zip |
| gdk-pixbuf-dev_2.22.1-1_win32.zip | gdk-pixbuf_2.22.1-1_win32.zip |
| gettext-examples_0.18.1.1-2_win32.zip | gettext-runtime-dev_0.18.1.1-2_win32.zip |
| gettext-runtime_0.18.1.1-2_win32.zip | gettext-tools_0.18.1.1-2_win32.zip |
| gtksourceview-2.10.0.zip | gtksourceview-dev-2.10.0.zip |
| intltool-0.40.6 | libiconv-1.9.1.bin.woe32.zip |
| libffi-dev_3.0.6-1_win32.zip | libffi_3.0.6-1_win32.zip |
| libxml2-dev_2.7.7-1_win32.zip | libxml2_2.7.7-1_win32.zip |
| pango-dev_1.28.3-1_win32.zip | pango_1.28.3-1_win32.zip |
| pixman-dev_0.20.0-1_win32.zip | pkg-config_0.25-1_win32.zip |
| zlib-dev_1.2.5-2_win32.zip | zlib_1.2.5-2_win32.zip |
Except for intltools, and libiconv I unzipped the others in the c:\gtk folder. I installed intltools and libiconv in /opt/lib. Be sure all the intltools point to the correct version of Perl at /opt/perl. You can modify these tools since they are simply shell script files. Make sure that the first line for intltool-merge, intltool-prepare, and intltool-update is something like
Now, update the following variables - PATH, PYTHONPATH, and PKG_CONFIG_PATH in /etc/profile. I have the following:
export PYTHONPATH=/usr/python
export PKG_CONFIG_PATH=/opt/gimp-2.7.3/lib/pkgconfig:/opt/lib/pkgconfig:/usr/gtk/lib/pkgconfig:/usr/python/Lib/pkgconfig
Rerun msys.bat for the above to take effect. Then test your environment by running gtk-demo. It should produce a nice window with all its features. Run the command
to give you an idea of what version of gcc you have and how it was compiled. Finally, run the following command
This should produce
Graphics Bits
Gimp needs a few graphics packages: JPEG, PNG, TIFF, and Little CMS. You can get the latest builds for JPEG, PNG, and TIFF from the GNOME binary website. Download the following zipfiles
| jpeg-dev_8-1_win32.zip | jpeg_8-1_win32.zip |
| libpng-dev_1.4.3-1_win32.zip | libpng_1.4.3-1_win32.zip |
| libtiff-dev_3.9.2-1_win32.zip | libtiff_3.9.2-1_win32.zip |
Unzip each of the files into /opt.
I could not find a mingw build available for Little CMS from their website. So, download the source code to /src/graphics/. The do the following
This will create the source tree for Little CMS. Now do your first compile. From here, I am going to assume that you have started the msys environment and that you are at a command prompt typically a "$". To compile lcms, change over to the lcms-1.19 directory, and do the following.
For Windows 64-bit, execute the command
Once configure finishes, do the following
I use
That is all the groundwork needed to begin the job of compiling Gimp (I hope). If not, drop me a line.
Continue on to building Gimp....
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.