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