KDE HEAD & Ports HowTo

Running KDE HEAD and Ports versions on the same machine.

For most KDE development tasks, you need to be running a recent CVS version of KDE (usually called 'HEAD'). This has the advantage that you are working with the latest features and updates, but the disadvantage that HEAD is not guaranteed to always work, so you could end up without a KDE version at all. Therefore, it's a good idea to have a version of KDE from the Ports tree installed somewhere to fall back on. If possible, the easiest thing to do is to run the HEAD and Ports versions on different machines, so they're kept completely separate. However, if you only have one machine available, you may have to run both on the same box. This requires a few tweaks to make everything work. Here's how I did it:

This document assumes that you are familiar with compiling KDE. If not, you can find instructions at the KDE Developer's Corner.

Installing Ports version

Firstly, we need to put the Ports version in a non-standard directory. This is so that the configure scripts for the HEAD version don't detect libraries related to the old KDE:

  • Remove anything KDE-related with pkg_delete -r qt\*. This deletes Qt and anything that depends on it.
  • Reinstall Qt and KDE. For this you can either use the ports directly, and use the PREFIX variable to define where the KDE stuff should be installed into (e.g. make PREFIX=/usr/local/kde-ports install), or use the packages. Please note that in either case you will have to compile the ports audio/arts and x11/kdelibs3 yourself, since the packages come with the default prefix /usr/local built-in. For any other KDE modules you can then use pkg_add -p /usr/local/kde-ports <package_name>.

    Warning: As of this writing (January 3rd 2005), the pkg_add program has a bug which causes pkg_add to not install dependencies of the package you're installing into the given prefix. For instance, when running pkg_add -p /usr/local/kde-ports kdenetwork none of the packages which kdenetwork depends on (kdebase, for instance) will end up in /usr/local/kde-ports! This means that as long as this bug isn't fixed, you have to add all packages yourself, and can not rely on pkg_add for putting the dependencies in the right place automatically.

With that installed, I put the following in my .xinitrc to load the Ports version:

export KDEDIR=/usr/local/kde-ports
export LD_LIBRARY_PATH=$KDEDIR/lib:$KDEDIR/lib/kde3
export PATH=$KDEDIR/bin:$PATH
exec startkde

To get artsd to work properly, I needed to add these two lines to .mcoprc (although Andy Fawcett doesn't need this - it could be a quirk of my setup):

ExtensionPath="/usr/local/kde-ports/lib"
TraderPath="/usr/local/kde-ports/lib/mcop"

Compiling HEAD

The tidiest way to do this is to have a completely separate user just to run KDE HEAD. This way, the configuration files for HEAD and Ports won't fight. Create your new user, and follow the rest of the instructions here while logged in as this user. If for some reason you want to run both as the same user, I have some tips below.

To compile HEAD, I used Andy Fawcett's buildhead script. There is a little problem with kdelibs, which boils down to the fact that the linker can't find the KDE libraries to run meinproc (which generates the KDE HTML documentation from the DocBook sources) before they are installed. Running gmake install manually in the kdelibs build directory should sort that out.

Also, you need newer versions of automake and autoconf than are in the Ports tree (this could be outdated now). I got automake-1.6.3 (Makefile.cvs didn't like automake 1.8 for some reason) and autoconf 2.58, and installed them into their own directory using ./configure --prefix=$HOME/kdesrc/tools. You have to add the kdesrc/tools/bin directory to $PATH in the buildhead script.

Once arts, kdelibs, kdebase and any other modules I needed were installed (in $HOME/cvs-kde), I used the following in .xinitrc to start KDE HEAD:

export KDEHOME=$HOME/.cvs-kde
export KDEDIR=$HOME/cvs-kde
export LD_LIBRARY_PATH=$KDEDIR/lib
export PATH=$KDEDIR/bin:$PATH
exec startkde
The first line is only really necessary if you are running HEAD and Ports as the same user.

I also put this in my .mcoprc (although, again, it could be a quirk of my setup):

ExtensionPath="$HOME/cvs-kde/lib"
TraderPath="$HOME/cvs-kde/lib/mcop"

This bit is only necessary if running both versions as the same user: To stop the .mcoprc and .kderc from different versions stepping on each other's toes, I saved the .mcoprc for ports as .mcoprc.ports and the for HEAD as .mcoprc.head, and just cp $HOME/.mcoprc.<version> $HOME/.mcoprc in .xinitrc, and similarly for .kderc

Acknowledgements etc.

I only managed to get this setup working with the help of Andy Fawcett and the other good people in #kde-freebsd. If you have achieved the same setup by the same or different means, we'd like to hear about it on the KDE/FreeBSD mail list.

Philip Rodrigues

Global navigation links