website view pt/doc/scratchbook/gtk-libs.html @ rev 551

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