Install GTK+-3.8.7 into Ubuntu 12.04 from scratch

Install Gtk+-3.8.7 into Ubuntu 12.04 from scratch


Table of Contents

  • Preparation
  • How the compile the source code from the beginning?

1 Preparation

The first step is alway to download the needed package. I give the following shopping list:

software package Download URL
glib-2.36.4 http://ftp.gnome.org/pub/gnome/sources/glib/2.36/
gdk-pixbuf-2.28.2 http://ftp.gnome.org/pub/gnome/sources/gdk-pixbuf/2.28/
atk-2.8.0 http://ftp.gnome.org/pub/gnome/sources/atk/2.8/
fontconfig-2.11.0 http://www.freedesktop.org/software/fontconfig/release/
harfbuzz-0.9.24 http://www.freedesktop.org/software/harfbuzz/release/
pango-1.34.1 http://ftp.gnome.org/pub/gnome/sources/pango/1.34/
libatk-bridge2.0 http://packages.ubuntu.com/zh-cn/quantal/libatk-bridge2.0-0
libatk-bridge2.0-dev http://packages.ubuntu.com/zh-cn/quantal/libatk-bridge2.0-dev
gtk+-3.8.7 http://ftp.gnome.org/pub/gnome/sources/gtk+/3.8/

My operating system is Ubuntu 12.04 which running in my workplace. I wanna try the newest GTK+3, but the Ubuntu 12.04's official software package repository didn't provider the newest GTK+3. So I guess I need to install them from the scratch.

2 How the compile the source code from the beginning?

GTK+-3.8.7 need some dependency, just according to its official website, there are Glib, Pango, gdk-pixbuf and adk, which need to upgrade to the newest version in order to meet the requirements of GTK+-3.8.7. But I need to upgrade and install more than those. The above figure in the first section collected all the resources and the download links that I need.

I install the package into an isolated environment, In my cases, I install all of them into opt directory except libatk-bridge which is deb package. So why not just upgrade packages? The reason is that I couldn't take the risk of destroying system's environment by upgrade some core library just for study purpose.

So, compile the source code in the orders of the first figures show up by following commands:

./configure --prefix=/opt/xxxx/
make
sudo make install

before compiling every single package, source following script to export the needed environment. Save the following script into a file named "gtk+3.8.7.sh", and the source command is:

source ./gtk+3.8.7.sh

The following is the "gtk+3.8.7.sh" script.



#!/bin/bash

addpath () 
{ 
    export PATH=$1:$PATH 
} 

addpkgconfigpath () 
{ 
    export PKG_CONFIG_PATH=$1:$PKG_CONFIG_PATH 
} 

addldconfigpath ()
{
    export LD_LIBRARY_PATH=$1:$LD_LIBRARY_PATH
}

# may be add include path
# C_INCLUDE_PATH CPLUS_INCLUDE_PATH
# PKG_CONFIG_LIBDIR

# LIBRARY_PATH

# glib 2.36 
addpath /opt/glib-2.36/bin/
addpkgconfigpath /opt/glib-2.36/lib/pkgconfig/
addldconfigpath /opt/glib-2.36/lib/

# gdk-pixbuf-2.28.2
addpath /opt/gdk-pixbuf-2.28.2/bin/
addpkgconfigpath /opt/gdk-pixbuf-2.28.2/lib/pkgconfig/
addldconfigpath /opt/gdk-pixbuf-2.28.2/lib/

# atk-2.8.0
addpkgconfigpath /opt/atk-2.8.0/lib/pkgconfig/
addldconfigpath /opt/atk-2.8.0/lib/

# fontconfig-2.11.0
addpath /opt/fontconfig-2.11.0/bin/
addpkgconfigpath /opt/fontconfig-2.11.0/lib/pkgconfig/
addldconfigpath /opt/fontconfig-2.11.0/lib/

# harfbuzz-0.9.24
addpath /opt/harfbuzz-0.9.24/bin/
addpkgconfigpath /opt/harfbuzz-0.9.24/lib/pkgconfig/
addldconfigpath /opt/harfbuzz-0.9.24/lib/

# pango-1.34.1
addpath /opt/pango-1.34.1/bin/
addpkgconfigpath /opt/pango-1.34.1/lib/pkgconfig/
addldconfigpath /opt/pango-1.34.1/lib/

# install libatk-bridge2.0 and libatk-bridge2.0-dev
# download from following sites:
# http://packages.ubuntu.com/zh-cn/quantal/libatk-bridge2.0-dev
# http://packages.ubuntu.com/zh-cn/quantal/libatk-bridge2.0-0

# gtk+-3.8.7 
addpath /opt/gtk+-3.8.7/bin/
addpkgconfigpath /opt/gtk+-3.8.7/lib/pkgconfig/
addldconfigpath /opt/gtk+-3.8.7/lib/

That's it, when you wanna the gtk+-3.8.7 environment, just export the needed variables into your environment by a source the above script – "gtk+-3.8.7.sh".

Comments

Popular posts from this blog

Bluedroid stack in android

How to setup a NAT server?

Network programming in elisp