website diff en/doc/scratchbook/gtk-libs.html @ rev 299

en: Tidy up Cooking announcement
author Paul Issott <paul@slitaz.org>
date Sat Feb 28 16:44:37 2009 +0000 (2009-02-28)
parents
children fa2c5bed2417
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/en/doc/scratchbook/gtk-libs.html	Sat Feb 28 16:44:37 2009 +0000
     1.3 @@ -0,0 +1,251 @@
     1.4 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     1.5 +    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     1.6 +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
     1.7 +<head>
     1.8 +    <title>SliTaz Scratchbook - GTK+ Libraries</title>
     1.9 +    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
    1.10 +    <meta name="description" content="" />
    1.11 +    <meta name="expires" content="never" />
    1.12 +    <meta name="modified" content="2008-11-22 17:00:00" />
    1.13 +    <meta name="publisher" content="www.slitaz.org" />
    1.14 +    <meta name="author" content="Christophe Lincoln"/>
    1.15 +    <link rel="shortcut icon" href="favicon.ico" />
    1.16 +    <link rel="stylesheet" type="text/css" href="book.css" />
    1.17 +</head>
    1.18 +<body bgcolor="#ffffff">
    1.19 +
    1.20 +<!-- Header and quick navigation -->
    1.21 +<div id="header">
    1.22 +<div id="quicknav" align="right">
    1.23 +	<a name="top"></a>
    1.24 +	<a href="x-window-system.html">X window system</a> |
    1.25 +	<a href="index.html">Table of contents</a> |
    1.26 +	<a href="gtk-apps.html">GTK+ apps</a>
    1.27 +</div>
    1.28 +<h1><font color="#3e1220">SliTaz Scratchbook</font></h1>
    1.29 +</div>
    1.30 +
    1.31 +<!-- Content. -->
    1.32 +<div id="content">
    1.33 +<div class="content-right"></div>
    1.34 +
    1.35 +
    1.36 +<h2><font color="#df8f06">GTK+ Libraries</font></h2>
    1.37 +<p>
    1.38 +Compilation and installation of GTK+ packages and libraries.
    1.39 +</p>
    1.40 +<ul>
    1.41 +	<li><a href="#about">About this chapter.</a> - Description and environmental variable ($fs)</li>
    1.42 +	<li><a href="#cairo">cairo-1.2.6</a> - 2D graphics library.</li>
    1.43 +	<li><a href="#glib">glib-2.12.4</a> - C routines.</li>
    1.44 +	<li><a href="#pango">pango-1.14.8</a> - Library for layout and rendering of text.</li>
    1.45 +	<li><a href="#atk">atk-1.12.4</a> - Accessibility toolkit.</li>
    1.46 +	<li><a href="#gtk">gtk-2.8.20</a> - The GIMP Toolkit.</li>
    1.47 +	<li><a href="#initramfs-iso">Generate the initramfs and an ISO image.</a></li>
    1.48 +</ul>
    1.49 +<a name="about"></a>
    1.50 +<h3><font color="#6c0023">About</font></h3>
    1.51 +<p>
    1.52 +This chapter describes the installation and configuration of GTK libraries 
    1.53 +on SliTaz used by lots of free software. Note that you can simply compile and 
    1.54 +create a SliTaz package that you can install on demand with tazpkg.
    1.55 +</p>
    1.56 +<p>
    1.57 +The compilation of GTK applications can take quite some time and you must meet many dependencies. 
    1.58 +You will find a guide in English: 
    1.59 +<a href="http://developer.gnome.org/doc/API/2.0/gtk/gtk-building.html">gtk-building.html</a> on developer.gnome.org. 
    1.60 +This document sets out the need to compile things in order: Glib, Pango, ATK and GTK+, etc. 
    1.61 +Before commencing you must verify that the dependencies are properly installed on your host system. 
    1.62 +Glib, Pango, ATK and GTK+ form a group of packages and are distributed by the team of GTK developers.
    1.63 +</p>
    1.64 +<h4>Environmental variable ($fs)</h4>
    1.65 +<p>
    1.66 +If you do not specify any path to the rootfs directory, export the environmental variable:
    1.67 +</p>
    1.68 +<pre> # export fs=$PWD/rootfs
    1.69 +</pre>
    1.70 +<p>
    1.71 +To check:
    1.72 +</p>
    1.73 +<pre> # echo $fs
    1.74 +</pre>
    1.75 +<a name="cairo"></a>
    1.76 +<h3><font color="#6c0023">cairo-1.2.6 - 2D graphics library</font></h3>
    1.77 +<p>
    1.78 +We begin with libcairo (<a href="http://www.cairographics.org/">http://www.cairographics.org/</a>) 
    1.79 +used to compile pango:
    1.80 +</p>
    1.81 +<pre> # cd src
    1.82 + # wget http://cairographics.org/releases/cairo-1.2.6.tar.gz
    1.83 + # tar xzf cairo-1.2.6.tar.gz
    1.84 + # cd cairo-1.2.6
    1.85 + # ./configure --prefix=/usr --mandir=/usr/share/man \
    1.86 +   --with-html-dir=/usr/share/doc
    1.87 + # make
    1.88 + # make DESTDIR=$PWD/_pkg install
    1.89 + # strip -v _pkg/usr/lib/*.so*
    1.90 +</pre>
    1.91 +<h4>Install in rootfs</h4>
    1.92 +<pre> # cp -av _pkg/usr/lib/*.so* $fs/usr/lib
    1.93 +</pre>
    1.94 +<a name="glib"></a>
    1.95 +<h3><font color="#6c0023">glib-2.12.4 - C routines</font></h3>
    1.96 +<pre> # cd ..
    1.97 + # wget ftp://ftp.gtk.org/pub/glib/2.12/glib-2.12.4.tar.bz2
    1.98 + # tar xjf glib-2.12.4.tar.bz2
    1.99 + # cd glib-2.12.4
   1.100 + # ./configure --prefix=/usr --sysconfdir=/etc \
   1.101 +   --mandir=/usr/share/man --with-html-dir=/usr/share/doc
   1.102 + # make
   1.103 + # make DESTDIR=$PWD/_pkg install
   1.104 + # strip -v _pkg/usr/bin/*
   1.105 + # strip -v _pkg/usr/lib/*.so*
   1.106 +</pre>
   1.107 +<h4>Install in rootfs</h4>
   1.108 +<p>
   1.109 +Option: the utilities glib-genmarshal and gobject-query need the /lib/tls/librt.so.1:
   1.110 +</p>
   1.111 +<pre> # cp -a _pkg/usr/lib/*.so* $fs/usr/lib
   1.112 + # cp -a _pkg/usr/share/locale/fr $fs/usr/share/locale
   1.113 + 
   1.114 + The binaries and options:
   1.115 + # cp -a _pkg/usr/bin/* $fs/usr/bin
   1.116 +</pre>
   1.117 +<a name="pango"></a>
   1.118 +<h3><font color="#6c0023">pango-1.14.8 - Library for layout and rendering of text</font></h3>
   1.119 +<pre> # cd ..
   1.120 + # wget ftp://ftp.gtk.org/pub/pango/1.14/pango-1.14.8.tar.bz2
   1.121 + # tar xjf pango-1.14.8.tar.bz2
   1.122 + # cd pango-1.14.8
   1.123 + # ./configure --prefix=/usr --sysconfdir=/etc \
   1.124 +   --mandir=/usr/share/man --with-html-dir=/usr/share/doc
   1.125 + # make
   1.126 + # make DESTDIR=$PWD/_pkg install
   1.127 + # strip -v _pkg/usr/bin/*
   1.128 + # strip -v _pkg/usr/lib/*.so*
   1.129 + # strip -v _pkg/usr/lib/pango/1.5.0/modules/*
   1.130 +</pre>
   1.131 +<h4>Install in rootfs</h4>
   1.132 +<pre> # cp -a _pkg/usr/bin/* $fs/usr/bin
   1.133 + # cp -a _pkg/usr/lib/*.so* $fs/usr/lib
   1.134 + # cp -a _pkg/usr/lib/pango $fs/usr/lib
   1.135 + # rm -rf $fs/usr/lib/pango/1.5.0/modules/*.la
   1.136 + # cp -a _pkg/etc $fs
   1.137 +</pre>
   1.138 +<p>
   1.139 +Create /etc/pango.modules via chroot in the rootfs (pango-querymodules uses librt.so.1):
   1.140 +</p>
   1.141 +<pre> # chroot $fs /bin/ash
   1.142 + /# pango-querymodules &gt; /etc/pango/pango.modules
   1.143 + # exit
   1.144 +</pre>
   1.145 +<a name="atk"></a>
   1.146 +<h3><font color="#6c0023">atk-1.12.4 - Accessibility toolkit</font></h3>
   1.147 +<pre> # cd ..
   1.148 + # wget http://ftp.gnome.org/pub/gnome/sources/atk/1.12/atk-1.12.4.tar.bz2
   1.149 + # tar xjf atk-1.12.4.tar.bz2
   1.150 + # cd atk-1.12.4
   1.151 + # ./configure --prefix=/usr --mandir=/usr/share/man \
   1.152 +   --with-html-dir=/usr/share/doc
   1.153 + # make
   1.154 + # make DESTDIR=$PWD/_pkg install
   1.155 + # strip -v _pkg/usr/lib/*.so*
   1.156 +</pre>
   1.157 +<h4>Install in rootfs</h4>
   1.158 +<pre> # cp -a _pkg/usr/lib/*.so* $fs/usr/lib
   1.159 + # cp -a _pkg/usr/share/locale/fr $fs/usr/share/locale
   1.160 +</pre>
   1.161 +<a name="gtk"></a>
   1.162 +<h3><font color="#6c0023">gtk+-2.8.20 -  The GIMP Toolkit</font></h3>
   1.163 +<pre> # cd ..
   1.164 + # wget ftp://ftp.gtk.org/pub/gtk/v2.8/gtk+-2.8.20.tar.bz2
   1.165 + # tar xjf gtk+-2.8.20.tar.bz2
   1.166 + # cd gtk+-2.8.20
   1.167 + # ./configure --prefix=/usr --sysconfdir=/etc \
   1.168 +   --mandir=/usr/share/man --with-html-dir=/usr/share/doc
   1.169 + # make
   1.170 + # make DESTDIR=$PWD/_pkg install
   1.171 + # strip -v _pkg/usr/bin/*
   1.172 + # strip -v _pkg/usr/lib/*.so*
   1.173 + # strip -v --strip-unneeded \
   1.174 +   _pkg/usr/lib/gtk-2.0/2.4.0/*/*
   1.175 +</pre>
   1.176 +<h4>Install in rootfs</h4>
   1.177 +<pre> # cp -a _pkg/usr/lib/*.so* $fs/usr/lib
   1.178 + # mkdir $fs/usr/lib/gtk-2.0
   1.179 + # cp -a _pkg/usr/lib/gtk-2.0/2.4.0 $fs/usr/lib/gtk-2.0
   1.180 + # rm -rf $fs/usr/lib/gtk-2.0/2.4.0/*/*.la
   1.181 + 
   1.182 + Locale and themes:
   1.183 + # cp -a _pkg/usr/share/locale/fr $fs/usr/share/locale
   1.184 + # cp -a _pkg/usr/share/themes $fs/usr/share
   1.185 + 
   1.186 + The applications:
   1.187 + # cp  _pkg/usr/bin/gtk-query-immodules-2.0 $fs/usr/bin
   1.188 + # cp  _pkg/usr/bin/gtk-update-icon-cache $fs/usr/bin
   1.189 + # cp  _pkg/usr/bin/gdk-pixbuf-csource $fs/usr/bin
   1.190 + # cp  _pkg/usr/bin/gdk-pixbuf-query-loaders $fs/usr/bin
   1.191 + ...
   1.192 + 
   1.193 + For the gtk-demo application:
   1.194 + # cp -a _pkg/usr/bin/gtk-demo $fs/usr/bin
   1.195 + # cp -a _pkg/usr/share/gtk-2.0 $fs/usr/share
   1.196 +</pre>
   1.197 +<p>
   1.198 +Create files /etc/gtk-2.0/gtk.immodules and gdk-pixbuf.loaders via a chroot in the rootfs:
   1.199 +</p>
   1.200 +<pre> # chroot $fs /bin/ash
   1.201 + /# mkdir /etc/gtk-2.0
   1.202 + /# gtk-query-immodules-2.0 &gt; /etc/gtk-2.0/gtk.immodules
   1.203 + /# gdk-pixbuf-query-loaders &gt; /etc/gtk-2.0/gdk-pixbuf.loaders
   1.204 + # exit
   1.205 +</pre>
   1.206 +<p>
   1.207 +At this stage you can test GTK+ with the 'gtk-demo' application by creating an ISO and using qemu. 
   1.208 +You can also compile a small GTK application such as LeafPad and test! The compiliation and installation 
   1.209 +of GTK+ applications distributed by default with SliTaz are described in the next chapter
   1.210 +<a href="http://www.slitaz.org/doc/scratchbook/gtk-apps.html">GTK apps</a>.
   1.211 +</p>
   1.212 +<a name="initramfs-iso"></a>
   1.213 +<h3><font color="#6c0023">Generate the initramfs and an ISO image</font></h3>
   1.214 +<p>
   1.215 +To create a new ISO image, you can use 'mktaziso' in 
   1.216 +<a href="http://www.slitaz.org/en/doc/cookbook/slitaz-tools.html">SliTaz tools</a> .  
   1.217 +Or you can create a new initramfs image, copy it to /boot in the root of the cdrom
   1.218 +(rootcd) and finally generate an ISO image with genisoimage:
   1.219 +</p>
   1.220 +<pre> # cd $fs
   1.221 + # find . -print | cpio -o -H newc | gzip -9 &gt; ../rootfs.gz
   1.222 + # cd ..
   1.223 + # cp rootfs.gz rootcd/boot
   1.224 + # genisoimage -R -o slitaz-cooking.iso -b boot/isolinux/isolinux.bin \
   1.225 +   -c boot/isolinux/boot.cat -no-emul-boot -boot-load-size 4 \
   1.226 +   -V "SliTaz" -boot-info-table rootcd 
   1.227 +</pre>
   1.228 +<h4>Following chapter</h4>
   1.229 +<p>
   1.230 +After the libraries, the
   1.231 +<a href="gtk-apps.html">GTK+ applications</a>.
   1.232 +</p>
   1.233 +
   1.234 +
   1.235 +<!-- End of content -->
   1.236 +</div>
   1.237 +
   1.238 +<!-- Footer. -->
   1.239 +<div id="footer">
   1.240 +	<div class="footer-right"></div>
   1.241 +	<a href="#top">Top of the page</a> | 
   1.242 +	<a href="index.html">Table of contents</a>
   1.243 +</div>
   1.244 +
   1.245 +<div id="copy">
   1.246 +    Copyright &copy; 2008 <a href="http://www.slitaz.org/en/">SliTaz</a> -
   1.247 +    <a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a>;<br />
   1.248 +    Documentation is under
   1.249 +    <a href="http://www.gnu.org/copyleft/fdl.html">GNU Free Documentation License</a>
   1.250 +    and code is <a href="http://validator.w3.org/">valid xHTML 1.0</a>.
   1.251 +</div>
   1.252 +
   1.253 +</body>
   1.254 +</html>