How-To KDE from CVS
I'm currently working on KDE (KPovModeler Mainly) so I needed to run the latest KDE cvs, I had some trouble getting everthing working properly. I didn't want to get rid of my stable KDE, so I needed to set up things up to run two versions, this how-to is about the way I did it.
If you hace a CVS account with KDE don't forget to change the CVSROOT to match your login.
If you think I've missed something, or have a correction to make, or this doesn't work for you, email me at leon@leonscape.co.uk and I'll try to do my best to fix it as soon as possible.
Contents
Changelog
1.1 18/06/04 Updated launching to include KDM
1.0 05/01/04 Completed First Version
ContentsSetting things up
The first thing we have to do is decide where we are going to download the sources, and where we are going to install KDE. This is going to require gigs of space. So I decided I'd have the sources in /usr/local/src/ and the install in /usr/local/. The prefered place by most people is in their home directory. Whichever you choose just make sure you have plently of space! I will refer to the sources directory as <SourceDir> and the install directory as <InstallDir>.
As I was using /usr/local/ and /usr/local/src I needed to add my user account to staff. To do this I needed to be root. The following command does this. If your using your home directory this is not need. This should be the only thing you need to do as root. The rest we will carry out as a normal user.
Now we need to create the directories we are going to need.
$ mkdir <InstallDir>/kde-unstable
Now we need to create a file called .cvsrc in our home directory, using your favourite text editor create a new file called ~/.cvsrc and edit it to look like this:
diff -u3 -p
update -dP
checkout -P
Now onto some exports. These are important to get right so make sure you check what you type (Tab is usefull for paths), and use echo to check that their exported properly.
$ export KDEDIRS <InstallDir>/kde-unstable
$ export LD_LIBRARY_PATH=$KDEDIRS/lib:$QTDIR/lib
$ export PATH=$KDEDIRS/bin:$QTDIR/bin:$PATH
$ export CVSROOT=:pserver:anonymous@anoncvs.kde.org:/home/kde
Downloading sources
Now we need to get our sources from CVS. the first thing we need to do is create a password file, then login. When it asks for a password simply press enter.
$ cvs login
password:
First we'll download the qt-copy, this is the latest version of Qt, and is usally the required version for the KDE cvs. Then the basic modules arts, kdelibs, and kdebase. These are the essential packages to get a working KDE installation.
$ cvs co qt-copy
$ cd <SourceDir>/kde-source
$ cvs co arts kdelibs kdebase
You can of course download other kde modules, I'd recommend kdenetwork, kdepim, kdegraphics, kdemultimedia, kdeartwork, kdeutils and kdeaddons, for a more complete KDE. If your developing for KDE then kdesdk and kdevelop are very useful.
If you want KDE in another language then the admin and kde-i18n are needed. kde-i18n is huge and you may only want one language. so you need to get only the top of the kde-i18n module ( using -l ) and you language fodler. then you need to setup kde-118n to only compile and configure that folder. I'll refer to the language code as <LangCode>. Check kde i18n for a complete list of languages and their codes.
$ cvs co admin
$ cvs co -l kde-i18n
$ cvs co kde-i18n/<LangCode>
$ cd kde-i18n
$ echo <LangCode> > inst-apps
$ ln -s ../admin
Now you can treat kde-i18n, the same as the other modules. If you want more languages simply download the directories with cvs co, and redo the echo command adding the language codes before >.
ContentsCompiling and installing
The first thing to do it configure and compile Qt.
$ export YACC='byacc -d'
$ ./configure -system-zlib -qt-gif -system-libpng -system-libjpeg -plugin-imgfmt-mng -thread -no-stl -no-xinerama -no-exceptions -fast
$ make sub-tools
This will build the moc compiler and the Qt Library, missing out the tutorials and examples. If you want to have them, you can always build them later by just typing make instead of make sub-tools. If you wish to have debugging enabled for Qt add -debug to the configure line.
Now that Qt has compiled the next thing to do is configure make and install all the KDE modules. You must start with arts, kdelibs and kdebase in that order. Then you can install the other packages, and finally i18n. For each module type:
$ make -f Makefile.cvs
$ ./configure --prefix=$KDEDIRS
$ make
$ make install
If you wish to have debugging enabled add --enable-debug to the configure line. If you want to use alsa add --with-alsa to the configure line.
ContentsRunning KDE
Theres two ways to start your new KDE CVS. IF you want to use KDM, You can alter the startkde script, and create a destop file. Or you can use the command line using a script.
KDM
Altering the startkde script is easy, just add the following lines before the first line of code.
KDEDIRS=<InstallDir>/kde-unstable
LD_LIBRARY_PATH=$KDEDIRS/lib:$QTDIR/lib
PATH=$KDEDIRS/bin:$QTDIR/bin:$PATH
KDEHOME=~/.kde-unstable
export QTDIR KDEDIRS LD_LIBRARY_PATH PATH KDEHOME
You can alter the startkde script where it is, but it will be overwritten if you rebuild and install KDE, so you could move it somewhere else, but the directory where you place it will become part of the path when you start KDE.
Now you need to create a kdm destop file. The best way to create this file is by copying the one for KDE, and renaming and altering it. The files can be found at apps/kdm/sessions/ ( apps differs in location from distro too distro. Debians is in /usr/share ).
Copy the kde.desktop too kde-unstable.desktop, now edit it, change the following lines:
Exec=<InstallDir>/bin/startkde
TryExec=<InstallDir>/bin/startkde
Name=KDE-Unstable
Now KDM will have KDE-Unstable in its list of sessions. DON'T put the destop file in kde-unstable, as the KDM thats launched at start up isn't the one in kde-unstable. ( Probably unless you altered it to be. )
Command Line
The easiest way I've found of running the KDE CVS from the command line. is by creating a script. Its not complex and should be very easy to write create a file called ~/startkde.sh and edit it with your favourite edtor to this:
# sets the Qt and KDE paths
QTDIR=<SourceDir>/qt-copy
KDEDIRS=<InstallDir>/kde-unstable
LD_LIBRARY_PATH=$KDEDIRS/lib:$QTDIR/lib
PATH=$KDEDIRS/bin:$QTDIR/bin:$PATH
KDEHOME=~/.kde-unstable
#export the variables
export QTDIR KDEDIRS LD_LIBRARY_PATH PATH KDEHOME
#start kde
xinit $KDEDIRS/bin/startkde
Now alter its permissions to be executable with:
Now when you login to your machine on the command line type startx for Stable KDE or ./startkde.sh for KDE from CVS.