Compiling KDE from CVS sources

Here follows now a list and description of the steps necessary to get KDE compiled. Of course you can read all this stuff in several files on developer.kde.org but still there are some things you might spend some time looking for (and some typical error messages which aren't always easy to understand).

I've written this for a typical SuSE installation (in my case SuSE 9.0) so in other distributions you might need to take additional steps.

Content in brief:


 

Preparing yourself

At first create yourself a new user (e.g. 'kdevel'). Then create the directories

/usr/local/qt
/usr/local/kde
as user root and make the user 'kdevel' the owner of these directories. You can do this using the SuSE tools, but I'll give the command lines anyway. Login as root:
useradd -m kdevel
passwd kdevel
enter a new password for user 'kdevel'
mkdir /usr/local/qt
mkdir /usr/local/kde
chown kdevel /usr/local/qt /usr/local/kde

Now login as 'kdevel' and create yourself the directory /usr/local/kde/src, if this doesn't work you made a mistake :-)


 

The QT Library

Getting the QT source

At first you need to download the sources for QT. You can find them on Trolltech's Website: http://www.trolltech.com/download/qt/x11.html

Download the current release, unpack the files to /usr/local/qt (as user 'kdevel' !).

Preparing for compilation

Now edit the file ~/.bashrc (in your homedirectory) and add the following lines:

QTDIR=/usr/local/qt
KDEDIR=/usr/local/kde
PATH=$QTDIR/bin:$KDEDIR/bin:$PATH
MANPATH=$QTDIR/doc/man:$MANPATH
LD_LIBRARY_PATH=$QTDIR/lib:$KDEDIR/lib:$LD_LIBRARY_PATH
CVSROOT=:pserver:anonymous@kdecvs.student.utwente.nl:/home/kdecvs/kde

export QTDIR KDEDIR PATH MANPATH LD_LIBRARY_PATH CVSROOT

Open a new console and test the settings by typing

cd $QTDIR
ls
You should now see the QT source directory. You can now read the README file and the INSTALL file, but remember that QT alone is compiled differently then QT for KDE.

Compiling

You need to run configure first, use the following arguments (type all in one line, omitting the '\'):

./configure -system-zlib -qt-gif -system-libpng \
-system-libjpeg -plugin-imgfmt-mng -thread -no-stl \
-no-xinerama -no-g++-exceptions

Configure should run through and afterwards 'make' starts the compilation (takes some minutes). Afterwards QT is compiled and installed already, so don't type 'make install'.


 

The KDE packages

Retrieving the CVS snapshots

Take a look at the list of anonymous CVS servers in http://developer.kde.org/source/anoncvs.html and change the CVSROOT variable in the ./bashrc if desired (remember to exit and re-open the console afterwards).

Now you need to create the file .cvsrc in your home directory, with the following content:

cvs -z4 -q
diff -u3 -p
update -dP
checkout -P

Now change to /usr/local/kde/src and type

cvs login
You will be asked for a password, just hit enter. If an error message appears, use
touch ~/.cvspass
and type 'cvs login' again.

Once you have logged in you can checkout the modules. Start with

cvs co arts kdelibs

I will give a list of other usefull modules later.

Compiling ARTS and kdelibs

Change into the directory /usr/local/kde/src/arts and type

make -f Makefile.cvs
./configure

It is very likely that you get these two error messages:

  1. pkg-config missing --- you need to install the pkg-config package (get the rpm from the SuSE FTP server)
  2. GLib-2.0 missing --- you need to install the glib2-devel package

During configuration check whether the KDE install directory is correctly printed as /usr/local/kde. Once configure is finished type

make
make install

Now change to /usr/local/kde/src/kdelibs and type again

make -f Makefile.cvs
./configure
make
make install

This time you might get the following errors during configuration:

  1. Openssl missing --- install the openssl-devel package
  2. Cups missing --- install the cups-devel package

Now kdelibs should compile without problems.

If you are going to program in KDE later, you might want to create the KDe libs API documentation:

make apidoc
make install

in the kdelibs source directory.

Compiling kdebase

First get the cvs module 'kdebase' (again, simply type 'cvs co kdebase' in the directory /usr/local/kde/src). During configuration you will most likely get the following two warnings:

  1. libsmbclient missing
  2. OSF/Motif or lesstif missing --- install all openmotif packages

Installation of the samba client requires the following steps:
- enter the directory /usr/local/kde/src and type:

cvs -d :pserver:cvs@pserver.samba.org:/cvsroot login
(press enter when asked for password)
cvs -z5 -d :pserver:cvs@pserver.samba.org:/cvsroot \
  co -r SAMBA_3_0 samba/source
cd /usr/local/kde/src/samba/source
sh autogen.sh
./configure
make
make install installclientlib  (as root user)

This will install the samba library into /usr/local/samba.

Now when you run configure again, you need to specify the samba include and lib directory. You must use the following parameters:

./configure --with-extra-includes=/usr/local/samba/include \
  --with-extra-libs=/usr/local/samba/lib

Now 'configure' won't complain anylonger and kdebase can be compiled using the usual make and make install commands.

Compiling kdevelop

Get the package 'kdevelop'. You might need to install the graphviz package from http://www.graphviz.org/ prior to compilation. Then just run the usual lines and KDevelop should be at your command.

Other useful packages

Get the modules 'kdeartwork', 'kdeutils' and 'kdesupport' and compile and install them. Feel free to install as many other packages you want (and need). Given the directions above you should now be able to find missing packages in a similar way yourself.


 

Final setup of your new KDE

There are several ways to change your configuration in a normal SuSE setup, to start your new kde system. I'll describe my favourite one, you can figure out the others yourself :-)

Edit the ~./bashrc file in your home directory again and enter the lines

WINDOWMANAGER=/usr/local/kde/bin/startkde
export WINDOWMANAGER

Just logout now and login as kdevel. If you are not running X per default (default runlevel = 5) you just start up kde as usual typing startx.

Your newly built KDE will (hopefully) start up now.


back to home