Updated: February 8, 2014
A few days back, we talked about the Depth of Field (DOF) effect in GIMP, and how it can be used to compensate for flatness in images, especially digital renders. To that end, we used a very nifty plugin called Focus Blur. It worked fine, but there was one unresolved problem in the tutorial. I assumed the plugin was already installed and working, and we didn't need to fiddle with its setup. As it turns out, the plugin comes as a tarball, containing the sources. What now?
Let me show you how you can configure your GIMP plugins, even if they come as source files, a mythical concept for most people. While this tutorial is limited to the installation of a single plugin, its general spirit will serve you well in the configuration of all your plugins that come as sources. Of course, this tutorial applies for Linux, if you had any doubts. Now follow me.
Grab the files
The very first step would be to download the archive (tarball) and extract it somewhere. The second one would be to read my detailed Linux commands & configurations tutorial, which explains a lot about how to manage your data and compile in Linux. There, you will learn that you need compilation tools installed. This includes gcc, make, kernel sources, kernel headers, and a few other programs. On Debian-based systems, like Ubuntu, you can install all these using a transitional package called build-essential. So in theory, you need something like:
sudo apt-get install build-essential
All right, so you have downloaded the plugin, you have the build tools, and you're ready to roll. Reading the INSTALL file, it tells you about the usual three-step process - configure, make, make install. You start with configure, of course. You hit an error.
Debugging configure errors
It might not be easy, but the error messages are usually very descriptive and self-telling, if you have some experience with Linux. In my case, on stock Ubuntu Pangolin, the first failure happened here:
configure: error: Could not find gdk-pixbuf-csource in your PATH
This means you are missing the gdk-pixbuf package - P.S. Can be any really. All, right, so install it, and then repeat the configure step.
sudo apt-get install libgdk-pixbuf2.0-dev
This time, you will get past the last error, and hit a new one. In my case:
checking for GIMP - version >= 2.4.0...
*** Could not run GIMP test program, checking why...
*** The test program failed to compile or link. See the file config.log for the exact error that occurred. This usually means GIMP is incorrectly installed.
configure: error: Test for libgimp failed.
You are being referred to a file called config.log for details. Browsing through this log is not easy, but if you're a bit attentive, you will find the extra failure toward the end of the file.
conftest.c:10:26: fatal error: libgimp/gimp.h: No such file or directory
It complains about the libgimp/gimp.h file not being there. You can check its presence using the locate command. You can also verify what package provides this file using the apt-cache or aptitude commands. Again, you will resolve the problem by installing the GIMP headers:
sudo apt-get install libgimp2.0-dev
Lastly, I failed here:
checking for intltool >= 0.36.3... ./configure: line 5415: intltool-update: command not found
configure: error: Your intltool is too old. You need intltool 0.36.3 or later.
On one hand, the message tells us the command was not found; on the other, it tells us the tool is too old. The truth is, we do not have this installed, at all, so you might be a little confused by the two different statement. What you simply need to do is, install the intltool, and then the configure step ought to complete successfully. Indeed, here's a screenshot of the compilation in progress:
Test your plugin!
Once this step is complete, run GIMP and test:
So what did I do here? Show you a bunch of errors and how to work around them. Yes, in a nutshell, that's what I did. But the actual, exact errors are not important, although some of you may stumble upon this article because of these quotes. What I wanted to you to learn was that seemingly cryptic, terrifying errors are not that difficult. You just need to read a little, and eventually, you will find the right formula. In most cases, when something does not compile, you're just missing this or that dev package.
Hopefully, this article has liberated your compilation chakras. You now have the right skills to dabble in custom compilations when needed, and work around missing packages, header files and such. Most importantly, the reason you've come here, you have the Focus blur plugin working. And that would be all for this time.