website view en/doc/scratchbook/gtk-libs.html @ rev 1344

Resize balinor logo to 120px
author Christophe Lincoln <pankso@slitaz.org>
date Fri Jan 22 23:02:15 2021 +0100 (2021-01-22)
parents c2f9d5d0f314
children
line source
1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4 <meta charset="UTF-8">
5 <title>SliTaz Scratchbook - GTK+ Libraries</title>
6 <meta name="description" content="">
7 <meta name="expires" content="never">
8 <meta name="modified" content="2008-11-22 17:00:00">
9 <meta name="publisher" content="www.slitaz.org">
10 <meta name="author" content="Christophe Lincoln">
11 <link rel="shortcut icon" href="favicon.ico">
12 <link rel="stylesheet" href="book.css">
13 </head>
14 <body>
16 <!-- Header and quick navigation -->
17 <div id="header">
18 <div id="quicknav" align="right">
19 <span id="top"></span>
20 <a href="x-window-system.html">X window system</a> |
21 <a href="index.html">Table of contents</a> |
22 <a href="gtk-apps.html">GTK+ apps</a>
23 </div>
24 <h1><font color="#3e1220">SliTaz Scratchbook</font></h1>
25 </div>
27 <!-- Content. -->
28 <div id="content">
29 <div class="content-right"></div>
32 <h2><font color="#df8f06">GTK+ Libraries</font></h2>
33 <p>
34 Compilation and installation of GTK+ packages and libraries.
35 </p>
36 <ul>
37 <li><a href="gtk-libs.html#about">About this chapter.</a> - Description and environmental variable ($fs)</li>
38 <li><a href="#cairo">cairo-1.2.6</a> - 2D graphics library.</li>
39 <li><a href="#glib">glib-2.12.4</a> - C routines.</li>
40 <li><a href="#pango">pango-1.14.8</a> - Library for layout and rendering of text.</li>
41 <li><a href="#atk">atk-1.12.4</a> - Accessibility toolkit.</li>
42 <li><a href="#gtk">gtk-2.8.20</a> - The GIMP Toolkit.</li>
43 <li><a href="#initramfs-iso">Generate the initramfs and an ISO image.</a></li>
44 </ul>
46 <h3 id="about">About</h3>
47 <p>
48 This chapter describes the installation and configuration of GTK libraries
49 on SliTaz used by lots of free software. Note that you can simply compile and
50 create a SliTaz package that you can install on demand with tazpkg.
51 </p>
52 <p>
53 The compilation of GTK applications can take quite some time and you must meet many dependencies.
54 You will find a guide in English:
55 <a href="http://developer.gnome.org/doc/API/2.0/gtk/gtk-building.html">gtk-building.html</a> on developer.gnome.org.
56 This document sets out the need to compile things in order: Glib, Pango, ATK and GTK+, etc.
57 Before commencing you must verify that the dependencies are properly installed on your host system.
58 Glib, Pango, ATK and GTK+ form a group of packages and are distributed by the team of GTK developers.
59 </p>
60 <h4>Environmental variable ($fs)</h4>
61 <p>
62 If you do not specify any path to the rootfs directory, export the environmental variable:
63 </p>
64 <pre> # export fs=$PWD/rootfs
65 </pre>
66 <p>
67 To check:
68 </p>
69 <pre> # echo $fs
70 </pre>
72 <h3 id="cairo">cairo-1.2.6 - 2D graphics library</h3>
73 <p>
74 We begin with libcairo (<a href="http://www.cairographics.org/">http://www.cairographics.org/</a>)
75 used to compile pango:
76 </p>
77 <pre> # cd src
78 # wget http://cairographics.org/releases/cairo-1.2.6.tar.gz
79 # tar xzf cairo-1.2.6.tar.gz
80 # cd cairo-1.2.6
81 # ./configure --prefix=/usr --mandir=/usr/share/man \
82 --with-html-dir=/usr/share/doc
83 # make
84 # make DESTDIR=$PWD/_pkg install
85 # strip -v _pkg/usr/lib/*.so*
86 </pre>
87 <h4>Install in rootfs</h4>
88 <pre> # cp -av _pkg/usr/lib/*.so* $fs/usr/lib
89 </pre>
91 <h3 id="glib">glib-2.12.4 - C routines</h3>
92 <pre> # cd ..
93 # wget ftp://ftp.gtk.org/pub/glib/2.12/glib-2.12.4.tar.bz2
94 # tar xjf glib-2.12.4.tar.bz2
95 # cd glib-2.12.4
96 # ./configure --prefix=/usr --sysconfdir=/etc \
97 --mandir=/usr/share/man --with-html-dir=/usr/share/doc
98 # make
99 # make DESTDIR=$PWD/_pkg install
100 # strip -v _pkg/usr/bin/*
101 # strip -v _pkg/usr/lib/*.so*
102 </pre>
103 <h4>Install in rootfs</h4>
104 <p>
105 Option: the utilities glib-genmarshal and gobject-query need the /lib/tls/librt.so.1:
106 </p>
107 <pre> # cp -a _pkg/usr/lib/*.so* $fs/usr/lib
108 # cp -a _pkg/usr/share/locale/fr $fs/usr/share/locale
110 The binaries and options:
111 # cp -a _pkg/usr/bin/* $fs/usr/bin
112 </pre>
114 <h3 id="pango">pango-1.14.8 - Library for layout and rendering of text</h3>
115 <pre> # cd ..
116 # wget ftp://ftp.gtk.org/pub/pango/1.14/pango-1.14.8.tar.bz2
117 # tar xjf pango-1.14.8.tar.bz2
118 # cd pango-1.14.8
119 # ./configure --prefix=/usr --sysconfdir=/etc \
120 --mandir=/usr/share/man --with-html-dir=/usr/share/doc
121 # make
122 # make DESTDIR=$PWD/_pkg install
123 # strip -v _pkg/usr/bin/*
124 # strip -v _pkg/usr/lib/*.so*
125 # strip -v _pkg/usr/lib/pango/1.5.0/modules/*
126 </pre>
127 <h4>Install in rootfs</h4>
128 <pre> # cp -a _pkg/usr/bin/* $fs/usr/bin
129 # cp -a _pkg/usr/lib/*.so* $fs/usr/lib
130 # cp -a _pkg/usr/lib/pango $fs/usr/lib
131 # rm -rf $fs/usr/lib/pango/1.5.0/modules/*.la
132 # cp -a _pkg/etc $fs
133 </pre>
134 <p>
135 Create /etc/pango.modules via chroot in the rootfs (pango-querymodules uses librt.so.1):
136 </p>
137 <pre> # chroot $fs /bin/ash
138 /# pango-querymodules &gt; /etc/pango/pango.modules
139 # exit
140 </pre>
142 <h3 id="atk">atk-1.12.4 - Accessibility toolkit</h3>
143 <pre> # cd ..
144 # wget http://ftp.gnome.org/pub/gnome/sources/atk/1.12/atk-1.12.4.tar.bz2
145 # tar xjf atk-1.12.4.tar.bz2
146 # cd atk-1.12.4
147 # ./configure --prefix=/usr --mandir=/usr/share/man \
148 --with-html-dir=/usr/share/doc
149 # make
150 # make DESTDIR=$PWD/_pkg install
151 # strip -v _pkg/usr/lib/*.so*
152 </pre>
153 <h4>Install in rootfs</h4>
154 <pre> # cp -a _pkg/usr/lib/*.so* $fs/usr/lib
155 # cp -a _pkg/usr/share/locale/fr $fs/usr/share/locale
156 </pre>
158 <h3 id="gtk">gtk+-2.8.20 - The GIMP Toolkit</h3>
159 <pre> # cd ..
160 # wget ftp://ftp.gtk.org/pub/gtk/v2.8/gtk+-2.8.20.tar.bz2
161 # tar xjf gtk+-2.8.20.tar.bz2
162 # cd gtk+-2.8.20
163 # ./configure --prefix=/usr --sysconfdir=/etc \
164 --mandir=/usr/share/man --with-html-dir=/usr/share/doc
165 # make
166 # make DESTDIR=$PWD/_pkg install
167 # strip -v _pkg/usr/bin/*
168 # strip -v _pkg/usr/lib/*.so*
169 # strip -v --strip-unneeded \
170 _pkg/usr/lib/gtk-2.0/2.4.0/*/*
171 </pre>
172 <h4>Install in rootfs</h4>
173 <pre> # cp -a _pkg/usr/lib/*.so* $fs/usr/lib
174 # mkdir $fs/usr/lib/gtk-2.0
175 # cp -a _pkg/usr/lib/gtk-2.0/2.4.0 $fs/usr/lib/gtk-2.0
176 # rm -rf $fs/usr/lib/gtk-2.0/2.4.0/*/*.la
178 Locale and themes:
179 # cp -a _pkg/usr/share/locale/fr $fs/usr/share/locale
180 # cp -a _pkg/usr/share/themes $fs/usr/share
182 The applications:
183 # cp _pkg/usr/bin/gtk-query-immodules-2.0 $fs/usr/bin
184 # cp _pkg/usr/bin/gtk-update-icon-cache $fs/usr/bin
185 # cp _pkg/usr/bin/gdk-pixbuf-csource $fs/usr/bin
186 # cp _pkg/usr/bin/gdk-pixbuf-query-loaders $fs/usr/bin
187 ...
189 For the gtk-demo application:
190 # cp -a _pkg/usr/bin/gtk-demo $fs/usr/bin
191 # cp -a _pkg/usr/share/gtk-2.0 $fs/usr/share
192 </pre>
193 <p>
194 Create files /etc/gtk-2.0/gtk.immodules and gdk-pixbuf.loaders via a chroot in the rootfs:
195 </p>
196 <pre> # chroot $fs /bin/ash
197 /# mkdir /etc/gtk-2.0
198 /# gtk-query-immodules-2.0 &gt; /etc/gtk-2.0/gtk.immodules
199 /# gdk-pixbuf-query-loaders &gt; /etc/gtk-2.0/gdk-pixbuf.loaders
200 # exit
201 </pre>
202 <p>
203 At this stage you can test GTK+ with the ‘gtk-demo’ application by creating an ISO and using qemu.
204 You can also compile a small GTK application such as LeafPad and test! The compiliation and installation
205 of GTK+ applications distributed by default with SliTaz are described in the next chapter
206 <a href="gtk-apps.html">GTK apps</a>.
207 </p>
209 <h3 id="initramfs-iso">Generate the initramfs and an ISO image</h3>
210 <p>
211 To create a new ISO image, you can use ‘mktaziso’ in
212 <a href="http://doc.slitaz.org/en:cookbook:slitaztools">SliTaz tools</a> .
213 Or you can create a new initramfs image, copy it to /boot in the root of the CD-ROM
214 (rootcd) and finally generate an ISO image with genisoimage:
215 </p>
216 <pre> # cd $fs
217 # find . -print | cpio -o -H newc | gzip -9 &gt; ../rootfs.gz
218 # cd ..
219 # cp rootfs.gz rootcd/boot
220 # genisoimage -R -o slitaz-cooking.iso -b boot/isolinux/isolinux.bin \
221 -c boot/isolinux/boot.cat -no-emul-boot -boot-load-size 4 \
222 -V "SliTaz" -boot-info-table rootcd
223 </pre>
224 <h4>Following chapter</h4>
225 <p>
226 After the libraries, the
227 <a href="gtk-apps.html">GTK+ applications</a>.
228 </p>
231 <!-- End of content -->
232 </div>
234 <!-- Footer. -->
235 <div id="footer">
236 <div class="footer-right"></div>
237 <a href="#top">Top of the page</a> |
238 <a href="index.html">Table of contents</a>
239 </div>
241 <div id="copy">
242 Copyright &copy; <span class="year"></span> <a href="http://www.slitaz.org/en/">SliTaz</a> -
243 <a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a>;<br />
244 Documentation is under
245 <a href="http://www.gnu.org/copyleft/fdl.html">GNU Free Documentation License</a>
246 and code is <a href="http://validator.w3.org/">valid xHTML 1.0</a>.
247 </div>
249 </body>
250 </html>