Thursday, 12 August 2010

LAP - X - Part 4, Libraries and Dependencies

LAP - X - Part 4, Libraries and Dependencies
The next themed package is Libraries, which contains, surprisingly, libraries which support functions of the xserver. Part of these handle font displays, and we need to install some font packages first. Bizarrely it also claims to need a separate text editor, for what purpose I know not. It also needs a couple of packages which relate to clients accessing the display. Technically the first of these [libXau] is not a dependency of Libraries, but BLFS recommends installing it at this stage.
cd /sources/xorg

The first package is the last I referred to. It is LibXau, and it contains an authentication protocol. The X system has clients and servers, and the servers need to authenticate the clients. None of this is of any interest if you are using one machine like we will be, but it would be of use in a large networked environment. I think we can risk these commands without a script as they are as basic as it gets:

tar -jxvf libXau-1.0.5.tar.bz2
cd libXau-1.0.5
./configure $XORG_CONFIG
make $CORES_TO_USE
make check
1 test passed.
make install
cd ..
rm -rvf libXau-1.0.5

The next package is libXdmcp. This is a library which implements the [X] [D]isplay [M]anager [C]ontrol [P]rotocol. What the Xdmcp actually is, is less clear. BLFS does say that it is useful in letting clients interact with the Display Manager, and that sounds useful. Again, I think we can manage this one without a script.

tar -jxvf libXdmcp-1.0.3.tar.bz2
cd libXdmcp-1.0.3
./configure $XORG_CONFIG
make $CORES_TO_USE
make install
cd ..
rm -rvf libXdmcp-1.0.3

Next up is a small basic text editor, which for some reason the library package depends upon. Let's just get it installed. This is a tiny bit more complicated, so I am going to put it in a script:

sudo cat > inst_ed.sh << "ARSE" 
cd /sources/xorg
tar -xvzf ed-1.4.tar.gz
cd ed-1.4
./configure --prefix=/usr --bindir=/bin
make $CORES_TO_USE
make check
echo cd /sources/xorg/ed-1.4
echo make install
echo cd ..
echo rm -rvf ed-1.4
echo "Next: ~/inst_freetype.sh"
ARSE
chmod +x ./inst_ed.sh
sudo mv ./inst_ed.sh /media/lfs/root
The test out put should be:
tests completed successfully.
Then you need to run the commands which follow the [echo] command. The point of the [echo] is that the test should run, and then print out the last four, simple, commands for you to just type in. Next is Freetype2, which is for rendering TrueType fonts. This is not strictly a dependency of the Library package, but it is of fontconfig, which IS a dependency of Library. Oh, and this involves the madness that is sed, so of course it is going in a script.
sudo cat > inst_freetype.sh << "ARSE" 
cd /sources/xorg
tar -jxvf freetype-2.3.12.tar.bz2
cd freetype-2.3.12
tar -xvf ../freetype-doc-2.3.12.tar.bz2 --strip-components=2 -C docs
#
#That command unpacks some additional documentation which I downloaded.  The [strip-components] option removes the leading [2] characters of the uncompressed filenames.  The other option [C]hanges to the docs directory before unpacking.
#
sed -i -r -e 's:.*(#.*BYTE.*) .*:\1:' -e 's:.*(#.*SUBPIX.*) .*:\1:' include/freetype/config/ftoption.h
#
#Even for [sed] that's fucking insane.  Apparently this turns on a native TrueType function and subpixel rendering for clearer text on LCD displays.  These have patent issues (I think Microsoft have a patent for their ClearType software, which presumably does the same stuff).
#
./configure --prefix=/usr
make $CORES_TO_USE
make install
install -v -m755 -d /usr/share/doc/freetype-2.3.12
cp -v -R docs/*     /usr/share/doc/freetype-2.3.12
cd ..
rm -rvf freetype-2.3.12
echo "Next: ~/inst_expat.sh"
ARSE
chmod +x ./inst_freetype.sh
sudo mv ./inst_freetype.sh /media/lfs/root
Fontconfig also needs software to handle XML. I am going to use expat. It is fairly straightforwards, but does have tricky to type in documentation install commands, so let's just script it.
sudo cat > inst_expat.sh << "ARSE" 
cd /sources/xorg
tar -xzvf expat-2.0.1.tar.gz
cd expat-2.0.1
./configure --prefix=/usr
make $CORES_TO_USE
make install
install -v -m755 -d /usr/share/doc/expat-2.0.1
install -v -m644 doc/*.{html,png,css} /usr/share/doc/expat-2.0.1
cd ..
rm -rvf expat-2.0.1
echo "Next: ~/inst_fontconfig.sh"
ARSE
chmod +x ./inst_expat.sh
sudo mv ./inst_expat.sh /media/lfs/root
Last before the Library install itself is Fontconfig. Clue is in the name really. The configure options are quite lengthy so we'd best script them up.
sudo cat > inst_fontconfig.sh << "ARSE" 
cd /sources/xorg
tar -xzvf fontconfig-2.8.0.tar.gz
cd fontconfig-2.8.0
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-docs --without-add-fonts --with-docdir=/usr/share/doc/fontconfig-2.8.0
make $CORES_TO_USE
make check
echo I got:
echo ============= 
echo 1 test passed 
echo ============= 
echo cd /sources/xorg/fontconfig-2.8.0
echo make install
echo cd ..
echo rm -rvf fontconfig-2.8.0
echo "Next: ~/inst_3_libraries.sh"
ARSE
chmod +x ./inst_fontconfig.sh
sudo mv ./inst_fontconfig.sh /media/lfs/root
The test output should be:
============= 
1 test passed 
============= 
Then just follow the reminders to finish. Finally we come to the libraries themselves. This is one of the bigger packages that form part of the Xorg installation.
sudo cat > inst_3_libraries.sh << "ARSE" 
cd /sources/xorg/lib
for package in $(grep -v '^#' ../lib-7.5-2.wget)
do
packagedir=${package%.tar.bz2}
tar -xvf $package
cd $packagedir
case "$packagedir" in
libX11-1.3.2 )
CONFIGPARAMS="--without-xcb"
esac
./configure $XORG_CONFIG $CONFIGPARAMS
make $CORES_TO_USE
make install
unset CONFIGPARAMS
ldconfig
cd ..
rm -rvf $packagedir
done 2>&1 | tee -a ../lib-7.5-2-compile.log
echo "Next do xbitmaps manually, with the option XORG_CONFIG, and then run ~/conf_libpng.sh"
ARSE
chmod +x ./inst_3_libraries.sh
sudo mv ./inst_3_libraries.sh /media/lfs/root

OK, that is a little bit more complex than the previous multipackage builds. The difference is that one of the packages needs a specific option set - that's the CONFIGPARAMS variable. It is only set for that one package. It doesn't matter that we use $CONFIGPARAMS for each package, because at all other times it is null. That should be that for Libraries.

No comments:

Post a Comment