Tuesday, 17 August 2010

LAP - X - Part 7, Xserver

OK, we are now heading to install the actual Xserver. There are a number of dependencies that we want to install first. The first one here is a Perl Module. We installed Perl way back when in the main build, and this is an add on that handles XML files. Yes, we did just install expat which was also supposed to do this. No I do not know why we now have two programs doing the same thing. I am going to script this because the perl module has its own way of building.

sudo cat > inst_xml.sh << "ARSE"
cd /sources/xorg 
tar -xzvf XML-Parser-2.36.tar.gz
cd XML-Parser-2.36
perl Makefile.PL
make $CORES_TO_USE
make install
cd ..
rm -rvf XML-Parser-2.36
echo "Next: ~/conf_intl.sh"
ARSE
chmod +x ./inst_xml.sh
sudo mv ./inst_xml.sh /media/lfs/root

Now we can install Intltool, which is another one of these universal translator gizmos – I think it speaks to gettext. We are going to do two scripts here, because we need to pause to confirm the output of the check half way through.

sudo cat > conf_intl.sh << "ARSE"
cd /sources/xorg
tar -xjvf intltool-0.40.6.tar.bz2
cd intltool-0.40.6
./configure --prefix=/usr
make $CORES_TO_USE
make check
echo Look for:
echo ================== 
echo All 1 tests passed 
echo ==================
echo "Now run ~/inst_intl.sh"
ARSE
chmod +x ./conf_intl.sh
sudo mv ./conf_intl.sh /media/lfs/root

The make check output for me was:

================== 
All 1 tests passed 
==================

Which is very promising. And now the second part of the installation of the package. I am putting this in a script because of the documentation install again.

sudo cat > inst_intl.sh << "ARSE"
cd /sources/xorg/intltool-0.40.6
make install
install -v -m644 -D doc/I18N-HOWTO /usr/share/doc/intltool-0.40.6/I18N-HOWTO
cd ..
rm -rvf intltool-0.40.6
echo "Next: ~/inst_xkb.sh"
ARSE
chmod +x ./inst_intl.sh
sudo mv ./inst_intl.sh /media/lfs/root

Now we have installed that tool, we can install the xkeyboard-config package. Go on, guess what this does – just have a guess... We have been building up to this – the last two packages were just to allow this one to be installed. This one is the actual dependency of Xserver. I actually screwed this up when I first ran the script because I have put in the uncompress commands as [xzvf] instead of [xjvf]. It couldn't uncompress the package and then moaned as it tried to execute the other commands. Not harm was done. I realised the mistake, and just used 'nano' to edit the script.

sudo cat > inst_xkb.sh << "ARSE" 
cd /sources/xorg
tar -xjvf xkeyboard-config-1.7.tar.bz2
cd xkeyboard-config-1.7
./configure $XORG_CONFIG --with-xkb-rules-symlink=xorg
#
#[with-xkb-rules-symlink] makes a link between the name of the rules the package installs (base) and the name that Xorg expects it to install [xorg].  Just a small compatibility issue.  I have no fucking clue why this package WHICH IS A LIBRARY FOR XORG is not automatically configured for Xorg in the first place.
#
make $CORES_TO_USE
make install
install -dv -m755 $XORG_PREFIX/share/doc/xkeyboard-config-1.7
install -v -m644 docs/{README,HOWTO}* $XORG_PREFIX/share/doc/xkeyboard-config-1.7
cd ..
rm -rvf xkeyboard-config-1.7
echo "Next: luit with XORG_CONFIG, pixman with --prefix=/usr, and ~/inst_server.sh"
ARSE
chmod +x ./inst_xkb.sh
sudo mv ./inst_xkb.sh /media/lfs/root

Now for another Xserver dependency. This is Luit, which allows us to display UTF-8 characters in text windows. Now sure what that means. I suspect is has something to so with fully supporting normal console outputs when the console is running in a window. So, basically, anything should look the same at the console whether in a text only mode, or running in a window under X. No need to script this, it is straightforwards.

tar -xjvf luit-1.0.4.tar.bz2
cd luit-1.0.4
./configure $XORG_CONFIG
make $CORES_TO_USE
make install
cd ..
rm -rvf luit-1.0.4

The next package is the final dependency we need for the Xserver. It handles real low level [pix]el [man]ipulation matters. The installation is also straighforwards.

tar -xzvf pixman-0.15.20.tar.gz
cd pixman-0.15.20
./configure --prefix=/usr
make $CORES_TO_USE
make install
cd ..
rm -rvf pixman-0.15.20

Finally we come to the Xserver itself. If you are reading along in the BLFS book you will see that I appear to have missed a dependency – Openssl. Well, that was installed to support the Lynx browser we installed to view the documentation, so we do not have to worry about it now. The configure command is complex here, so best to wrap all this up in a script.

sudo cat > inst_server.sh << "ARSE"
cd /sources/xorg
tar -xjvf xorg-server-1.7.1.tar.bz2
cd xorg-server-1.7.1
./configure $XORG_CONFIG --with-module-dir=$XORG_PREFIX/lib/X11/modules --with-xkb-output=/var/lib/xkb --enable-install-setuid --disable-config-hal --disable-config-dbus
#
#OK, lets try to work through this.  [with-module-dir] sets a path for installation of X modules.  I think the [with-xkb-output] just tells it where it will find stuff the [xkeyboard-config] package spits out, but I am not entirely clear and BLFS is silent on the issue.  [enable-install-setuid] makes sure that the program files end up as executable by root only.  Shouldn't be an issue because I am still running as root just now.  I am also disabling [hal] and [dbus] which are hardware management tools that are using by desktop environments like Gnome and KDE.  However, all X is going to do for us is display the Amiga Emulator, so I should not need them.  I may live to regret this.
#
make $CORES_TO_USE
make install
cd ..
rm -rvf xorg-server-1.7.1
echo "Next ~/inst_xterm.sh"
ARSE
chmod +x ./inst_server.sh
sudo mv ./inst_server.sh /media/lfs/root

I am also going to install one last application at this stage. This is xterm, which on completely simplistic level is BASH for X.

sudo cat > inst_xterm.sh << "ARSE"
cd /sources/xorg
tar -xzvf xterm-253.tgz
cd xterm-253
sed -i '/v0/,+1s/new:/new:kb=^?:/' termcap
echo -e '\tkbs=\\177,' >>terminfo
#
#Oh bloody hell would you look at that.  Those both make the backspace key actually work in xterm. Why it wouldn't in the first place is another delightful little mystery.
#
TERMINFO=/usr/lib/terminfo ./configure $XORG_CONFIG --enable-luit --enable-wide-chars --with-app-defaults=$XORG_PREFIX/share/X11/app-defaults
#
#We have to define TERMINFO just incase we din't install to /usr, which we did.  The enables tell it  we have luit, and fat letters.  The [app-defaults] is fairly self explanatory - we just tell it where to find default settings - which we will create in a minute.
#
make $CORES_TO_USE
make install
make install-ti
cat >> $XORG_PREFIX/share/X11/app-defaults/XTerm << "EOF"
*VT100*locale: true
*VT100*faceName: Monospace
*VT100*faceSize: 10
*backarrowKeyIsErase: true
*ptyInitialErase: true
EOF
cd ..
rm -rvf xterm-253
echo "Next: ~/inst_6_driver.sh"
ARSE
chmod +x ./inst_xterm.sh
sudo mv ./inst_xterm.sh /media/lfs/root

As before, once I have made all my scripts, I booted from the Amiga Key and ran the install commands in order, using the scripts where necessary.

No comments:

Post a Comment