Categories

A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna, tincidunt vitae molestie nec, molestie at mi. Nulla nulla lorem, suscipit in posuere in, interdum non magna.

Compiling KDE Kontact from Source

My new KOrganizer showing my old appointments.

I’m running Debian Sid, because I like to have a rolling distribution with the latest and greatest software as soon as it is released. Unfortunately, the KDE packagers in Debian lack (wo)men power and still ship 4 year old KDE PIM packages. Using their experimental KDE repository does not help.

Since I have multiple annoying issues with Kontact 4.4.11 and because I need it functional for work, I decided to take a rather extreme step: Compiling it myself from the source code repositories. Turns out that it isn’t all that difficult. I documented the process below for those who want to follow my example. It enables me to stay up to date with the development whenever I want and I receive bug fixes immediately after they have been pushed without having to wait for them to be packaged for my distribution. Also, in case I want something to be fixed that still isn’t in latest master, I can just do it myself now.

In order to get started I read KDE techbase which is quite a good resource even though it could still be improved. At first I had to add the following to my ~/.gitconfig file.

[url "git://anongit.kde.org/"]
        insteadOf = kde:
[url "git@git.kde.org:"]
        pushInsteadOf = kde:

Then I could start cloning the git repositories:

$ git clone git://anongit.kde.org/akonadi
$ git clone git://anongit.kde.org/kdepim
$ git clone git://anongit.kde.org/kdepimlibs.git
$ git clone git://anongit.kde.org/nepomuk-core
$ git clone git://anongit.kde.org/nepomuk-widgets
$ git clone git://anongit.kde.org/soprano.git
$ git clone git://anongit.kde.org/strigi
$ git clone git://anongit.kde.org/kdelibs

At first I tried to just clone kdepim, but I needed the others as dependencies. The Strigi repository uses git submodules, so I had to do the following:

$ cd strigi
$ bash change_to_development_git.sh

While I was trying to make everything compile without error, I needed to install the following packages. Please note that on your system you might need additional packages like build-essentials which I already had installed. Finding out which package is missing is quite easy from the cmake output.

$ sudo apt-get install libgrantlee-dev libsasl2-dev libprison-dev libical-dev libakonadi-dev libgpgme11-dev kdelibs5-dev libqtwebkit-dev libqt4-opengl-dev libiodbc2-dev libraptor2-dev librasqal3-dev librdf0-dev libbz2-dev libdbus-1-dev libfam-dev libclucene-dev libclucene-core1 libboost-all-dev libqjson-dev

The techbase told me to have some environment variables set, so I added this to my ~/.bashrc file.

# KDE
export KDEDIR="/usr"
export KDEDIRS="$KDEDIR:/opt/kde"
export XDG_DATA_DIRS="$XDG_DATA_DIRS:/opt/kde/share:/usr/share"

Then I sourced the file, to have the changes right away.

$ source ~/.bashrc

Of course I created /opt/kde and gave my user the necessary rights to write into this directory. Then for each repository I cloned before, I changed into the directory of the repository and executed the following commands.

$ mkdir build
$ cd build
$ cmake .. -DCMAKE_INSTALL_PREFIX=/opt/kde -DPOLICY_FILES_INSTALL_DIR=/opt/kde/share -DXDG_MIME_INSTALL_DIR=/opt/kde/share
$ make -j 3
$ make install

In rare cases I got an error which I fixed by either installing a missing package or by editing some file. For example, in strigi/strigidaemon/bin/daemon/eventlistener/eventlistenerqueue.cpp I had to add #include <unistd.h> in the beginning for it to build.

Once everything was build and installed, I removed my KDE PIM applications from Debian to be sure there are no conflicts. I couldn’t remove akonadi or some libraries because of dependencies.

$ sudo apt-get remove kontact kmail korganizer kaddressbook akregator

In the #kontact IRC channel I was told to execute the following command which allowed me to have access to the settings in the newly build applications.

$ kbuildsycoca4 --noincremental

The development version of KMail

After this is done, I would suggest a restart to be sure that no old libraries are loaded or old Akonadi is running.

Then you can start your new KDE PIM applications and enjoy them. I’m really impressed by the progress done over the last few years and especially enjoy IMAP idle for Inbox folders and the ability to run all PIM applications independent from each other. Kontact really is a professional full-fledged groupware client.

Have fun with your brand new PIM applications and consider contributing if you find the time!

Update: I added some information here and there and resolved some problems in the instructions. And here is the script that I currently use to upgrade my KDE PIM installation form source:

#!/bin/bash

DIR=`pwd`
PROGS=( kdelibs soprano strigi nepomuk-core nepomuk-widgets libkolab libkolabxml kde-runtime akonadi kdepimlibs kdepim-runtime kdepim )

for D in "${PROGS[@]}"
do
        beep -f 200 -l 100
        echo
        echo "Compiling $D"
        echo
        sleep 5

        cd $DIR/$D
        git pull --rebase
        cd $DIR/$D/build
        cmake .. -DCMAKE_INSTALL_PREFIX=/opt/kde -DPOLICY_FILES_INSTALL_DIR=/opt/kde/share -DXDG_MIME_INSTALL_DIR=/opt/kde/share || break
        make -j3 install || break
done

beep -f 300.7 -r 3 -d 100 -l 400