Below are GTK+ 3 components that need to be downloaded from their respective project site:
- GTK+, Glib, Pango, Atk, gdk-pixbuf, gtk-doc - http://gnome.org
- Cairo - http://cairographic.org
- FreeType, Fontconfig, HARFBUZZ - http://freedesktop.org
Also it is important to have a correct version for package dependency, for example GTK+ 3.6.4 requires at least version 2.34.x of Glib, as well as other package. gtk-doc is optional (enabled with --enable-gtk-doc configure argument) to generate GTK+ HTML style documentation which very important to me.
So here are the building steps:
- gtk-doc-1.18
$ ./configure && make && sudo make install - glib-2.34.3
$ ./configure --prefix=/opt/gtk --enable-gtk-doc
$ make && sudo make install - atk-2.6.0
$ PKG_CONFIG_PATH=/opt/gtk/lib/pkgconfig LD_LIBRARY_PATH=/opt/gtk/lib ./configure --prefix=/opt/gtk --enable-gtk-doc
$ make && sudo make install - at-spi2-core-2.6.3
$ PKG_CONFIG_PATH=/opt/gtk/lib/pkgconfig LD_LIBRARY_PATH=/opt/gtk/lib ./configure --prefix=/opt/gtk
$ make && sudo make install - at-spi2-atk-2.6.2
$ PKG_CONFIG_PATH=/opt/gtk/lib/pkgconfig LD_LIBRARY_PATH=/opt/gtk/lib ./configure --prefix=/opt/gtk
$ PATH=/opt/gtk/bin:$PATH make
$ sudo PATH=$PATH:/opt/gtk/bin make install - pixman-0.28.2
$ ./configure --prefix=/opt/gtk
$ make && sudo make install - cairo-1.2.14
$ PKG_CONFIG_PATH=/opt/gtk/lib/pkgconfig ./configure --prefix=/opt/gtk --enable-gtk-doc
$ make && sudo make install - gdk-pixbuf-2.29.0
$ PKG_CONFIG_PATH=/opt/gtk/lib/pkgconfig LD_LIBRARY_PATH=/opt/gtk/lib ./configure --prefix=/opt/gtk --enable-gtk-doc --without-libtiff
$ make && sudo make install - freetype-2.4.11
$ ./configure --prefix=/opt/gtk
$ make && sudo make install - fontconfig-2.10.91
$ ./configure --prefix=/opt/gtk
$ make && sudo make install - harfbuzz-0.9.16
$ ./configure --prefix=/opt/gtk
$ make && sudo make install - pango-1.32.5
$ PKG_CONFIG_PATH=/opt/gtk/lib/pkgconfig ./configure --prefix=/opt/gtk --enable-gtk-doc
$ make && sudo make install - gtk+-3.6.4
$ PATH=/opt/gtk/bin:$PATH PKG_CONFIG_PATH=/opt/gtk/lib/pkgconfig LD_LIBRARY_PATH=/opt/gtk/lib ./configure --prefix=/opt/gtk --enable-gtk-doc --enable-packagekit=no
$ PATH=/opt/gtk/bin:$PATH make
$ PATH=/opt/gtk/bin:$PATH sudo make install
$ LD_LIBRARY_PATH=/opt/gtk/lib /opt/gtk/bin/gtk3-demo
To compile and link against GTK+ 3 (or any component), use pkg-config environment variable PKG_CONFIG_PATH to set GTK+ 3 pkg-config file location for both --cflags and --libs argument.