Several month ago I was running a Debian Lenny/Sid and used to have KDE 3.5.x running. KDE 4.0 was about to be released but it was not usable for production. So I decided to run KDE 4 following the techbase website instruction. Today I’m running KDE 4.2.4 from Sid Debian repositories. Nevertheless, KDE 4 support under Debian is still a very big mess. Many software are still not available for KDE 4 even if a stable version exists for it (e.g. Amarok or Kile). Moreover, the stability of the base desktop is awful and many bugs are Debian specific (the OpenSuse version is very stable). I don’t want to leave Debian cause my system is still quite more fast and reliable than in the past with OpenSuse.
An other point is that I need a development release (from SVN) of KDE 4 to be able to make some tests. After many discussions on KDE developers IRC channel, I was convinced that SVN version of KDE 4 (actual trunk is for future 4.4 version) is stable enough to be used for production.
Now here are my plans…
The Qt version provided by Debian (4.5.1) have dependencies with Phonon, and I need to build a SVN version of Phonon (Debian version is to old). So I need to remove all Qt dependent software, using aptitude or synaptic under a non KDE session (I use Xfce to do so). Please note that all Qt or KDE based software must be closed before uninstallation, elsewhere you may have a strange reaction of your system. When Aptitude or Synaptic show you the list of software it is about to uninstall, it’s better to note it to be able to retrieve all you need. You will have to compile and install all these software manually.
The KDE techbase website is providing very good compilation and installation instructions but it is about to install it under a special user account that I don’t want. I will have to change various things. First the best way to set environment variable for all users is to create an init script. I’ve decide to run it mainly under run-level 3 because the X server can be ran manually anyway even if we are not run-level 5. So I create the file “/etc/rc3.d/S40kde4“:
# Begin /etc/rc3.d/S40kde4
if [ ! -d /tmp/${USER}-kde4 ]; then
mkdir /tmp/${USER}-kde4
fi
export KDEDIR=/usr/
export KDEDIRS=$KDEDIR
export KDETMP=/tmp/$USER-kde4
export STRIGI_HOME=${KDEDIR}
export QT_PLUGINS_DIR=$KDEDIR/lib/kde4/plugins:$QTDIR/lib${QT_PLUGINS_DIR+:}$QT_PLUGINS_DIR
export PATH="${PATH}:${KDEDIR}/bin"
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}${PKG_CONFIG_PATH+:}${KDEDIR}/lib/pkgconfig"
# End /etc/rc3.d/S40kde4
You can change the base path if you want, but the one I use is respecting Debian guidelines. Note that KDEHOME variable is defined by Debian in an other script so it is not safe to redefine it. When the file is saved (you must be root), you have to make it executable and it’s also more safe to copy the file to be executed to some other possible run-level. This is done by executing the following commands as root:
chmod -v +x /etc/rc3.d/S40kde4
cp -v /etc/rc3.d/S40kde4 /etc/rc2.d/
cp -v /etc/rc3.d/S40kde4 /etc/rc4.d/
cp -v /etc/rc3.d/S40kde4 /etc/rc5.d/
It is not necessary to copy in directories for run-level 0, 1 or 6 (respectively halt, single user and reboot). Then you need to update your general profile and user session, if you don’t want to reboot:
/etc/rc3.d/S40kde4
source /etc/profile
Before processing any of the next steps, you have to install all the build dependencies by following the steps provided here.
If you have any error message at this point, you should check your configuration and the previous steps. Once this is done, you are ready to compile, but to make it more easy it is better to create an automated compilation script. I made this one, called “kdemake.sh“:
# Begin /usr/bin/kdemake.sh
if test -n "$1"; then
# Source folder is defined via command line argument
srcFolder="$1"
else
# srcFolder is the current dir
srcFolder=`pwd`
# default build directory is a build subdir inside the source folder
# -DCMAKE_INSTALL_PREFIX is forcing install prefix to the above definition
# -DKDE4_BUILD_TESTS=TRUE is optional and build test suite
# -DCMAKE_BUILD_TYPE=debugfull is optional and build full debugging information
cmake ${srcFolder} ${srcFolder}/build/ -DCMAKE_INSTALL_PREFIX=$KDEDIR -DKDE4_BUILD_TESTS=TRUE -DCMAKE_BUILD_TYPE=debugfull
cd ${srcFolder}/build/
# nice make -j3 is forcing make to use two processor (for dual core) replace with -j2 if you have mono-processor system
nice make -j3 && sudo make install
# note that sudo will ask you root password to install
# End /usr/bin/kdemake.sh
Make the script executable with:
chmod -v +x /usr/bin/kdemake.sh
If you run this (very simple) script, it is supposed that all the build directories have been created as child of the source directory… So, here is an example for compiling kdelibs package :
svn checkout svn://anonsvn.kde.org/home/kde/trunk/KDE/kdelibs
cd kdelibs
mkdir build
kdemake.sh
This has to be done for first compilation then you only need to update and compile what is needed (this is why cmake is so fun), by doing this:
cd /kdelibs
svn up
kdemake.sh
If, like me, you prefer do this manually, just forget it. However a good idea is to create a variable containing systematic cmake parameters (this way you can pass some other parameters as you wish). For me, I call it “CM“. The other very useful thing is to create an alias for make, called fmake for “fast make”, allowing it to use the two processor of your dual core if you have one (the problem is that fmake will not accept parameters make used to accept because of nice):
export CM=-DCMAKE_INSTALL_PREFIX=$KDEDIR -DKDE4_BUILD_TESTS=TRUE -DCMAKE_BUILD_TYPE=debugfull
alias fmake=nice make -j3
You can add those lines to the init script above, that way it will always be available. Then you can do the same stuff as above, this way:
svn checkout svn://anonsvn.kde.org/home/kde/trunk/KDE/kdelibs
cd kdelibs
mkdir ../build
cd ../build
cmake ../kdelibs $CM
fmake
make install
The minimum KDE system is kdesupport, kdelibs, kdepimlibs and kdebase. You must compile it in that order due to dependencies. To install the full KDE suite you have to compile kdeadmin, kdeaccessibility, kdeartwork, kdebindings, kdeedu, kdegames, kdegraphics, kdemultimedia, kdenetwork, kdepim, kdeplasma-addons, kdesdk, kdetoys, kdeutils, kdevelop, kdevplatform and kdewebdev. You can compile some of these or everything in no particular order. The only exception is kdevplatform needed by kdevelop and kdewebdev that must be compiled first. After that, you can explore the websvn of KDE to find more software that you may be interested in. Check the playground and the extragear directories, koffice directory for the KDE Office Suite and l10n-kde4 for localization in your language.
When everything will be built for me, part two will be there as report of the experience (along with yours as comment).
That’s all folks… for the moment!
Français