Compiling KDE – Fedora: Building

November 7, 2008 at 9:07 pm (console, fedora, kde, linux) (, , , , , , , , )

Building KDE is very easy. The only thing you need to do is:

1- Download the source code
2- Configure it with cmake
3- make && make install

Downloading the source code:
We will start from the first step. To get the source code, we will use svn:
$ svn checkout svn://anonsvn.kde.org/home/kde/...
and you replace ‘…’ with the module you want to download.

Before you download the source codes, create a folder in you home directory where you would put your sources. (Just to be more organized). I created a directory called “kdesvn” in my home:
$ mkdir ~/kdesvn
then we ‘cd’ into the created directory:
$ cd ~/kdesvn

Now we download the source codes into this directory using svn:

$ svn co svn://anonsvn.kde.org/home/kde/trunk/kdesupport kdesupport
$ svn co svn://anonsvn.kde.org/home/kde/trunk/KDE/kdelibs kdelibs
$ svn co svn://anonsvn.kde.org/home/kde/trunk/KDE/kdepimlibs kdepimlibs
$ svn co svn://anonsvn.kde.org/home/kde/trunk/KDE/kdebase kdebase

the argument after the URL is the name of the local folder (what you want the directory you are downloading be called on your computer).

We are finished with the first step!!! :D

Configuring it with cmake:
now that we have downloaded all the source codes, we need to configure it and prepare it for building and installing. To do this, we use cmake (simply because the source code requires us to use it):
$ cmake -DCMAKE_INSTALL_PREFIX=/usr ..

don’t get scared. We just run cmake with two arguments, the first argument (-DCMAKE_INSTALL_PREFIX), as the name applies, is where you want the application to be installed. I just chose /usr because it’s easier than installing it to ~. The second argument (..) is the directory you want to configure (and .. means parent directory and . (dot) means current directory).

Before starting to configure, we go to each directory of the source code and we create a ‘build’ directory in each of them (again, just to be more organized, and it’s good practice):
$ cd ~/kdesvn/kdesupport && mkdir build && cd build

and then we ‘cd’ into the ‘build’ directory.
And now is the time to configure the fabulous source code! :D

$ cmake -DCMAKE_INSTALL_PREFIX=/usr ..

if you have installed all the requirements, this shouldn’t give you any problems (as long as the source code itself is not screwed up).

And finally building it:
building the configured source code is dead easy! Just do make && sudo make install that’s all!

$ make
$ su -c 'make install'

The next post will be about how to actually run your build. So keep up ;)

Permalink Leave a Comment

Another attempt: building KDE 4 option 2

February 11, 2008 at 8:26 pm (Uncategorized) (, , )

There also an easier way to get KDE 4 which I used myself. For this one, you don’t need to change your .bashrc or anything else. Just checkout sources wherever you want and you’re done ( of course you must install dependencies first ).

after you checkout SVNs in ‘/home/KDE4devel/SRCs/KDE/’ you can just make another folder, let’s say ‘/home/KDE4devel/Build/KDE/’
open Terminal/Konsole and then type:
su -
cd /home/KDE4devel/Build/KDE
cd kdelibs
cmake && make && make install
cd ..
cd kdepimlibs
cmake && make && make install
cd ..
cd kdebase
cmake && make && make install
cd ..
cd “yourmodule”
cmake && make && make install

OR if you have changed your .bashrc, you can do for each one:

cd /home/KDE4devel/SRCs/KDE/4.0/yourmodule
cmakekde

(it MIGHT work, I just made it up right now ;) )

WARNING: THIS WILL REPLACE YOUR KDE 3.5 DESKTOP.
WARNING: YOU WILL NEED ROOT PRIVILEGES.

If you try this one, leave comment for me whether if it worked for you or not. Thanks :)

Permalink Leave a Comment

Another attempt: building KDE 4 option 1

February 11, 2008 at 8:17 pm (Uncategorized) (, , )

now we get to really build KDE 4.
first of all, you should change you ~/.bashrc file and I’ll tell you how and what to change.

go to your home directory and
View > Show hidden files
now if you look closely, you’ll find a file called “.bashrc” among the hidden files.
open that with a text editor ( in 99% cases just double click it )

copy the .bashrc in you original home ( /home/username/ ) into your KDE4devel account ( /home/KDE4devel/ ) it should replace it.

copy/paste the contents of this .bashrc into your .bashrc, after “#user-specified commands” ( or something like that ).

now you’re ready to go. By the way, this .bashrc you just did, was only to make life easier but it is in fact necessary and you HAVE TO do it ;)

Building kdelibs
the first module ( package ) you should make/compile, is kdelibs. You SHOULD make this first of all.
to compile kdelibs, just do this:

cd
cs
mkdir KDE && cd KDE
svn checkout svn://anonsvn.kde.org/home/kde/branches/KDE/4.0/kdelibs
cd kdelibs
cmakekde

note: cs is not a typo. you made this command available by editing your .bashrc file, look into that for more info.
for troubleshooting stuff look into here.

Building kdepimlibs
next comes the kdepimlibs. the recipe is this:

cs KDE
svn checkout svn://anonsvn.kde.org/home/kde/branches/KDE/4.0/kdepimlibs
cd kdepimlibs
cmakekde

again, for troubleshooting stuff go here.

Building kdebase
next goes to kdebase.
recipe:

cs KDE
svn checkout svn://anonsvn.kde.org/home/kde/branches/KDE/4.0/kdebase
cd kdebase
cmakekde

troubleshooting stuff -> here.

from now, you can build all of the modules you want with the same fashion. For a minimal KDE 4 session you only needed those 3 modules and that’s all.
after you finished compiling all the modules you want, you just log out, and log in again, hopefully everything will be fine and you will have your KDE 4 session :D

Good Luck with your building :D ( building as in compiling ;) )
note: I got this information from here.

Permalink Leave a Comment

Another attempt: building KDE 4 SVN checkout

February 11, 2008 at 7:53 pm (Uncategorized) (, , , , )

NOTE: LOOK AT Another attempt: building KDE 4 part 3 AND part 4 TO SEE WHICH ONE YOU’RE INTERESTED IN DOING. YOU WILL NOT NEED THIS IF YOU’RE GOING TO USE THE SAFER PART 3.

ok, here we have all the dependencies ready to go and there just remains our time to be spent on compiling KDE 4 itself :)
WARNING: THIS STEP MUST BE DONE IN ONLY NORMAL USER. NO ROOT USER PLEASE. IF IT NEEDS YOU TO ENTER ROOT PASSWORD, REVIEW AND SEE WHAT YOU HAVE DONE WRONG.

first thing you should do, is that you should make a new user account to be used by KDE 4 ( just in case ).
to do it, go to ( for KDE ) Kmenu > system > users and groups ( for GNOME ) System > Administration > users and groups

make a new account and login to that account ( simply log out, and then log in again )
make a new folder wherever you want ( definitely not in root folder ) that you put your sources in it.
for this “tutorial” I will use /home/KDE4devel/SRCs/
go to that folder and open a Terminal/Konsole which points to that folder by using this command

cd /home/KDE4devel/SRCs/KDE/

now, you should download the sources of KDE 4 into this folder you just created. if you want to use fancy names, call it check out SVNs ( es-vi-enz )
to do this, just open Terminal/Konsole and type:
1) svn co -N svn://anonsvn.kde.org/home/kde/trunk/KDE
2) svn co -N svn://anonsvn.kde.org/home/kde/branches/KDE/4.0

if you want it really new and cutting edge, go for the first one, but if you prefer to back down a little bit ( not really much difference though ) go for the second one. But generally I’d suggest second one ;)

now just type:

cd 4.0
svn list
svn up kdebase kdepimlibs kdelibs

if you want other packages also to be checked out, you can just put them in svn up. for example if you want to also checkout kdemultimedia and kdegraphics, you just type

svn up kdebase kdepimlibs kdelibs kdemultimedia kdegraphics (etc.)

wait for quite a long time till it finishes ;)

you have just downloaded the source code of KDE 4. Next post, will be about compiling KDE 4.
Good luck :D

Permalink Leave a Comment