So You Want to Compile Gimp
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.
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:
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:
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
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
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
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.