How to get KDE3.x.x and KDE3.5 (from the KDE svn repository) working on the same machine
Introduction
This paper aims to help new KDE developers to install the coming KDE3.5 (i.e the latest stable KDE version) from svn on their
machine without interfering with their KDE 3.3.x or KDE 3.4.x installation and thus allow them to
port their code or start developing or having a look at the new release without jeoparding their stability.
Advanced Linux users who want to help debugging or just taste new features
can also benefit from this tutorial.
The beta1 for this version is located at home/kde/tags/KDE/3.5.0-beta1.
Note: In the svn KDE repository, in trunk/KDE you will find the kde4 code which cannot be built with automake.
To have a better idea on how things are organized in KDE svn, you might want to navigate the websvn website: http://websvn.kde.org/
I explain (in great details) how to get, compile and install KDE3.5 from svn
and to get it work smoothly along with your existing KDE 3.
One way to do
it is to follow the link:
http://developer.kde.org/build/build2ver.html
Another way is to create a new user for KDE3.5 (I find it is better
with dcop). When you log in your normal user, you get your actual KDE3 installed from your distribution and when
you log in your new user (called here kde-dev) you'll be on KDE3.5 which is the current stable development branch.
That's the way I explain here.
The trick here is not to install the new KDE from svn on the actual KDE. If kde-cvs is NOT compiled as root, this cannot happen and you are safe!
I'll write KDE3.5 for KDE from svn HEAD. I'll say normal user for your usual user in your KDE3.x.x from your distribution and the kde-dev user will be for KDE3.5.
Note I use automake as build tool as it is the default for building KDE 3.5. You can use unsermake if you want.
Other tool
You can also find in the kdesdk module, in script, a script called kdesvn-build
that you can get from here:
http://websvn.kde.org/branches/KDE/3.5/kdesdk/scripts/kdesvn-build?rev=457212&view=log.
The KDE wiki has a special help page for it: http://wiki.kde.org/tiki-index.php?page=kdesvn-build.
Requirements
What you need to know before starting: we will get all KDE3
sources from svn and you need space on your disk. Qt-copy uses 120Mb and
kdesupport, kdelibs and kdebase (which are the minimum) ask for 500Mb space
disk. The other modules are not so big and use another 100Mb altogether.
As I propose to compile kde in the new kde3 user dir, see if you get enough
space to do that on your /home partition. Alternately you can choose /opt/kde3
for the compiling. We'll install KDE 3.5 in /usr/local/kde3.5.
Time needed: check out from svn can be quite long if you
just have a 56k connection (3 hours for qt-copy, 30 minutes for kdelibs, 1
hour for kdebase). Then the whole Qt+KDE compilation is quite long and depends
of course of the specs of your machine. As an indication, qt-copy takes more
than 6 hours on a AMD K6/2 350 (128Mb RAM) to compile. It takes only 38 minutes
on a 1.4G Athlon/256 Mb RAM (thanks to tap and carsten for these figures).
-
Automake 1.6 and Autoconf 2.53 or higher are now required for
compiling KDE. Type
autoconf --version
to check your version. If it's not 2.53, I suggest you update now. You can get the source at
http://www.gnu.org/software/autoconf/#downloading
and install it in your kde3 dir. (read further on to create that dir). This is because most applications still need the old autoconf to compile. So the new autoconf will only be used by the kde3 user to compile kde3.
For automake, you can get the source here. - A C++ compiler which supports exceptions, preferably gcc-2.95.x or gcc-3.2 or higher.
- If you want SSL support (for instance for secure web sites in konqueror), make sure you install openssl, version 0.9.6 or later (versions 0.9.5x are not supported).
- For Netscape-plugins support in konqueror, make sure to install lesstif.
- For a better regular-expressions support in Javascript, install libpcre.
- For the KDE help system, you'll need to install libxml2, version 2.3.13 or newer.
Note: I use vi as editor from a terminal and for people not familiar with it, there is a great tutorial here. You can also use pico or any other editor, please just replace vi by your editor name.
Setting up the sources and install directories
We'll keep the sources in the kde-dev user home. If this is not convenient for you, please choose another location where the kde-dev user will have write access.
We'll keep locally the svn repository structure: that means that things are organized locally like they are in the KDE repository. Sources will be in ~/kde-svn then the subfolders in /kde-svn will be the same than the ones in the KDE svn repository. For example, qt-copy for KDE 3.5 will be in
~/kde-svn/branches/qt/3.3/qt-copy.
KDE 3.5 itself will be installed in /usr/local/kde3.5. You can also change this location, just make sure for safety that the location you'll choose will have write access for the kde-dev user and will not be a location used by your other KDE installation.
Set up
Create the new kde-dev user
As root:[root@localhost ann]# adduser -m kde-dev(don't forget the -)
[root@localhost ann]# passwd kde-dev(enter the same password twice)
We'll install svn in /usr/local/kde3.5, a new dir in which we give the usr kde-dev the write permission.
Still as root:
[root@localhost ann]# mkdir /usr/local/kde3.5 [root@localhost ann]# cd /usr/local/kde3.5 [root@localhost kde3.5]# chown kde-dev:kde3.5 .Warning: (don't forget the dot)
You can now exit root by typing
[root@localhost kde3.5]# exit
Setting up the environment variables for the new user
Now, for KDE3.5, we log in as kde-dev user to be sure we won't interfere with the existing kde installation.[ann@localhost ann]$ su - kde-dev(watch the -)
Password:
you type in the kde-dev user password.
Edit the file .bash_profile in /home/kde-dev and add the following lines:
export KDEDIR=/usr/local/kde3.5
export QTDIR=/home/kde-dev/kde-svn/branches/qt/3.3/qt-copy
export MANPATH=$QTDIR/doc/man:$MANPATH
export PATH=$QTDIR/bin:$KDEDIR/bin:$PATH
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
Logout as kde-dev, login as root.
[kde-dev@localhost kde-dev]$ exit(password)
[ann@localhost ann]$ su
Edit the file /etc/ld.so.conf and add these two lines:
/home/kde-dev/kde-svn/branches/qt/3.3/qt-copy/lib
/usr/local/kde3.5/lib
Re-log as kde-dev (note that all those variables setup are a one-time hassle only!)
[ann@localhost ann]$ su - kde-devPassword:
This is for the new variables to be recognized. Each time you'll log in kde-dev, these variables will be set up.
You can check that your variables are correct by typing:
[kde-dev@localhost kde-dev]$ set |grep KDEDIRThe output should be
KDEDIR=/usr/local/kde3.5Then:
[kde-dev@localhost kde-dev]$ set |grep QTDIR QTDIR=/home/kde-dev/kde-svn/branches/qt/3.3/qt-copy
Compiling qt-copy from svn
You can use your qt version from your distribution if it is qt-3.3.4. Oterwise, please get the latest qt-copy version which is 3.3.5 for KDE 3.5.Getting qt-copy from svn
You need first to get qt-copy from svn and to compile it.[kde-dev@localhost kde-dev]$ mkdir -p kde-svn/branches/qt/3.3/ [kde-dev@localhost kde-dev]$ cd kde-svn/branches/qt/3.3 [kde-dev@localhost 3.3]$ svn co svn://anonsvn.kde.org/home/kde/branches/qt/3.3/qt-copyYou'll see a lot of lines writing in the terminal.
When you get the prompt back, then the svn checkout is finished, you need to compile.
Compiling qt-copy
Before compiling, you need to set up a few environment variables:[kde-dev@localhost 3.3]$ cd qt-copy [kde-dev@localhost qt-copy]$ export YACC='byacc -d' [kde-dev@localhost qt-copy]$ export QTDIR=$PWD [kde-dev@localhost qt-copy]$ export PATH=$QTDIR/bin:$PATH [kde-dev@localhost qt-copy]$ make -f Makefile.cvs [kde-dev@localhost qt-copy]$ ./configure -system-zlib -qt-gif -system-libpng -system-libjpeg \ -plugin-imgfmt-mng -thread -no-exceptions -debug -fastYou'd better copy/paste the ./configure command to get it right.
(Shell novices please see the special note at the end of this page to learn about the meaning of trailing backslashes in BaSH command lines.)
[kde-dev@localhost qt-copy]$ makeNo need to install qt. If all went well, you should have qt 3.3.5 on your machine.
Note: If you wish to save some time and skip the examples and tutorials you can use instead:
make sub-toolsThis will only build the moc compiler and Qt library. You can always build the examples and tutorials later by just re-running make by itself (without target)
Getting and compiling kdesupport
The kdesupport module contains some libraries that are needed by the kdemultimedia module such as taglib and akode. You can choose not to install it but you will have to miss the build of some kdemultimedia applications. For example juK will not build without TagLib.
The kdesupport module is located in trunk/kdesupport. As the kde-dev user, do:[kde-dev@localhost kde-dev]$ cd kde-svn [kde-dev@localhost kde-dev]$ mkdir trunk/ [kde-dev@localhost kde-dev]$ cd trunk [kde-dev@localhost trunk]$ svn co svn://anonsvn.kde.org/home/kde/trunk/kdesupportthen you build it with the now familiar sequence, adding a prefix to the configure script as otherwise per default kdesupport installs in /usr/local/kde.
[kde-dev@localhost trunk]$ cd kdesupport [kde-dev@localhost kdesupport]$ make -f Makefile.cvs [kde-dev@localhost kdesupport]$ ./configure --prefix=/usr/local/kde3.5 [kde-dev@localhost kdesupport]$ make [kde-dev@localhost kdesupport]$ make install
Getting and compiling aRts
We will get first aRts which gives you the sound libraries needed for KDE.
aRts is located in home/kde/branches/arts/1.5/arts for aRts that goes with kde 3.5.
Note: you can compile without aRts, i.e. you can skip that step and then add --without-arts as
configure option for kdelibs but you will miss half the KDE multimedia programs later.
You will also not have any sound in some KDE programs.
[kde-dev@localhost kde-dev]$ cd kde-svn/branches [kde-dev@localhost branches]$ mkdir -p arts/1.5 [kde-dev@localhost branches]$ cd arts/1.5 [kde-dev@localhost 1.5]$ svn co svn://anonsvn.kde.org/home/kde/branches/arts/1.5/arts [kde-dev@localhost 1.5]$ cd arts [kde-dev@localhost arts]$ make -f Makefile.cvs [kde-dev@localhost arts]$ ./configure [kde-dev@localhost arts]$ make [kde-dev@localhost arts]$ make installPlease check that the installed files go to the /usr/local/kde3.5 dir.
[kde-dev@localhost arts]$ ls -l $KDEDIR/libYou should have some output like that:
-rwxr-xr-x 1 kde-dev kde-dev 807 Feb 14 13:18 libmcop.la lrwxrwxrwx 1 kde-dev kde-dev 16 Feb 18 18:01 libmcop.so -> libmcop.so.1.0.0
Getting and compiling kde, at last!
You now must start with kdelibs then you can build kdebase and then any other modules.All these modules are located in branches/KDE/3.5/.
Note: be aware that in trunk/KDE is kde4 code and it cannot be built using automake!
[kde-dev@localhost kde-dev]$ cd kde-svn/branches [kde-dev@localhost branches]$ mkdir -p KDE/3.5 [kde-dev@localhost branches]$ cd KDE/3.5 [kde-dev@localhost 3.5]$ svn co svn://anonsvn.kde.org/home/kde/branches/KDE/3.5/kdelibs [kde-dev@localhost 3.5]$ cd kdelibs [kde-dev@localhost kdelibs]$ make -f Makefile.cvs [kde-dev@localhost 3.5]$ ./configureAlways look at the end of the configure script as it can tell you if you miss some libraries and sometimes some parts of the module will not be compiled if this is the case. Install the missing libraries (plus the devel packages) from your distribution and run ./configure again.
[kde-dev@localhost 3.5]$ make [kde-dev@localhost 3.5]$ make installIf you get a compile error that you cannot resolve (i.e if you are sure you don't miss a devel package), you can re-run the compile by:
make -i make -i installBe aware that you should try to resolve any compile error by checking your system and enquiring on IRC for example for known bugs because you can later miss an important lib that will not be compiled.
You then repeat the procedure for kdelibs, kdebase and all the modules you want to try. Please note that qt-copy, arts then kdelibs are to be compiled in that order.
If something went wrong and you want to start again to compile a module, you have to run:
[kde-dev@localhost arts]$ make cleanbefore re-starting with
[kde-dev@localhost arts]$ make -f Makefile.cvs .....
When you have finished with kdesupport, arts, kdelibs and kdebase, you can try the new KDE by getting to your graphical login and use the kde-dev user to start kde. You will see the new splashscreen at first. If not, then one of your variables must be incorrect.
Note for Suse users: in /home/kde-dev/.xinitrc, replace the
line
exec $WINDOWMANAGER
by
/usr/local/kde3.5/bin/startkde
Accessing a KDE 3.5 program from your KDE normal user
If you are logged as your normal user, you still can launch a KDE3.5 program. The program will then run as in KDE3.5 but on the other KDE3 environment.You open a terminal and type as the normal user:
[ann@localhost ann]$ xhost + localhost [ann@localhost ann]$ su - kde-dev Password: [kde-dev@localhost kde-dev]$ export DISPLAY=:0.0 [kde-dev@localhost kde-dev]$ the name of the KDE3.5 program
Compile errors you can get
While compiling qt-copy:make[4]: qmake: Command not found(that means that qmake is not in your PATH, the system cannot find it)
enter in the terminal:
export PATH=/usr/local/qt-copy/bin/:$PATH
If you want to update KDE from svn
You did it all, it works well. Then you want to update your svn copy because there had been a lot of changes in the code.You can just run
cd module_name svn up make make installin each module. Only the modified files will be compiled and installed.
If after issuing your cvs up one or several Makefile.am have been modified in a module, you will need to do:
make -f Makefile.cvs ./configure make make installBut sometimes things get a bit messy and a safe way to proceed is the following.
In each module, starting with qt-copy and in the correct order, you run in a terminal:
cd module_name make clean (or make distclean for removing all configure-related files) svn up make -f Makefile.cvs ./configure (with options if necessary) make make install (except for qt-copy)
If you want only one application in a module
Sometimes you want only one application in a module, especially in the kdenonbeta module which is very big.Here we suppose the module is called module_name and the program you want is appname.
svn co -N svn://anonsvn.kde.org/home/kde/branches/KDE/3.5/module_name cd module_name svn co svn://anonsvn.kde.org/home/kde/branches/KDE/3.5/module_name/appname svn co svn://anonsvn.kde.org/home/kde/branches/KDE/3.5/kde-common/admin make -f Makefile.cvs ./configure make make install
Thanks to Olaf Zanger for testing
and helping to improve the document.
and to
Karl-Heinz Zimmer for adding the bash
shell explanation.
Anne-Marie Mahfouf
(c)2001-2005 Free Documentation
From original french docs by François-Xavier Duranceau (KDE1+2) and
Hervé Lefebvre.
You can find a similar document in french at
http://www.kde-france.org/article.php3?id_article=17
A note for shell novices: Some of the above mentioned commands show a trailing backslash (\) at the end of some of their lines, to learn about the meaning of that character please read the following excerpt from the bash manpage:
If a \[newline] pair appears, and the backslash is not itself quoted, the \[newline] is treated as a line continuation (that is, it is removed from the input stream and effectively ignored).Thus by adding a single backslash to a line you can tell the command interpreter that this line's command is continued in the following line - a convenient way to achieve a printable layout by splitting long command lines into several lines on a web page or in printed output.
Note however that the [backslash][newline] token has the opposite effect when appearing within quoted lines, so the following BaSH command would result in a single output line:
echo "This is one \ long line."while this would result in a two line output:
echo "This is the first line and this is the second line."In either case the backslash must appear immediately before the end of the line: no trailing white space is allowed.
Last update: 2006-10-04
[ Edit ]
KDE Women Homepage