Building GTK+

M

Mitt Green

Guest
After extracting files to home, I ran
Code:
./configure
and what happens...
Code:
[blah-blah-blah...]
configure: error: Package requirements (glib-2.0 >= 2.28.0    atk >= 1.29.2   
pango >= 1.20    cairo >= 1.6    gdk-pixbuf-2.0 >= 2.21.0) were not met:

No package 'atk' found
No package 'pango' found
No package 'cairo' found
No package 'gdk-pixbuf-2.0' found


Commands
Code:
CPPFLAGS="-I/opt/gtk/include"
LDFLAGS="-L/opt/gtk/lib"
PKG_CONFIG_PATH="/opt/gtk/lib/pkgconfig"
export CPPFLAGS LDFLAGS PKG_CONFIG_PATH
LD_LIBRARY_PATH="/opt/gtk/lib"
PATH="/opt/gtk/bin:$PATH"
export LD_LIBRARY_PATH PATH
don't make a sense. Therefore no make file is in the directory and so unable to build gtk+.

Thanks for any help!

Edited: see http://www.linux.org/threads/building-gtk.6623/#post-23371
 
Last edited:


J

JasKinasis

Guest
You are missing some of the build dependencies.

You need the development packages for atk, pango, cairo and gdk-pixbuf-2.0.
Exactly how to do that would depend on the distro you currently have installed.
Search for the appropriate development packages in your distros package management system and download/install them.

Once you have located and installed the four dev packages mentioned in the error you posted; you should try running ./configure again and see what happens. With any luck the configuration script will succeed and will create some makefiles for you!
 
M

Mitt Green

Guest
You are missing some of the build dependencies.

You need the development packages for atk, pango, cairo and gdk-pixbuf-2.0.
Exactly how to do that would depend on the distro you currently have installed.
Search for the appropriate development packages in your distros package management system and download/install them.

Once you have located and installed the four dev packages mentioned in the error you posted; you should try running ./configure again and see what happens. With any luck the configuration script will succeed and will create some makefiles for you!
I forgot: if
Code:
sudo apt-get install [all these packages]
then
Code:
unable to locate [these packages]
 
G

GrumpyOldMan

Guest
You're gonna need things like libcairo2-dev, libpango1.0-dev, and so on. Since you seem to be using a Debian-derived system (all those apt-gets give it away), try using synaptic and searching for each component.
 
R

ryanvade

Guest
After extracting files to home, I ran
Code:
./configure
and what happens...
Code:
[blah-blah-blah...]
configure: error: Package requirements (glib-2.0 >= 2.28.0    atk >= 1.29.2  
pango >= 1.20    cairo >= 1.6    gdk-pixbuf-2.0 >= 2.21.0) were not met:

No package 'atk' found
No package 'pango' found
No package 'cairo' found
No package 'gdk-pixbuf-2.0' found


Commands
Code:
CPPFLAGS="-I/opt/gtk/include"
LDFLAGS="-L/opt/gtk/lib"
PKG_CONFIG_PATH="/opt/gtk/lib/pkgconfig"
export CPPFLAGS LDFLAGS PKG_CONFIG_PATH
LD_LIBRARY_PATH="/opt/gtk/lib"
PATH="/opt/gtk/bin:$PATH"
export LD_LIBRARY_PATH PATH
don't make a sense. Therefore no make file is in the directory and so unable to build gtk+.

Thanks for any help!

Edited: see http://www.linux.org/threads/building-gtk.6623/#post-23371
What distribution are you using?
 
M

Mitt Green

Guest
You're gonna need things like libcairo2-dev, libpango1.0-dev, and so on. Since you seem to be using a Debian-derived system (all those apt-gets give it away), try using synaptic and searching for each component.
I'm using Ubuntu, so I found these packages in Software Center. Built successfully. Thanks.
 
J

JasKinasis

Guest
Sorry, I didn't know which distro you were running, so I didn't know which format the names would be in for the dev packages. As grumpy old man pointed out, in Debian the package naming convention for development libraries is typically "lib{package name}-dev" or "lib{package name}{version}-dev".

Also for future reference: On a Debian derived system you can use `apt-cache search` to search for appropriate packages on the command-line.

So for example, you didn't know the exact name of the atk development library, so to find the exact package: we know the name should at least contain 'atk' and 'dev' (because it is a development package). So you could use something like this:
`apt-cache search --names-only atk | grep dev`

The '--names-only' option will cause apt to only search through the package-names (ignoring the descriptions), which should cut down on false positives. Finally piping the output to grep and filtering on 'dev' will ensure that you only see packages with atk and dev in the name.

Offhand, this should list libatk1.0-dev, libatk-bridge2.0-dev and libatkmm1.6-dev (with their descriptions). It might also list a couple other unrelated dev packages if there are any with atk somewhere in the package name (at work ATM, so stuck with Winblows and can't check!). But from the package names/descriptions returned and by process of elimination, you should be able to work out which packages are most relevant to you from their descriptions.

Assuming that the three packages I have named are the only results that are returned by our search: All three are relevant to atk, but the output from configure mentioned nothing about atkmm or atk-bridge, so you can safely eliminate them leaving only one package: libatk1.0-dev.

Congratulations, you've found one of the dev packages you were looking for! :)

Once you've worked out the exact names of all the packages you require, you can install them with a single "sudo apt-get install"

BTW: I know you've already found and installed the packages, this was just a quick guide to using 'apt-cache search' . I just used one of the packages you were looking for as an example! :)
 
Last edited:
J

JasKinasis

Guest
For Debian based distros, there is also the "apt-get build-dep" command which can be helpful when compiling from source. This gets the build dependencies for the current version of a given program/library in the repos.

As an example, let's say there is a package in your distros repo called libraryX. You have it installed, but you do not like its default configuration and you want to rebuild it from source with some different build options set, in order to enable/disable particular functionality and then re-install it.

You can get the source-code for the current version in the repos using:
'sudo apt-get source libraryX' (NOTE: You must have the source repos enabled in order to get source-code!)
and install all of its build dependencies using:
'sudo apt-get build-dep libraryX`

Then you can make any changes to the configuration/makefiles for the program before attempting to build and install it.


Similarly, if you have the source for a new version of a package that you downloaded from a website and you want to build and install it; If there is a recent version of that program/library in your repos, you could try to install the build dependencies for the current version before attempting to build the newer source you downloaded.

So as a more concrete example let's use Gimp. The version in the Ubuntu 14.04 repo is currently 2.8.10. Now let's say there is a really annoying bug in a bit of functionality that you use often. This bug has been fixed in the current version (2.8.14), but that version is not available to you in the standard repos.

And before anybody says, I know there is a ppa for Gimp that will allow you to get the latest version on the *buntu family of distros, but just for the sake of this example, we want to build it from source and install it.

You can download the sources for the latest version of Gimp from the Gimp website. And to install the build dependencies, you can try using:
`sudo apt-get build-dep gimp`
Which will automatically download and install the build dependencies for the version of gimp that is in the repo (2.8.10). As long as the build dependencies have not changed for the newer version, the source for the newer version should also compile without any problems.

If there are any changes to the build dependencies, then it means that you'd need to manually install (or build and install) any missing dependencies for the new version of Gimp. But installing the current versions dependencies will at least install most of the dependencies (if not all of them) and will save you a lot of time!

If you are building a package that is not in your distros repos and/or there are no recent versions of it, it is often a case of using 'apt-cache search' to see if you can find all of the relevant dependencies in the repos. Install all of the dependencies that you can find and then search online to find the sources for any missing dependencies. Then you have to try and build and install those, which could entail finding even more dependencies! heh heh!

Building from source can be a bit of a ball-ache sometimes, but it's not too bad once you get used to it!
 
Last edited:


Staff online

Members online


Latest posts

Top