In this page, I'll try to keep some updated instructions on compiling GIMP, both on Windows and on Linux. This page is not going to have "copy paste" instructions, since I want you to understand what you are doing. If you are looking for a "paste this on the command line" guide, you should go look elsewhere – you won’t find it here.
Perquisites: You should know roughly what is a command-line/terminal/shell. and what are environment variables. You should also know how to open the command-line/terminal/shell.
Finally, any Suggestions/Corrections/Feedback will be highly appreciated! If you didn’t succeed to build GIMP using the technique described here, tell me what’s the error (leave a comment) and I’ll see if I can help!
- Update 1 (Jan 15, 2011): Added a part about updating your build
- Update 2 (Jan 30, 2011): Added instructions on compiling on windows (without cygwin!), for pre-packaged sources
- Update 3 (Jan 30, 2011): Fixed a small bugs which caused stuff to be extracted to the wrong place (mainly libtiff/libjpeg/libwmf. Perl was also extracted to the wrong place, but it didn’t affect the compilation).
Instructions for compiling on windows from git, will be posted later.
Warning: Installing software and making changes to your system, is risky, especially if you don't know what you are doing! This guide is written in hope that it will be helpful, but it's without any guarantee that it will work or that it won't damage your computer. I’m not responsible for any damage caused to your computer by following any part of this guide. In short, Follow at your own risk!
Compiling GIMP 2.7 on Linux
This guide will explain you how to install GIMP, even without root/admin permissions/privileges. It will explain how to install GIMP to a custom location so that it won’t conflict with your existing GIMP installation. Through this guide, I’m going to use the bash shell for executing stuff from the command line – it’s usually located in /bin/bash.
The Basics - Environment Variables
The main "problem" (don't worry, it's solvable) with compiling gimp on Linux, is environment variables. There are 3 environment variables which we should get to know when compiling things on Linux, and we’ll now present them:
First of all, this environment variable specifies where to look for executables. When you type "gimp" in the command line, all the directories inside the path will be searched.
lightning@nova:~$ echo $PATH /usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/usr/local32/bin:.
As you can see, the path is composed out of a list of paths to directories, separated by ':' signs. The order of directories inside the path does matter! Directories which are listed first, are searched first!
This environment variable tells the pkg-config tool (a tool which is used to resolve most dependencies in GIMP’s compilation) where to look for the config files (which are used by pkg-config) for installed libraries.
Many executables used files which are called shared libraries – these files contain functionality that should be shared between executables. One example which you should know (if you are a Linux user) is Gtk+ – the library which is used by many applications (including GIMP) to create the user interface.
The executables search for these libraries inside some directories which are considered as “default”. So, in order for us to install and use libraries in other locations we need to update this variable to point to the directory leading to these libraries.
What’s the problem with environment variables?
We don’t want to compile GIMP and install it in the default location, because then it may conflict with our existing installation. But if we install GIMP at a different location, we need to configure the environment variables so that the correct versions of libraries will be found and used, both for compilation and for running GIMP.
Preparing for compilation
First of all, we need to decide where do we want to install the alternative version of GIMP. To make it easy to remember and use, we’ll define an environment variable containing that path:
We will also need a directory to download the sources to; this is the directory I used:
You’ll need to make sure both of these directories actually exist. You can do it by running following command:
mkdir -p $INSTALL_PREFIX mkdir -p $SRC_DIR
Now, remember the discussion we had about environment variables? Here are the updates we need to do:
export PATH=$INSTALL_PREFIX/bin:$PATH export PKG_CONFIG_PATH=$INSTALL_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH export LD_LIBRARY_PATH=$INSTALL_PREFIX/lib:$LD_LIBRARY_PATH
In the first line, we update the PATH variable, so that looking for executables will begin in our installation directory (executables will be installed into the bin subdirectory). In the second line, we tell pkg-config that it should begin searching for library config files in our installation directory. This will resolve many compilation issues! For example, this will allow us to compile plug-ins against our updated version of the GIMP libraries, even if we have the old ones installed. In the third line, we tell the library loader that it should first of all try to look for libraries in our installation directory – this will prevent it from loading the libraries of other GIMP versions (that can cause trouble…).
Before you rush to get any of the dependencies listed below, stop. You may have some of them, or even all of them without you even new about it. Any recent Linux distribution should have the general dependencies listed below, and we’ll target the GIMP specific dependencies below.
- GLib – a library used by many gnome applications, containing utilities and common data structures for programs written in C.
- GTK+ – a graphical toolkit for building cross-platform user interfaces.
- Cairo – a 2D graphics library, used for drawing some of GIMP’s widget and also used by Gtk+.
- librsvg – a library for rendering SVG (Scalable Vector Graphics) files.
- libpng – a library for reading and writing PNG (Portable Network Graphics) image files. Used by Gtk+, GIMP and GEGL.
- babl – a library for converting between pixel formats, heavily used by GIMP when communicating with GEGL.
- GEGL – a graph based image processing library, heavily used in GIMP’s core
In order to build GIMP from the latest source (and not from a ready source packages), you’ll need to have Perl installed, along with some other utilities such as intltool. If you want to compile GEGL from the latest source (as proposed below), you’ll need to have Ruby installed. You shouldn’t worry about these if you have a decent linux distribution which was updated anywhere in the last year or two.
If you want GIMP to have Python support (optional), you’ll need to install Python (version 2, not 3!) along with PyGTK+. If you want to be able to build GIMP’s documentation (optional), you’ll need to have gtk-doc installed.
Compiling babl, GEGL and GIMP from source
The procedure for compiling babl, GEGL and GIMP is very easy once you have the dependencies. Note that the order here matters – we first need to have babl, then GEGL and finally GIMP.
Compiling the latest source (from Git)
First of all, you’ll need Git (the version control tool which is used for managing the sources of babl, GEGL, GIMP and many other projects). To download the sources, invoke the following commands:
cd $SRC_DIR git clone git://git.gnome.org/babl git clone git://git.gnome.org/gegl git clone git://git.gnome.org/gimp
Now, the procedure for compiling is very simple:
- Run the autogen script – this script generates the makefiles based on your system’s configurations, and tries to make sure you have all the dependencies.
- Run the ‘make’ command to compile the sources (do this only if the autogen script finished successfully!)
- Run the ‘make install’ command to install the compiled sources (do this only if the compilation was successful!)
# Install BABL cd $SRC_DIR/babl ./autogen.sh --prefix=$INSTALL_PREFIX && make -j4 && make install # Install GEGL cd $SRC_DIR/gegl ./autogen.sh --prefix=$INSTALL_PREFIX && make -j4 && make install # Install GIMP cd $SRC_DIR/gimp ./autogen.sh --prefix=$INSTALL_PREFIX --disable-gtk-doc --disable-python --enable-debug make -j4 make install -j4
- The autogen.sh script generates a script called configure, which recieves the arguments that were passed to the autogen.sh script
- The --prefix argument to the configure script tells the configuration script that the installation should be done to a location different than the default location
- The -j4 argument to the make program, tells it that the task should be done using 4 jobs. Use this if you have 4 cores on the computer to speed up things by using several cores! If you have less cores, specify the appropriate number. You can simply remove that argument if you don’t know how many cores you have, or if you want to run a single job
- When compiling GIMP we also passed the --disable-gtk-doc argument, to specify that we don’t want to build the documentation. Do this if you don’t have gtk-doc or if you don’t want to build the documentation (could be long to build, and it’s not going to be of any use unless you plan to develop GIMP itself or plug-ins for it).
- When compiling GIMP we also passed the --disable-python argument, to specify that we don’t want to build the python plug-in support. Do this if you don’t have python/PyGTK+ or if you don’t want the python support.
- When compiling GIMP we also passed the --enable-debug argument, to specify that GIMP should be built with debug information.
Note that we disabled python and gtk-doc above by default. You can try removing these arguments, and see if the autogen script finishes successfully. If you plan on running the autogen script several times, try adding the -C argument to enable caching of some of the results – this will speed things up.
Running our compiled version of GIMP
Now, we should be careful before running GIMP. Our compilation was done with some very specific environment variables, and running GIMP will depend on them! So, let’s save our environment variables into a script that runs GIMP:
echo "#! /bin/bash # set the path to the installation directory export INSTALL_PREFIX=$INSTALL_PREFIX # set the path to the directory into which we download the sources export SRC_DIR=$SRC_DIR # Now, set mandatory enviroment variables export PATH=\$INSTALL_PREFIX/bin:\$PATH export LD_LIBRARY_PATH=\$INSTALL_PREFIX/lib:\$LD_LIBRARY_PATH # Not needed for running GIMP directly, but needed if you want to compile anything against our # builds (think of plug-ins, etc.) export PKG_CONFIG_PATH=\$INSTALL_PREFIX/lib/pkgconfig:\$PKG_CONFIG_PATH # Now you can run executables our other stuff depending on our environment # Here we run GIMP, and pass it any arguments given to this script \$INSTALL_PREFIX/bin/gimp-2.7 \$@ # If you want to run something else, copy paste into bash everything before the line that # runs GIMP, and then run it " > $INSTALL_PREFIX/run-gimp.sh chmod +x $INSTALL_PREFIX/run-gimp.sh
This command creates a script file called run-gimp.sh (inside our installation directory), which sets our environment variables, and then runs GIMP. The script will also contain instructions about running things other than GIMP using our environment. If you finished this step without erros, you should now have a working build of GIMP!
Compiling source from a ready package (Alternative to downloading from Git)
You can download a source package for GIMP/babl/GEGL on their respective sites. In order to compile these, you’ll need to replace the call to ./autogen.sh with a call to ./configure, and that’s about it (you still pass the same arguments!).
- “I’m getting an error about a too low of GTK+/GLib while compiling XXX”
You can either update your version of GTK+/GLib using your system’s package manager, or compile GTK+/GLib from source! Compiling these is done exactly like we compiled babl – download the source (either the latest from Git, or a package from the official site), compile and install. You may also need to do something like this to a library called ATK.
- “I’m getting some error about relative path in the prefix”
The installation directory of libraries/executables must be specified in an absolute path and not in a relative path. If you got this error, it means that one of the paths in your environment variables is relative and not absolute – fix that!
- “Package babl was not found in the pkg-config search path…”
Reader phani reports that he had some problems that made pkg-config fail to find babl on his machine. He said that he solved it by copying babl.pc from $INSTALL_PREFIX/lib/pkgconfig to $INSTALL_PREFIX/build/lib/pkgconfig. This problem shouldn’t happen to you in any normal case! However, if it does, please leave a comment here saying that you also encountered it!
As he asked for, I removed his comment and I’m just leaving this note here.
Updating Your GIMP Build (Git only)
If you checked the source of GIMP from Git, you probably want to be able to update your build. To do this, we need first of all to fetch the updated sources.
cd $SRC_DIR/gimp git pull
Now, if you get warnings about conflicts that prevent you from updating, see what are these warnings. If you added some files or made changes that you want to keep, do this (I recommend finding a Git tutorial for this, such as the excellent Git Magic). If any changes were unintentional, run the following (warning! Recovering the changes will not be possible!):
git reset --hard
Now try again the pull command.
Now that we have the updated sources, you can try to rebuild gimp (the call to autogen, then make and make install). Some people would tell you that we should have called make clean or make distclean before this step (These clean any remains of the last compilation). Well, the general case is that not too much of the source changes between updates, so why re-build everything? The make utility usually succeeds in building only the things that were changed, so give it a try.
If you see that your build fails, then you should try running the following command (Warning! Will remove all the files which are not directly tracked by git!):
git clean –dfq
Now, try repeating the reset command and building. It should work now.
The procedure described above can be applied also to update GEGL and babl.
Compiling GIMP 2.7 on Windows (from packages, not from Git)
Compiling GIMP on Windows is very similar to compiling on Linux, but with one catch: It’s much more complex, and you can get screwed up in so many ways… If you wish to read and follow the instructions here, you must make yourself familiar with the process on Linux as described above (you don’t have to try it if you don’t have a Linux computer available, but you should read it fully and try to understand it).
Compiling GIMP natively on windows can be hard, and it may break-up because of every little change in any of the dependencies. I am going to try and keep this updated, but you should try to understand what’s going on, and you should not be afraid of error messages! Google is your friend and you should expect the unexpected.
In this part I’m going to post the instructions for compiling GIMP and friends from pre-packaged sources, and not from Git. This is since compiling from Git requires some more steps which are not that trivial (these will be covered in the next version of this document).
For the sake of having a hopefully deterministic result, I’m going to post the exact versions of some of the packages/tools/sources I used.
We will use the following directory structure for compiling GIMP:
- gimp-win-beta – The root directory of everything we are doing. Can be located anywhere on the disk, as long as the path to it does not contain spaces!
- build – In this directory we will install and compile programs
- downloads – In this directory we will save all the files we are going to download (And their will be plenty of these!) in an organized way so we can find our way around.
- perl – Will be explained later
- git – Will be explained later
- build – In this directory we will install and compile programs
So, create this directory tree somewhere on your disk, in a path which has no spaces in it! I suggest:
For the rest of this guide, I’m going to refer to these directories as GIMP_BETA_DIR, BUILD_DIR, PERL_DIR, GIT_DIR. Now, let’s get started.
MinGW and MSYS
Let’s face it – Linux comes with so many tools that windows doesn’t. It comes with a compiler suite known as GCC (Gnu Compiler Collection), with scripting languages (such as Perl, Python and Ruby) and many many configuration tools which are supposed to “simplify” the process of compilation (yeah right…). Windows does not come with the tools I mentioned above, so we need to get ourself a basic environment containing some of these tools.
MinGW – Minimal Gnu for Windows, is a collection of native Windows ports of the Gnu Compiler Collection (unlike Cygwin, which tries to emulates a Unix environment on windows). MSYS – Minimal System, is a collection of Windows Ports of utilities such as make, grep (Generalized Regular Expression Parser), bash (A Unix Shell).
Installing the MinGW compilers along with MSYS, is essential if we want to compile Unix/Linux programs on windows, in cases where the build environment depends on these tools.
So, let’s get started! Install the latest version of MinGW and MSYS from the MinGW official website. You can find the installers here (I used mingw-get-inst-20101030). Download the installer and save it inside the directory DOWNLOADS_DIR/mingw, then launch it.
- When it asks for the installation path, you want to enter the path to your build dir (in my case, C:\gimp-win-beta\build). Make sure you don’t have a suffix of \MinGW to your path!
- When it asks for components to install, you want: “C Compiler”, “C++ Compiler”, “MSYS Basic System”.
Now when we finished installing these, we want to start the shell (For windows users, shell=Command Line=Command Prompt=Terminal=Console=…). You can find the launcher for it it BUILD_DIR\msys\1.0\msys.bat – launch it and it should open a shell window (usually black with yellow/green text).
- Ctrl+C and Ctrl+V don’t work for copy paste, and you can’t select text just using the cursor. Instead, right click the window title (and not inside the actual window) and you’ll find inside the “Edit” entry the regular copy/paste commands
- In order to mark text and copy it, right click the window title, choose Edit->Mark. Then select some text, and click Enter to copy it.
Now, it’s time to set the many environment variables. First of all, we have to set the path to GIMP_BETA_DIR. So type the following command (if the path to your GIMP_BETA_DIR is C:\gimp-win-beta)":
Now execute the following commands:
# Set paths to common directories export DOWNLOADS_DIR=$GIMP_BETA_DIR/downloads export BUILD_DIR=$GIMP_BETA_DIR/build export MSYS_DIR=$BUILD_DIR/msys/1.0 # Now, this is the directory into we will install stuff (where / is the MSYS_DIR). # You can change this to some other place, but there is no reason… export INSTALL_PREFIX=/opt # Now let’s acutally set the compilation/runtime variables export PATH=$INSTALL_PREFIX/bin:$PATH export PKG_CONFIG_PATH=$INSTALL_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH export LD_LIBRARY_PATH=$INSTALL_PREFIX/bin:$LD_LIBRARY_PATH # C compiler flags export CFLAGS=-I$INSTALL_PREFIX/include $CFLAGS # C Pre-Processor flags export CPPFLAGS=-I$INSTALL_PREFIX/include $CPPFLAGS # Linker flags export LIBS=-L$INSTALL_PREFIX/lib $LIBS
The smart reader probably noticed that windows folder seperators inside a path are ‘\’, while our paths contain ‘/’. That is because Unix/Linux paths use ‘/’ as the separators.
Wget is a fantastic utility which allows us to download files from the command line, and we are going to make heavy usage of it. The only problem is that we need to download Wget and we can’t do this from the command line :(
So, open up your favorite web-browser and get yourself a copy of Wget from the MSYS Wget download page (I used version 1.12-1). Note that you will need a library called OpenSSL for Wget to run – you can get it in the OpenSSL download page (I used version 1.0.0-1). Save both downloads under DOWNLOADS_DIR\mingw.
Now, as you may have noticed, we got files which had the suffix tar.lzma. Tar is an archive file which allows packing many files and folders together to one file, and Lzma is a compression method (The idea is similar to Zip – make things take less space). Don’t worry, MSYS came with a utility to extract these and we’ll use it right now! Inside the MSYS window you opened earlier, type:
lzma -dc $DOWNLOADS_DIR/mingw/wget-1.12-1-msys-1.0.13-bin.tar.lzma | tar -x -C / lzma -dc $DOWNLOADS_DIR/mingw/libopenssl-1.0.0-1-msys-1.0.13-dll-100.tar.lzma | tar -x -C /
Note that you will need to replace the file names according to the version you downloaded. I’m not going to say this again every time – so from now on when you see commands with specific file name and versions, look around to find the matching ones that you have.
# Create the src folder mkdir $DOWNLOADS_DIR/src # Enter the folder cd $DOWNLOADS_DIR/src # Download the file wget ftp://ftp.gimp.org/pub/babl/0.1/babl-0.1.2.tar.bz2
Now, extract the source into the “home directory” (Which is actually located in MSYS_DIR/home/USERNAME) and enter the directory of the extracted source
mkdir ~/stable-sources tar -xf $DOWNLOADS_DIR/src/babl-0.1.2.tar.bz2 -C ~/stable-sources cd ~/stable-sources/babl-0.1.2
Now, let’s compile BABL as we would compile on Linux! Run
./configure --prefix=$INSTALL_PREFIX -C
Now, usually we would just type ‘make’ and ‘make install’, but this version (0.1.2) has a problem on windows due to an argument to the compiler which is unrecognized on windows (the argument is ‘-pthreads’). So, type:
#Replace 4 by the amount of jobs that you want to run, or simply remove the -j4 argument make -j4
Now, it will probably fail with some errors. If it fails with some error about unrecognized option ‘-pthreads’ and something like ‘unresolved external symbol’/’can’t resolve symbol’, then type
make -j4 -k
This will tell make to “keep on going” even if some targets can’t be build (if you only had the error in what I suggested above, then it’s OK to ignore it. For other errors, don’t do this). Then type
make install -j4 -k
Many thanks for schumachl from the GIMP IRC for pointing out the -k tip.
Gtk+ and some utilities
The rest of the stuff we are going to build will depend on Gtk+, so let’s download it from the Gtk+ downloads page (I used version 2.22.1) – download the 32 bit version even on 64-bit machines (I didn’t try a 64-bit compilation). We will also need the packages called gettext-runtime (Run-time + Dev) and gettext-tools (Dev) from the same page.
# Make a directory to download Gtk+ components into mkdir $DOWNLOADS_DIR/gtk cd $DOWNLOADS_DIR/gtk wget http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.22/gtk+-bundle_2.22.1-20101227_win32.zip wget http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime_0.18.1.1-2_win32.zip wget http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime-dev_0.18.1.1-2_win32.zip wget http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-tools-dev_0.18.1.1-2_win32.zip
“But wait – these are zip files! How can we extract zip files from the command line?” We will need a utility called unzip to do that. So let’s get unzip from it’s download page (I used version 6.0.1) and extract it:
cd $DOWNLOADS_DIR/mingw # We want to save it in the MinGW downloads directory wget http://downloads.sourceforge.net/project/mingw/MSYS/unzip/unzip-6.0-1/unzip-6.0-1-msys-1.0.13-bin.tar.lzma lzma -dc $DOWNLOADS_DIR/mingw/unzip-6.0-1-msys-1.0.13-bin.tar.lzma | tar -x -C /
Now we can extract the Gtk+ packages:
unzip -qn $DOWNLOADS_DIR/gtk/gtk+-bundle_2.22.1-20101227_win32.zip unzip -qn $DOWNLOADS_DIR/gtk/gettext-runtime_0.18.1.1-2_win32.zip unzip -qn $DOWNLOADS_DIR/gtk/gettext-runtime-dev_0.18.1.1-2_win32.zip unzip -qn $DOWNLOADS_DIR/gtk/gettext-tools-dev_0.18.1.1-2_win32.zip
Now, we will compile GEGL in the same way we compiled BABL. Note that you can compile gegl from git, but this will require you to have Ruby installed. (I will cover this in the next version of the guide). So download the latest version of GEGL from it’s download area (I used version 0.1.2) and save it into $DOWNLOADS_DIR/src. Extract it and compile it like we did to BABL.
cd $DOWNLOADS_DIR/src wget ftp://ftp.gimp.org/pub/gegl/0.1/gegl-0.1.2.tar.bz2 tar -xf $DOWNLOADS_DIR/src/gegl-0.1.2.tar.bz2 -C ~/stable-sources cd ~/stable-sources/gegl-0.1.2 ./configure --prefix=$INSTALL_PREFIX -C make -j4 make install –j4
Perl, xsltproc and intltool
In order to compile GIMP, we will need intltool (an internationalization tool used for managing the translations). In order to run intltool, we will need Perl (a programming/scripting language). So let’s get them both!
We will use a distribution called Strawberry-Perl which is a Perl distribution to windows, which has everything we need. Download one of the portable-zip versions of strawberry perl from it’s download page (I used version 220.127.116.11, older version will cause problems!), and extract it into PERL_DIR (I told you I’ll explain what it’s needed for!).
cd $DOWNLOADS_DIR/perl wget http://strawberryperl.com/download/18.104.22.168/strawberry-perl-22.214.171.124-portable.zip # Let’s create a variable pointing to the perl directory export PERL_DIR=$GIMP_BETA_DIR/perl mkdir –p $PERL_DIR cd $PERL_DIR unzip -q $DOWNLOADS_DIR/perl/strawberry-perl-126.96.36.199-portable.zip
Now, here is the tricky part:
- PERL_DIR/perl/bin contains the actual executable that we want to add to the path (perl.exe)
- Some perl modules depend on libraries which are present at PERL_DIR/c/bin, so we need to add it to the path
- There are libraries/executables in PERL_DIR/c/bin which have the same name as what we already have in the path and are using (for example, gcc)!
So, we need to add perl to the path carefully, in the following way:
# ok to put at the begining - only perl stuff is included export PATH=$PERL_DIR/perl/bin:$PATH # add this at the end, to get the perl dll's but without conflict with existing stuff export PATH=$PATH:$PERL_DIR/c/bin
Now, Strawberry-Perl has an added bonus for us – inside $PERL_DIR/c/bin, it has a tool called xsltproc, which GIMP' needs for it’s compilation. One download less for us, since we got it already :)
# Make a directory for downloading build dependancies mkdir $DOWNLOADS_DIR/build-deps cd $DOWNLOADS_DIR/build-deps wget ftp://ftp.gnome.org/pub/GNOME/sources/intltool/0.40/intltool-0.40.6.tar.bz2 tar -xf $DOWNLOADS_DIR/build-deps/intltool-0.40.6.tar.bz2 -C ~/stable-sources cd ~/stable-sources/intltool-0.40.6 ./configure && make -j4 && make install -j4
Note that we didn’t install to a special prefix (we didn’t pas a --prefix argument to configure). This is because we want to install it like a regular tool, and not as a part of our beta build.
Compiling GIMP (from package, not from git)
Now, it’s finally the time to compile GIMP! Note that we are going to compile without many plugins that have additional dependencies – getting some of these dependencies is explained below (if you want them, you’ll need to install them before compiling GIMP, or re-compile if you installed them after compiling GIMP). Let’s download GIMP (I used version 2.7.1) and extract it:
cd $DOWNLOADS_DIR/src wget ftp://ftp.gimp.org/pub/gimp/v2.7/gimp-2.7.1.tar.bz2 tar -xf $DOWNLOADS_DIR/src/gimp-2.7.1.tar.bz2 -C ~/stable-sources cd ~/stable-sources/gimp-2.7.1
Now, we are going to run GIMP’s configure script, with many flags that disable some plugins:
./configure --prefix=$INSTALL_PREFIX -C --disable-python --disable-gtk-doc --without-libtiff --without-libjpeg --without-libmng --without-libexif --without-aa --without-libxpm --without-webkit --without-librsvg --without-print --without-poppler --without-gvfs --without-libcurl --without-wmf --without-libjasper --without-lcms --without-xmc --without-alsa --without-linux-input --without-dbus --without-hal --without-mac-twain
Yup, that’s a single line with many things to disable… I have underlined the ones which have instructions below on how to get their dependencies. Now run make and make install
make -j4 make install -j4
And you are done! You can now lunch gimp by running
Now, we need something like the run-gimp.sh script that we created for the linux installation. In it we will save our environment variables which are required for some of the programs at runtime (and we will also be able to copy them back from there for general usage). This is left as homework for the reader! Simply collect all the export commands we did and put them in the file (in addition to the ones shown in the run-gimp.sh script above).
Libexif is a library which GIMP uses to read and write exif metadata for images. We can download and compile it in a way similar to the way we compiled other stuff:
mkdir $DOWNLOADS_DIR/libexif cd $DOWNLOADS_DIR/libexif wget http://downloads.sourceforge.net/project/libexif/libexif/0.6.20/libexif-0.6.20.tar.gz tar -xf $DOWNLOADS_DIR/libexif/libexif-0.6.20.tar.gz -C ~/stable-sources cd ~/stable-sources/libexif-0.6.20 ./configure --prefix=$INSTALL_PREFIX && make -j4 && make install –j4
LCMS – Little Color Management System, is a library which allows to handle color profiles and do some other color-related stuff. We can get it and compile it in a smilar way:
mkdir $DOWNLOADS_DIR/liblcms cd $DOWNLOADS_DIR/liblcms wget http://downloads.sourceforge.net/project/lcms/lcms/2.1/lcms2-2.1.tar.gz tar -xf $DOWNLOADS_DIR/liblcms/lcms2-2.1.tar.gz -C ~/stable-sources cd ~/stable-sources/lcms2-2.1 ./configure --prefix=$INSTALL_PREFIX && make -j4 && make install –j4
libjpeg, libwmf, libtiff
- libjpeg - Simply a library for reading/writing Jpeg image files.
- libtiff - Simply a library for reading/writing Tiff image files.
- libwmf - Simply a library for reading Wmf image files.
Luckily we can get a compiled versions of all these libraries, thanks to the GnuWin32 project!
#### libjpeg #### mkdir $DOWNLOADS_DIR/libjpeg && cd $DOWNLOADS_DIR/libjpeg wget http://gnuwin32.sourceforge.net/downlinks/jpeg-bin-zip.php wget http://gnuwin32.sourceforge.net/downlinks/jpeg-dep-zip.php wget http://gnuwin32.sourceforge.net/downlinks/jpeg-lib-zip.php cd $INSTALL_PREFIX for file in `ls -1 $DOWNLOADS_DIR/libjpeg`; do unzip -qn $DOWNLOADS_DIR/libjpeg/$file; done
#### libtiff (GEGL,GIMP) #### mkdir $DOWNLOADS_DIR/libtiff && cd $DOWNLOADS_DIR/libtiff wget http://gnuwin32.sourceforge.net/downlinks/tiff-bin-zip.php wget http://gnuwin32.sourceforge.net/downlinks/tiff-dep-zip.php wget http://gnuwin32.sourceforge.net/downlinks/tiff-lib-zip.php cd $INSTALL_PREFIX for file in `ls -1 $DOWNLOADS_DIR/libtiff`; do unzip -qn $DOWNLOADS_DIR/libtiff/$file; done
#### libwmf #### mkdir $DOWNLOADS_DIR/libwmf && cd $DOWNLOADS_DIR/libwmf wget http://gnuwin32.sourceforge.net/downlinks/libwmf-dep-zip.php wget http://gnuwin32.sourceforge.net/downlinks/libwmf-bin-zip.php wget http://gnuwin32.sourceforge.net/downlinks/libwmf-lib-zip.php cd $INSTALL_PREFIX for file in `ls -1 $DOWNLOADS_DIR/libwmf`; do unzip -qn $DOWNLOADS_DIR/libwmf/$file; done
Compiling GIMP 2.7 on Windows (from Git)