Friday, 13 August 2010

LAP - X - Part 5, Applications

The next job is to install the Applications files. This contains a number of very useful programs that are actually used quite a lot – for instance 'startx' to actually begin Xorg. We may want OpenGL support, so we have to install MesaLib which brings several dependencies. We also need some graphical packages.

So lets get going with the dependencies, starting with xbitmaps. I think this is just some graphics files which X is going to use.
tar -xjvf xbitmaps-1.1.0.tar.bz2
cd xbitmaps-1.1.0
./configure $XORG_CONFIG
make install
cd ..
rm -rvf xbitmaps-1.1.0

Not scripting that easy install. Next is libpng, which adds support for image files in the PNG format.

sudo cat > conf_libpng.sh << "ARSE" 
cd /sources/xorg
tar -xjvf libpng-1.2.42.tar.bz2
cd libpng-1.2.42
patch -Np1 -i ../libpng-1.2.42-apng-1.patch
./configure --prefix=/usr
make $CORES_TO_USE
make check
echo check for
echo ============= 
echo 1 test passed 
echo ============= 
echo "Now run ~/inst_libpng.sh"
ARSE
chmod +x ./conf_libpng.sh
sudo mv ./conf_libpng.sh /media/lfs/root

I am also going to script the installation phase because the documentation commands are detailed.

sudo cat > inst_libpng.sh << "ARSE" 
cd /sources/xorg/libpng-1.2.42
make install
install -v -m755 -d /usr/share/doc/libpng-1.2.42
install -v -m644    README libpng-1.2.42.txt /usr/share/doc/libpng-1.2.42
cd ..
rm -rvf libpng-1.2.42
echo "Now install libpthread-stubs with --prefix=/usr and then libdrm with  --prefix=XORG_PREFIX, before running  ~/inst_mesa.sh"
ARSE
chmod +x ./inst_libpng.sh
sudo mv ./inst_libpng.sh /media/lfs/root

Next up we have one of those chains, libpthread-stubs supports libdrm which supports MesaLib. What this actually does is a fucking mystery. There is something called pthread, apparently, and this is a stub of it. I think this is connected with some possible functions that libc does not provide. Too simple to script.

tar -jxvf libpthread-stubs-0.1.tar.bz2
cd libpthread-stubs-0.1
./configure --prefix=/usr
make $CORES_TO_USE
make install
cd ..
rm -rvf libpthread-stubs-0.1

Then we have libdrm, which happily is nothing to do with digital restrictions management bollocks. This is actually to allow Xorg to use the Direct Rendering Modules compiled into the Kernel. This, I think, means that we get faster hardware supported video. Again, too simple to script.

tar -jxvf libdrm-2.4.14.tar.bz2
cd libdrm-2.4.14
./configure --prefix=$XORG_PREFIX
make $CORES_TO_USE
make install
cd ..
rm -rvf libdrm-2.4.14

Now we have done the 2D acceleration we also may need 3D acceleration. This is provided by MesaLib. This involves [sed] so scripts-ahoy.

sudo cat > inst_mesa.sh << "ARSE" 
cd /sources/xorg
tar -xjvf MesaLib-7.6.tar.bz2
tar -xjvf MesaDemos-7.6.tar.bz2
#We are installing the Demos which are useful to check everything is working.
cd Mesa-7.6
sed 's@FLAGS=\"-g@FLAGS=\"@' -i configure
#This stops it building the debugging symbols.
./configure $XORG_CONFIG
make $CORES_TO_USE
make -C progs/xdemos glxinfo glxgears
make install
install -v -m755 progs/xdemos/glx{info,gears} ${XORG_PREFIX}/bin
cd ..
rm -rvf Mesa-7.6
echo "Next: ~/inst_4_apps.sh"
ARSE
chmod +x ./inst_mesa.sh
sudo mv ./inst_mesa.sh /media/lfs/root

And finally, we come to the applications themselves.

sudo cat > inst_4_apps.sh << "ARSE" 
cd /sources/xorg/app
for package in $(grep -v '^#' ../app-7.5-2.wget)
do
packagedir=${package%.tar.bz2}
tar -xvf $package
cd $packagedir
./configure $XORG_CONFIG
make $CORES_TO_USE
make install
cd ..
rm -rvf $packagedir
done 2>&1 | tee -a ../app-7.5-2-compile.log
echo "Next:  xcursor-themes with XORG_CONFIG, and then ~/inst_5_font.sh"
ARSE
chmod +x ./inst_4_apps.sh
sudo mv ./inst_4_apps.sh /media/lfs/root

No comments:

Post a Comment