#### Beyond Linux® From Scratch (systemd Edition) - Version 10.1

### Chapter 25. X Libraries

- Prev

  Graphene-1.10.4

- Next

  GTK+-3.24.25

- Up
- Home

# GTK+-2.24.33

## Introduction to GTK+ 2

The GTK+ 2 package contains libraries used for creating graphical user interfaces for applications.

This package is known to build and work properly using an LFS-10.1 platform.

### Package Information

- Download (HTTP): https://download.gnome.org/sources/gtk+/2.24/gtk+-2.24.33.tar.xz

- Download (FTP): ftp://ftp.acc.umu.se/pub/gnome/sources/gtk+/2.24/gtk+-2.24.33.tar.xz

- Download MD5 sum: 0118e98dbe0e4dab90ce475f9f0e6c0c

- Download size: 12 MB

- Estimated disk space required: 285 MB

- Estimated build time: 0.9 SBU (using parallelism=4; add 0.1 SBU for tests)

### GTK+ 2 Dependencies

#### Required

ATK-2.36.0, gdk-pixbuf-2.42.2 and Pango-1.48.2

#### Recommended

hicolor-icon-theme-0.17

#### Optional

Cups-2.3.3, DocBook-utils-0.6.14, gnome-themes-extra-3.28 (runtime, for Adwaita and HighContrast themes), gobject-introspection-1.66.1 and GTK-Doc-1.33.2

### Note

If gobject-introspection-1.66.1 was installed after ATK-2.36.0, gdk-pixbuf-2.42.2, and/or Pango-1.48.2, those packages will have to be rebuilt before this package can be built.

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/gtk+2

## Installation of GTK+ 2

Install GTK+ 2 by running the following commands:

    sed -e 's#l \(gtk-.*\).sgml#& -o \1#' \
        -i docs/{faq,tutorial}/Makefile.in      &&

    ./configure --prefix=/usr --sysconfdir=/etc &&

    make

To test the results, issue: make -k check. Note that you must run the tests from a session with X Window Display capability (i.e., not a text-based terminal/console) as the tests attempt to open an X window, and the tests can take an excessively long time. Using an X Window, the tests should take less than 0.1 SBU. One test, aliasfilescheck.sh, is known to fail.

Now, as the `root` user:

    make install

### Note

If you installed the package on to your system using a “DESTDIR” method, an important file was not installed and must be copied and/or generated. Generate it using the following command as the `root` user:

    gtk-query-immodules-2.0 --update-cache

## Command Explanations

sed -i 's#l \(gtk-.*\).sgml#& -o \1#' docs/{faq,tutorial}/Makefile.in: If you have DocBook-utils-0.6.14 installed (specifically, if configure finds db2html) then it will try to use it to rebuild some of its HTML documentation and fail due to bugs in some of the `Makefile`s. This sed fixes the `Makefile`s.

`--enable-gtk-doc`: Use this parameter if GTK-Doc is installed and you wish to rebuild and install the API documentation.

## Configuring GTK+ 2

###

#### Config Files

`~/.gtkrc-2.0`, `/etc/gtk-2.0/gtkrc`, and `/usr/share/gtk-2.0/gtkrc`

###

#### Configuration Information

GTK+ 2 themes change the way a GTK+ 2 application looks. A GTK+ 2 icon theme can be used to change the icons that appear on the application's toolbar. If you have installed a GTK+ 2 theme (such as gnome-themes-extra-3.28 or GTK Engines-2.20.2), a GTK+ icon theme (such as adwaita-icon-theme-3.38.0) you can set your preferences in `~/.gtkrc-2.0`:

    cat > ~/.gtkrc-2.0 << "EOF"
    include "/usr/share/themes/Glider/gtk-2.0/gtkrc"
    gtk-icon-theme-name = "hicolor"
    EOF

There are many more themes available at Gnome-Look.org and other places.

Once you've settled on themes you like, you can (as the `root` user) make them the default system wide:

    cat > /etc/gtk-2.0/gtkrc << "EOF"
    include "/usr/share/themes/Clearlooks/gtk-2.0/gtkrc"
    gtk-icon-theme-name = "elementary"
    EOF

LXAppearance-0.6.3 is a GTK+ 2 application that can help you choose the themes you like.

## Contents

Installed Programs: gtk-builder-convert, gtk-demo, gtk-query-immodules-2.0, and gtk-update-icon-cache
Installed Libraries: libgailutil.so, libgdk-x11-2.0.so, and libgtk-x11-2.0.so
Installed Directories: /etc/gtk-2.0, /usr/include/{gail-1.0,gtk-2.0,gtk-unix-print-2.0}, /usr/lib/gtk-2.0, /usr/share/doc/gtk+-2.24.33, /usr/share/gtk-2.0, /usr/share/gtk-doc/html/{gail-libgail-util,gdk2,gtk2}, and /usr/share/themes/{Default,Emacs,Raleigh}

### Short Descriptions

gtk-builder-convert | converts glade files into XML files which can be loaded with GtkBuilder
gtk-demo | demonstrates GTK+ 2 functionality and provides code for the examples
gtk-query-immodules-2.0 | collects information about loadable input method modules for GTK+ 2 and writes it to standard output
gtk-update-icon-cache | creates mmap()able cache files for icon themes. Starting with gtk+-2.24.24, add the flag “--include-image-data” to this command, if you wish previous behavior, with image data in the cache
`libgdk-x11-2.0.so` | contains functions that act as a wrapper around the low-level drawing and windowing functions provided by the underlying graphics system
`libgtk-x11-2.0.so` | contains functions that provide an API to implement graphical user interfaces

Last updated on 2021-02-21 11:05:24 -0800

- Prev

  Graphene-1.10.4

- Next

  GTK+-3.24.25

- Up
- Home