Mario Fux

About Fellow No 1's life

KDE work day 9: Howto set up a KDE development environment (by Joel Bodenmann)

As I wrote yesterday today I’d like to share my blog with Joel and post his short article about how to setup a KDE development environment. This is partly based on several techbase pages but as KDE is currently in the process of migrating its version control infrastructure from Subversion to Git there are some new commands and URLs. Next week I’d like to write about my university projects and thus about more Sonnet and linguistics stuff.

But here goes Joel:

A few days ago, Mario and me set up our own KDE-Development-Environment. This guide shows, how you can setup your own KDE-Development-Enviroment, using the new git repositories.

Mario used the following commands under Debian, I used them under Kubuntu 10.10.

Step 1 – create user:

First of all, we need to setup a new development user called kde-devel. We do that, because this is easier with an extra user, and with this way, we can’t destroy our existing user.

  • $ sudo useradd -m kde-devel -s /bin/bash
  • $ sudo passwd kde-devel

Once we created the kde-devel user, we have to add the user in the sudoers file.

  • $ sudo visudo

Under the “User privilege specification” comment, we add the kde-devel user under the root entry:

# User privilege specification

root ALL=(ALL) ALL

kde-devel ALL=(ALL) ALL

This gives the kde-devel user all root privileges.

Now we have to copy the .bashrc from our existing user to the kde-devel user:

  • $ sudo cp ~/.bashrc /home/kde-devel/

We have to enhance the .bashrc from the kde-devel user with the bashrc from this link: http://techbase.kde.org/Getting_Started/Increased_Productivity_in_KDE4_with_Scripts/.bashrc

  • $ sudo kate /home/kde-devel/.bashrc // please choose your favorite editor (e.g. gedit, vi, nano…)

Step 2 – login:

We created a user and gave him root privileges. Now we can try to login with the kde-devel user to our local machine.

There are two different ways to do this. The first variante didn’t work for me.

  • $ su – kde-devel // didn’t work for me
  • $ ssh -X kde-devel@localhost // worked for me

Step 3 – Install packages:

When you are logged in successfully with the kde-devel user, we need to install a few developer packages. Visit the following page and install the packages under KDE 4.x and KDE 4.6 with aptitude or apt-get [or the package management tool on your system]:

http://techbase.kde.org/Getting_Started/Build/KDE4 [Paragraph “Required packages from your distribution”]

I just linked this page, because the packages in the wiki may change.

Step 4 – Clone and build repositories

When you installed the packages, we can install qt-kde, soprano and kdelibs. For that, we clone the packages via git and compile them. This part may take some time. I did this on an i5 with 4GB of RAM and this step tooked me over one hour.

Install qt-kde:

  • $ cs // change to the src directory
  • $ git clone git://anongit.kde.org/qt-kde
  • $ cd qt-kde
  • $ ./configure – -prefix=$HOME/qt-copy // (remove the space between the two dashes
  • $ sudo make -j 2; if [ “$QTDIR” = “`pwd`” ]; then find . -name ‘*.o’ -delete; else make install; fi; // this takes a little while

Install soprano:

  • $ cs // change to the src directory
  • $ git clone git://anongit.kde.org/soprano
  • $ cd soprano
  • $ cmakekde

[You’ll probably need further software from the kdesupport module like Phonon, Strigi, etc.]

Install kdelibs:

  • $ cs
  • $ git clone git://anongit.kde.org/kdelibs
  • $ cd kdelibs
  • $ cmakekde

Install kde-baseapps:

  • $ cs // change to the src directory
  • $ git clone git://anongit.kde.org/kde-baseapps
  • $ cd kde-baseapps
  • $ cmakekde

Install kde-workspace:

  • $ cs // change to the src directory
  • $ git clone git://anongit.kde.org/kde-workspace
  • $ cd kde-workspace
  • $ cmakekde

Install kdelibs-runtime:

  • $ cs // change to the src directory
  • $ git clone git://anongit.kde.org/kde-runtime
  • $ cd kde-runtime
  • $ cmakekde

[If you need Kate or Konsole, these are now in separate repositories.]

Step 5 – Enjoy:

Now your done. You setted up your basic development environment. Now you can start cloning existing projects and hack’em.

I hope that this guide was a bit helpfull for you.

Greetings Joel Bodenmann & Mario Fux


Flattr this

Tags: ,