slitaz-doc-wiki-data view pages/en/scratchbook/gtk-libs.txt @ rev 45

Update pages/en folder.
author Christopher Rogers <slaxemulator@gmail.com>
date Sun May 01 07:41:07 2011 +0000 (2011-05-01)
parents
children
line source
1 ====== GTK+ Libraries ======
3 Compilation and installation of GTK+ packages and libraries.
5 ===== About =====
7 This chapter describes the installation and configuration of GTK libraries on SliTaz used by lots of free software. Note that you can simply compile and create a SliTaz package that you can install on demand with tazpkg.
9 The compilation of GTK applications can take quite some time and you must meet many dependencies. You will find a guide in English: [[http://developer.gnome.org/gtk/2.22/gtk-building.html|gtk-building.html]] on developer.gnome.org. This document sets out the need to compile things in order: Glib, Pango, ATK and GTK+, etc. Before commencing you must verify that the dependencies are properly installed on your host system. Glib, Pango, ATK and GTK+ form a group of packages and are distributed by the team of GTK developers.
11 ==== Environmental variable ($fs) ====
13 If you do not specify any path to the rootfs directory, export the environmental variable:
15 # export fs=$PWD/rootfs
17 To check:
19 # echo $fs
21 ===== cairo-1.2.6 - 2D graphics library =====
23 We begin with libcairo (http://www.cairographics.org/) used to compile pango:
25 # cd src
26 # wget http://cairographics.org/releases/cairo-1.2.6.tar.gz
27 # tar xzf cairo-1.2.6.tar.gz
28 # cd cairo-1.2.6
29 # ./configure --prefix=/usr --mandir=/usr/share/man \
30 --with-html-dir=/usr/share/doc
31 # make
32 # make DESTDIR=$PWD/_pkg install
33 # strip -v _pkg/usr/lib/*.so*
35 ==== Install in rootfs ====
37 # cp -av _pkg/usr/lib/*.so* $fs/usr/lib
39 ===== glib-2.12.4 - C routines =====
41 # cd ..
42 # wget ftp://ftp.gtk.org/pub/glib/2.12/glib-2.12.4.tar.bz2
43 # tar xjf glib-2.12.4.tar.bz2
44 # cd glib-2.12.4
45 # ./configure --prefix=/usr --sysconfdir=/etc \
46 --mandir=/usr/share/man --with-html-dir=/usr/share/doc
47 # make
48 # make DESTDIR=$PWD/_pkg install
49 # strip -v _pkg/usr/bin/*
50 # strip -v _pkg/usr/lib/*.so*
52 ==== Install in rootfs ====
54 Option: the utilities glib-genmarshal and gobject-query need the /lib/tls/librt.so.1:
56 # cp -a _pkg/usr/lib/*.so* $fs/usr/lib
57 # cp -a _pkg/usr/share/locale/fr $fs/usr/share/locale
59 The binaries and options:
60 # cp -a _pkg/usr/bin/* $fs/usr/bin
62 ===== pango-1.14.8 - Library for layout and rendering of text =====
64 # cd ..
65 # wget ftp://ftp.gtk.org/pub/pango/1.14/pango-1.14.8.tar.bz2
66 # tar xjf pango-1.14.8.tar.bz2
67 # cd pango-1.14.8
68 # ./configure --prefix=/usr --sysconfdir=/etc \
69 --mandir=/usr/share/man --with-html-dir=/usr/share/doc
70 # make
71 # make DESTDIR=$PWD/_pkg install
72 # strip -v _pkg/usr/bin/*
73 # strip -v _pkg/usr/lib/*.so*
74 # strip -v _pkg/usr/lib/pango/1.5.0/modules/*
76 ==== Install in rootfs ====
78 # cp -a _pkg/usr/bin/* $fs/usr/bin
79 # cp -a _pkg/usr/lib/*.so* $fs/usr/lib
80 # cp -a _pkg/usr/lib/pango $fs/usr/lib
81 # rm -rf $fs/usr/lib/pango/1.5.0/modules/*.la
82 # cp -a _pkg/etc $fs
84 Create /etc/pango.modules via chroot in the rootfs (pango-querymodules uses librt.so.1):
86 # chroot $fs /bin/ash
87 /# pango-querymodules > /etc/pango/pango.modules
88 # exit
90 ===== atk-1.12.4 - Accessibility toolkit =====
92 # cd ..
93 # wget http://ftp.gnome.org/pub/gnome/sources/atk/1.12/atk-1.12.4.tar.bz2
94 # tar xjf atk-1.12.4.tar.bz2
95 # cd atk-1.12.4
96 # ./configure --prefix=/usr --mandir=/usr/share/man \
97 --with-html-dir=/usr/share/doc
98 # make
99 # make DESTDIR=$PWD/_pkg install
100 # strip -v _pkg/usr/lib/*.so*
102 ==== Install in rootfs ====
104 # cp -a _pkg/usr/lib/*.so* $fs/usr/lib
105 # cp -a _pkg/usr/share/locale/fr $fs/usr/share/locale
107 ===== gtk+-2.8.20 - The GIMP Toolkit =====
109 # cd ..
110 # wget ftp://ftp.gtk.org/pub/gtk/v2.8/gtk+-2.8.20.tar.bz2
111 # tar xjf gtk+-2.8.20.tar.bz2
112 # cd gtk+-2.8.20
113 # ./configure --prefix=/usr --sysconfdir=/etc \
114 --mandir=/usr/share/man --with-html-dir=/usr/share/doc
115 # make
116 # make DESTDIR=$PWD/_pkg install
117 # strip -v _pkg/usr/bin/*
118 # strip -v _pkg/usr/lib/*.so*
119 # strip -v --strip-unneeded \
120 _pkg/usr/lib/gtk-2.0/2.4.0/*/*
122 ==== Install in rootfs ====
124 # cp -a _pkg/usr/lib/*.so* $fs/usr/lib
125 # mkdir $fs/usr/lib/gtk-2.0
126 # cp -a _pkg/usr/lib/gtk-2.0/2.4.0 $fs/usr/lib/gtk-2.0
127 # rm -rf $fs/usr/lib/gtk-2.0/2.4.0/*/*.la
129 Locale and themes:
130 # cp -a _pkg/usr/share/locale/fr $fs/usr/share/locale
131 # cp -a _pkg/usr/share/themes $fs/usr/share
133 The applications:
134 # cp _pkg/usr/bin/gtk-query-immodules-2.0 $fs/usr/bin
135 # cp _pkg/usr/bin/gtk-update-icon-cache $fs/usr/bin
136 # cp _pkg/usr/bin/gdk-pixbuf-csource $fs/usr/bin
137 # cp _pkg/usr/bin/gdk-pixbuf-query-loaders $fs/usr/bin
138 ...
140 For the gtk-demo application:
141 # cp -a _pkg/usr/bin/gtk-demo $fs/usr/bin
142 # cp -a _pkg/usr/share/gtk-2.0 $fs/usr/share
144 Create files /etc/gtk-2.0/gtk.immodules and gdk-pixbuf.loaders via a chroot in the rootfs:
146 # chroot $fs /bin/ash
147 /# mkdir /etc/gtk-2.0
148 /# gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules
149 /# gdk-pixbuf-query-loaders > /etc/gtk-2.0/gdk-pixbuf.loaders
150 # exit
152 At this stage you can test GTK+ with the 'gtk-demo' application by creating an ISO and using qemu. You can also compile a small GTK application such as LeafPad and test! The compiliation and installation of GTK+ applications distributed by default with SliTaz are described in the next chapter [[gtk-apps|GTK apps]].
154 ===== Generate the initramfs and an ISO image =====
156 To create a new ISO image, you can use 'mktaziso' in [[http://doc.slitaz.org/en:cookbook:slitaztools|SliTaz tools]] . Or you can create a new initramfs image, copy it to /boot in the root of the cdrom (rootcd) and finally generate an ISO image with genisoimage:
158 # cd $fs
159 # find . -print | cpio -o -H newc | gzip -9 > ../rootfs.gz
160 # cd ..
161 # cp rootfs.gz rootcd/boot
162 # genisoimage -R -o slitaz-cooking.iso -b boot/isolinux/isolinux.bin \
163 -c boot/isolinux/boot.cat -no-emul-boot -boot-load-size 4 \
164 -V "SliTaz" -boot-info-table rootcd
166 ==== Following chapter ====
168 After the libraries, the [[gtk-apps|GTK+ applications]].