website annotate en/doc/scratchbook/gtk-libs.html @ rev 550

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