slitaz-doc-wiki-data view pages/en/scratchbook/x-window-system.txt @ rev 45

Update pages/en folder.
author Christopher Rogers <slaxemulator@gmail.com>
date Sun May 01 07:41:07 2011 +0000 (2011-05-01)
parents
children
line source
1 ====== X window system ======
3 Installation and basic configuration of the X window system.
5 ===== About =====
7 This chapter describes the installation and configuration of the X window system on SliTaz. We will install libraries for expat, XML, fonts, a graphical server (Xvesa), a terminal emulator (xterm), various small tools and a window manager (JWM). We'll also install the JPEG libraries and Links web browser.
9 ==== Environmental variable ($fs) ====
11 If you do not specify any path to the rootfs directory, export the environmental variable:
13 # export fs=$PWD/rootfs
15 To check:
17 # echo $fs
19 ===== expat-2.0.0 - XML parser library =====
21 Expat (http://expat.sourceforge.net/) contains the XML parsing libraries:
23 # cd ..
24 # wget http://switch.dl.sourceforge.net/sourceforge/expat/expat-2.0.0.tar.gz
25 # tar xzf expat-2.0.0.tar.gz
26 # cd expat-2.0.0
27 # ./configure --sysconfdir=/etc --prefix=/usr \
28 --mandir=/usr/share/man
29 # make
30 # make DESTDIR=$PWD/_pkg install
31 # strip -v _pkg/usr/lib/*
32 # strip -v _pkg/usr/bin/*
34 Thereafter, we will install 'xterm' which needs libexpat.so.0, simply create a symbolic link and voilĂ . Then you can install the 'xmlwf' application and libraries in the rootfs:
36 # cd _pkg/usr/lib
37 # ln -s libexpat.so.1.5.0 libexpat.so.0
38 # cp -a *.so* $fs/usr/lib
39 # cd ..
40 # cp -a bin/* $fs/usr/bin
41 # cd ../..
43 ==== libs ====
45 Libraries used by xmlwf:
46 <file>
47 libexpat.so.1 => /usr/lib/libexpat.so.1 (0x40021000)
48 libc.so.6 => /lib/tls/libc.so.6 (0x40041000)
49 /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
50 </file>
51 ===== freetype-2.3.1 - System font libraries =====
53 The package freetype (http://www.freetype.org/) contains libraries used by X for configuring the system fonts:
55 # cd ..
56 # wget http://download.savannah.gnu.org/releases/freetype/freetype-2.3.1.tar.bz2
57 # tar xjf freetype-2.3.1.tar.bz2
58 # cd freetype-2.3.1
59 # ./configure --sysconfdir=/etc --prefix=/usr \
60 --mandir=/usr/share/man
61 # make
62 # make DESTDIR=$PWD/_pkg install
63 # strip -vs _pkg/usr/lib/*
64 # cp -a _pkg/usr/bin/* $fs/usr/bin
65 # cp -a _pkg/usr/lib/*.so* $fs/usr/lib
67 ===== fontconfig-2.4.2 - Manage system fonts =====
69 The fontconfig package ([[http://www.fontconfig.org/wiki/|www.fontconfig.org/wiki/]]) provides the libfontconfig library used by many programs under X. Note XFree86 also provides these utilities. We chose the original package because it works better with JWM:
71 # cd ..
72 # wget http://fontconfig.org/release/fontconfig-2.4.2.tar.gz
73 # tar xzf fontconfig-2.4.2.tar.gz
74 # cd fontconfig-2.4.2
75 # ./configure --sysconfdir=/etc --prefix=/usr \
76 --mandir=/usr/share/man --localstatedir=/var
77 # make
78 # make DESTDIR=$PWD/_pkg install
79 # strip -v _pkg/usr/bin/*
80 # strip -v _pkg/usr/lib/*
81 # cp -a _pkg/usr/bin/* $fs/usr/bin
82 # cp -a _pkg/usr/lib/*.so* $fs/usr/lib
83 # cp -a _pkg/etc $fs
84 # cp -a _pkg/var $fs
86 ==== libs ====
88 A 'ldd' on fc-cache gives the libraries below. You can also use libfreetype of XFree86:
89 <file>
90 libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0xb7f12000)
91 libz.so.1 => /usr/lib/libz.so.1 (0xb7eff000)
92 libexpat.so.1 => /usr/lib/libexpat.so.1 (0xb7edf000)
93 libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0xb7eb0000)
94 libc.so.6 => /lib/tls/libc.so.6 (0xb7d7b000)
95 /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0xb7f8c000)
96 </file>
97 ===== Xserver - Graphical Xvesa server of Xfree86 =====
99 We will use the binary versions of Xvesa server ([[http://www.xfree86.org/|www.xfree86.org/]]) and fonts distributed by Xfree86.org. We could also copy Xorg libraries from the host system that would be used for compiling X applications. Xvesa works well like this and simplifies things. You can also rebuild [[xorg|Xorg packages]] on your development system.
101 ==== Xtinyx server - Xvesa ====
103 The Xvesa server is very light and uses tiny libraries; it is contained in the Xtinyx.tgz archive. Download and install in /usr/bin of SliTaz rootfs:
105 # cd ..
106 # mkdir -p XFree86-4.6.0 && cd XFree86-4.6.0
107 # wget http://ftp.xfree86.org/pub/XFree86/4.6.0/binaries/Linux-ix86-glibc23/Xtinyx.tgz
108 # tar xzf Xtinyx.tgz
109 # cp bin/Xvesa $fs/usr/bin
110 # strip $fs/usr/bin/Xvesa
111 # chmod 4711 $fs/usr/bin/Xvesa
113 ==== libs for Xvesa ====
114 <file>
115 libz.so.1 => /usr/lib/libz.so.1 (0xb7ed6000)
116 libm.so.6 => /lib/tls/libm.so.6 (0xb7eb1000)
117 libc.so.6 => /lib/tls/libc.so.6 (0xb7d7e000)
118 /lib/ld-linux.so.2 (0xb7ef8000)
119 </file>
120 ==== rgb.txt - RGB colors in X ====
122 The colors configuration file used by the X server is called: "rgb.txt"; we suggest that you copy it to the host system. The library libX11.so will seek the configuration files in /usr/share/X11, and the Xvesa server in /usr/X11R6/lib/X11; we create a link in /usr/share/X11 to enable this:
124 # mkdir -p $fs/usr/share/X11
125 # cp /usr/share/X11/rgb.txt $fs/usr/share/X11
126 # chroot $fs /bin/ash
127 # mkdir -p /usr/X11R6/lib/X11/
128 # ln -s /usr/share/X11/rgb.txt /usr/X11R6/lib/X11/rgb.txt
129 # exit
131 ==== Xfnts - Fonts ====
133 To operate the server, we need the basic fonts; you can download them from Xfree86.org and then compile packages from Xorg, or copy them from your host system. The system fonts can be put into different folders and the cache updated with "lc-cache". Attention, fonts take pride of place and you can only install the minimum. /usr/share/fonts contains the TrueType fonts such as bitstream-vera:
135 # wget http://ftp.xfree86.org/pub/XFree86/4.6.0/binaries/Linux-ix86-glibc23/Xfnts.tgz
136 # tar xzf Xfnts.tgz
137 # mkdir -p $fs/usr/X11R6/lib/X11/fonts
138 # mkdir -p $fs/usr/share/fonts/truetype
140 Copy the fonts...
141 # cp -a lib/X11/fonts/* $fs/usr/X11R6/lib/X11/fonts)
142 # cp -a /usr/share/fonts/truetype/* $fs/usr/share/fonts/truetype
144 Then regenerate the fonts.dir file, you must run mkfontdir on the directory in question:
146 # mkfontdir $fs/usr/X11R6/lib/X11/fonts/75dpi
148 Fontconfig configuration files can be found in /etc/fonts provided by the fontconfig package. Now you can run 'fc-cache' to update the cache, and 'fc-list' for a list of fonts. You do this by chrooting into the rootfs:
150 # chroot $fs /bin/ash
151 # fc-cache -v
152 # fc-list
153 # exit
155 ==== Xlib locale - Localization files ====
157 On SliTaz, we installed 4 locales: C, iso8859-1, iso8859-15 and iso 8859-2 from the [[xorg|compilation of Xorg]]. You can copy these files from the host system or use the files distributed by XFree86. Sample copy of all the locales from the host system:
159 # mkdir -p $fs/usr/share/X11/locale
160 # cp -a /usr/share/X11/locale/* $fs/usr/share/X11/locale
162 ==== Using X ====
164 Note that you can already use Xvesa as a X terminal if you have a machine on the network accepting XDMCP connections. For this, you can start the server with the "-query" option. For example:
166 # Xvesa -ac -shadow -screen 1024x768x24 -query 192.168.0.2
168 ===== xterm - Terminal Emulator =====
170 The xterm package ([[http://invisible-island.net/xterm/|invisible-island.net/xterm/]]) provides a terminal emulator for X:
172 # wget ftp://invisible-island.net/xterm/xterm-223.tgz
173 # tar xzf xterm-223.tgz
174 # cd xterm-223
175 # ./configure --prefix=/usr --sysconfdir=/etc \
176 --mandir=/usr/share/man --localstatedir=/var \
177 --with-app-defaults=/usr/share/X11/app-defaults \
178 --build=i486-pc-linux-gnu --host=i486-pc-linux-gnu
179 # make
180 # make DESTDIR=$PWD/_pkg install
181 # strip _pkg/usr/bin/*
182 # cp _pkg/usr/bin/* $fs/usr/bin
183 # cp -a _pkg/usr/share/X11/* $fs/usr/share/X11
185 ==== libs ====
187 A ldd on XTerm, we copy (and strip) the missing libraries from the host system:
188 <file>
189 libXft.so.2 => /usr/lib/libXft.so.2 (0xb7f09000)
190 libXrender.so.1 => /usr/lib/libXrender.so.1 (0xb7f00000)
191 libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0xb7ed5000)
192 libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0xb7e68000)
193 libz.so.1 => /usr/lib/libz.so.1 (0xb7e54000)
194 libX11.so.6 => /usr/lib/libX11.so.6 (0xb7d68000)
195 libXaw.so.7 => /usr/lib/libXaw.so.7 (0xb7d0f000)
196 libXmu.so.6 => /usr/lib/libXmu.so.6 (0xb7cfa000)
197 libXext.so.6 => /usr/lib/libXext.so.6 (0xb7cec000)
198 libXt.so.6 => /usr/lib/libXt.so.6 (0xb7c9e000)
199 libSM.so.6 => /usr/lib/libSM.so.6 (0xb7c96000)
200 libICE.so.6 => /usr/lib/libICE.so.6 (0xb7c7f000)
201 libncurses.so.5 => /lib/libncurses.so.5 (0xb7c3c000)
202 libc.so.6 => /lib/libc.so.6 (0xb7b2c000)
203 libexpat.so.1 => /usr/lib/libexpat.so.1 (0xb7b0b000)
204 libXau.so.6 => /usr/lib/libXau.so.6 (0xb7b08000)
205 libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb7b03000)
206 libdl.so.2 => /lib/libdl.so.2 (0xb7aff000)
207 libXpm.so.4 => /usr/lib/libXpm.so.4 (0xb7aee000)
208 </file>
209 ===== libpng-1.2.18 - PNG Libraries ====
211 PNG libraries (http://libpng.org/pub/png/libpng.html) are used to manipulate and format PNG images:
213 # wget http://puzzle.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.18.tar.bz2
214 # tar xjf libpng-1.2.18.tar.bz2
215 # cd libpng-1.2.18
216 # ./configure --enable-shared --prefix=/usr \
217 --mandir=/usr/share/man
218 # make
219 # make DESTDIR=$PWD/_pkg install
220 # strip _pkg/usr/lib/*.so*
221 # cp -a _pkg/usr/lib/libpng12.so* $fs/usr/lib
222 # cp -a _pkg/usr/bin/libpng12* $fs/usr/bin
224 ===== jwm-2.0 - Window manager =====
226 Joe's Window Manager (http://www.joewing.net/programs/jwm/) is an ultra light and friendly window manager. This is the default SliTaz window manager. The main configuration file: /etc/jwm/system.jwnrc includes the style and config menu:
228 # cd ..
229 # wget http://www.joewing.net/programs/jwm/releases/jwm-2.0.tar.bz2
230 # tar xjf jwm-2.0.tar.bz2
231 # cd jwm-2.0
232 # ./configure --prefix=/usr --mandir=/usr/share/man \
233 --sysconfdir=/etc/jwm --disable-xinerama
234 # make
235 # strip src/jwm
236 # cp src/jwm $fs/usr/bin
237 # mkdir $fs/etc/jwm
238 # cp example.jwmrc $fs/etc/jwm/system.jwmrc
240 ==== libs ====
242 Ldd libraries that we have provided:
243 <file>
244 libX11.so.6 => /usr/lib/libX11.so.6 (0xb7e35000)
245 libpng12.so.0 => /usr/lib/libpng12.so.0 (0xb7e12000)
246 libXft.so.2 => /usr/lib/libXft.so.2 (0xb7e00000)
247 libXrender.so.1 => /usr/lib/libXrender.so.1 (0xb7df7000)
248 libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0xb7dcc000)
249 libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0xb7d5f000)
250 libz.so.1 => /usr/lib/libz.so.1 (0xb7d4a000)
251 libXpm.so.4 => /usr/lib/libXpm.so.4 (0xb7d3a000)
252 libXext.so.6 => /usr/lib/libXext.so.6 (0xb7d2c000)
253 libc.so.6 => /lib/libc.so.6 (0xb7c1c000)
254 libXau.so.6 => /usr/lib/libXau.so.6 (0xb7c19000)
255 libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb7c14000)
256 libdl.so.2 => /lib/libdl.so.2 (0xb7c0f000)
257 libm.so.6 => /lib/libm.so.6 (0xb7bea000)
258 libexpat.so.1 => /usr/lib/libexpat.so.1 (0xb7bc9000)
259 </file>
260 You can start the X server and JWM with the command below or create a script in /usr/bin/startx with the content:
261 <file>
262 Xvesa -ac -shadow -screen 1024x768x24 & exec jwm
263 </file>
264 ==== On SliTaz ====
266 SliTaz uses the ~/.Xsession file to start a graphical session. The 'startx' command checks whether the file exists or it runs 'tazx' to configure the X system. The user guide on X window is located in: /usr/share/doc/slitaz/user-guide/x-window.html or is on the website:
268 We chose to use the Tango icons theme http://tango.freedesktop.org/, that isn't compiled. We only use the minimum: images in 16 x 16 format that we put in /usr/share/icons.
270 To test JWM with a cooking ISO:
272 # Xvesa -ac -shadow -screen 800x600x24 & exec jwm
274 ===== jpeg-6b - JPEG Libraries =====
276 Libraries handling JPEG images, and some small utilities:
278 # wget http://www.ijg.org/files/jpegsrc.v6b.tar.gz
279 # tar xzf jpegsrc.v6b.tar.gz
280 # cd jpeg-6b
281 # ./configure --enable-shared --prefix=/usr \
282 --mandir=/usr/share/man
283 # make
284 # strip .libs/*
285 # cp -a .libs/*.so* $fs/usr/lib
286 # cp .libs/{cjpeg,djpeg,jpegtran} $fs/usr/bin
288 ===== tiff-3.8.2 - TIFF Libraries and Utilities =====
290 Libraries handling TIFF images and some small optional utilities:
292 # wget ftp://ftp.remotesensing.org/pub/libtiff/tiff-3.8.2.tar.gz
293 # tar xzf tiff-3.8.2.tar.gz
294 # cd tiff-3.8.2
295 # ./configure --prefix=/usr --mandir=/usr/share/man
296 # make
297 # make DESTDIR=$PWD/_pkg install
298 # strip _pkg/usr/bin/*
299 # strip _pkg/usr/lib/*.so*
300 # cp -a _pkg/usr/lib/*.so* $fs/usr/lib
302 You can install the utilities you want.
304 ===== links-2.1pre29 - Graphical and text mode web browser ====
306 Links ([[http://links.twibright.com/|links.twibright.com]]) is a web browser offering graphical and text modes. It is translated into multiple languages, including French:
308 # cd ..
309 # wget http://links.twibright.com/download/links-2.1pre28.tar.gz
310 # tar xzf links-2.1pre28.tar.gz
311 # cd links-2.1pre28
312 # ./configure --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man \
313 --without-directfb --without-ssl --enable-graphics --enable-javascript
314 # make
315 # make DESTDIR=$PWD/_pkg install
316 # strip -v _pkg/usr/bin/*
317 # cp -v _pkg/usr/bin/* $fs/usr/bin
319 ==== libs ====
320 <file>
321 libtiff.so.3 => /usr/lib/libtiff.so.3
322 libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0xb7ede000)
323 libpng12.so.0 => /usr/lib/libpng12.so.0 (0xb7eba000)
324 libz.so.1 => /usr/lib/libz.so.1 (0xb7ea7000)
325 libX11.so.6 => /usr/lib/libX11.so.6 (0xb7dbb000)
326 libdl.so.2 => /lib/tls/libdl.so.2 (0xb7db7000)
327 libpcre.so.0 => /usr/lib/libpcre.so.0 (0xb7d96000)
328 libm.so.6 => /lib/tls/libm.so.6 (0xb7d70000)
329 libc.so.6 => /lib/tls/libc.so.6 (0xb7c3e000)
330 libXau.so.6 => /usr/lib/libXau.so.6 (0xb7c3b000)
331 libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb7c36000)
332 /lib/ld-linux.so.2 (0xb7f5d000)
333 </file>
334 ===== Generate the initramfs and an ISO image =====
336 To create a new ISO image, you can use 'mktaziso' in [[http://doc.slitaz.org/en:cookbook:slitaztools|SliTaz tools]] . Or you can create a new initramfs image, copy it to /boot in the root of the cdrom (rootcd) and finally generate an ISO image with genisoimage:
338 # cd $fs
339 # find . -print | cpio -o -H newc | gzip -9 > ../rootfs.gz
340 # cd ..
341 # cp rootfs.gz rootcd/boot
342 # genisoimage -R -o slitaz-cooking.iso -b boot/isolinux/isolinux.bin \
343 -c boot/isolinux/boot.cat -no-emul-boot -boot-load-size 4 \
344 -V "SliTaz" -boot-info-table rootcd
346 ==== Following chapter ====
348 The next chapter [[gtk-libs|GTK+ libs]] describes the installation of GTK libraries.