In this guide I’ll share my experiences and show you how to get started with KDE development. This article is based on the opensuse-wiki article on my personal solutions and on the helpful suggestions from the guys on #kde-devel channel.
If you are looking for something more official take a look to KDE TechBase.
- 1) Space required for source files, executables, etc. is ~6.5GB (yes, pretty huge because building with full debugging symbols).
- 2) Build dependencies: Here is the list for several distributions.
- 3) an svn client
- Set up the environment
Some guides are suggesting the use of different startup scripts also. However I’ve created a new user for KDE development to protect my stable KDE configurations from my mistakes:
useradd -m -G users,audio,video -s /bin/bash kde-devel
you can do it without the -G option – like I did – If you want to create a user with default groups. And finally set a password for this user:
Now you can continue your work on different ways, I did the following: my graphical session is running on tty6 and i started a new terminal session on tty1. To switch between terminal sessions use the <Ctrl>+<Alt>+<Fn>, n = 1,…,12 key combinations. This isn’t the best solution from the view of debugging because you can’t use clipboard between your terminal and graphical session and if something goes wrong and you need to copy+paste an output to the IRC channel/forums then this operation takes extra time.
So, Instead of switching to a new terminal session open your terminal emulator in your graphical session – Konsole – and log in with the kde-devel user and jump to the home directory:
Copy the scripts kde4-run-env, kde4-build-env into
kde-devel‘s home directory. and add the following line to the
Now execute the script
– actually re-logging with kde-devel have the same effect.
- Download the sources
We’ll store everything what is related to KDE sources/build in the directory
kde create a subdirectory for the
sources, and finally jump into the
Now get the directory structure of KDE svn trunk:
svn checkout -N svn://anonsvn.kde.org/home/kde/trunk
with the -N option you are getting only the root directories without its contents. This will be useful later, after every checkout take a look to the current directory structure – just to see what are you doing.
So, you’ve checked out the
trunk directory, go there
and check out the remaining directories.
svn up -N KDE
KDE is the last directory on the svn before the three module directories:
kdebase kdelibs kdepimlibs – containing: base runtime elements, Personal Information Management modules and the basic libraries. Check out the sources for every module with:
svn up kdelibs kdepimlibs kdebase.
*This may take some time depending on your network connection speed.
- Build the sources
We have all the sources just need to build them. The command
cs is provided by the script
kde4-build-env – if you’ve added the script properly to the
.profile. First we need to build the kdelibs directory. Change the source patch to kdelibs with:
and start to build kdeblis:
*This may take some time depending on several factors, like systems load, CPU speed, etc.
Repeat this for the remaining modules:
Remember, you can pause the building/compiling with <Ctrl>+<Z>:
+ Stopped cmakekde
and resume with:
- Run KDE 4
You can start from the terminal or with KDM. I started from a terminal session the KDM way is seems to be more complicated to implement.
Create a script
echo Setting up the KDE runtime environment.
echo Starting the DBus session.
eval `dbus-launch --auto-syntax`
echo Starting the X server.
X -novtswitch $DISPLAY &
echo Starting KDE 4 on tty8
and copy into
/home/kde-devel/. Log out with kde-devel in your Konsole session. Switching between terminal sessions explained under “Set up the environment”. Now switch to tty1 and login as kde-devel and run the script
if the script doesn’t switch automatically to tty8 – where your KDE is starting – then switch manually. The first start takes more time because KDE is build the configuration from scratch.
- SVN Changes
For updating the sources just do:
svn up kdelibs kdepimlibs kdebase
and repeat the steps under “Build the sources”.
It’s possbile that while trying to “svn up” your sources svn returns with an error like:
No such revision X. This happens because the synchronization between the mirrors providing the sources for the anonymous svn. Wait a few minutes and try again.
All comments and corrections are appreciated.