Getting Started/Build/Historic/KDE4

From KDE TechBase
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Build Recipes

Git Unstable Master

This will be the most commonly used version of the Full Recipe.

cd <your source root directory>
git clone git://anongit.kde.org/<module>.git
cd <your build root directory, or the module source dir>
mkdir <your module build dir>
cd <your module build dir>
cmake <path to your module source dir>
      \ -DCMAKE_INSTALL_PREFIX=$KDEDIR 
      \ -DCMAKE_BUILD_TYPE=debugfull
      \ -DKDE4_BUILD_TESTS=TRUE
nice make -j2 # for faster compiles use -j(X+1)' where X is your number of processor cores
make install

Git Unstable Branch

This recipe uses the same Git clone as your main Unstable Master build but allows you to build a specific development branch you may be interested in. It assumes you have already cloned the project repository. Use 'git branch -r' to find out the available development branches.

cd <your project source directory>
git branch --track <branch> origin/<branch>
git checkout <branch>
cd <your module build dir>
cmake <path to your module source dir>
      \ -DCMAKE_INSTALL_PREFIX=$KDEDIR 
      \ -DCMAKE_BUILD_TYPE=debugfull
      \ -DKDE4_BUILD_TESTS=TRUE
nice make -j2 # for faster compiles use -j(X+1)' where X is your number of processor cores
make install

Git Stable Branch

This recipe uses git-new-workdir script to set up a separate work directory for working on the stable branch. This will save excessive rebuilding when switching between stable and unstable and uses less space than a separate clone.

The stable branch name will be of the form 'KDE/4.6' or '4.6' depending on the Project. Use 'git branch -r' to find out the available release branches.

cd $KDE_SRC/master/<module>
git-new-workdir <project> $KDE_SRC/<stable-branch>/<module>/<project> <stable-branch>
cd <your build branch directory, or the module source dir>
mkdir <your module build dir>
cd <your module build dir>
cmake <path to your module source dir>
      \ -DCMAKE_INSTALL_PREFIX=$KDEDIR 
      \ -DCMAKE_BUILD_TYPE=debugfull
      \ -DKDE4_BUILD_TESTS=TRUE
nice make -j2 # for faster compiles use -j(X+1)' where X is your number of processor cores
make install

An example git-new-workdir command for KDE SC 4.6 would be:

git-new-workdir ~/kde/src/master/kdelibs ~/kde/src/4.6/kdelibs KDE/4.6

Subversion Unstable

cd <your source root directory>
svn checkout svn://anonsvn.kde.org/home/kde/trunk/KDE/<module>
cd <project>
git branch --track <stable-branch> origin/<stable-branch>
git checkout <stable-branch>
cd <your build root directory, or the module source dir>
mkdir <your module build dir>
cd <your module build dir>
cmake <path to your module source dir>
      \ -DCMAKE_INSTALL_PREFIX=$KDEDIR 
      \ -DCMAKE_BUILD_TYPE=debugfull
      \ -DKDE4_BUILD_TESTS=TRUE
nice make -j2 # for faster compiles use -j(X+1)' where X is your number of processor cores
make install

If you have a developer account the Subversion command will be:

svn checkout svn+ssh://<username>@svn.kde.org/home/kde/trunk/KDE/<module>

Subversion Stable

cd <your source branch directory>
svn checkout svn://anonsvn.kde.org/home/kde/branches/KDE/<branch>/<module>
cd <project>
git branch --track <stable-branch> origin/<stable-branch>
git checkout <stable-branch>
cd <your build branch directory, or the module source dir>
mkdir <your module build dir>
cd <your module build dir>
cmake <path to your module source dir>
      \ -DCMAKE_INSTALL_PREFIX=$KDEDIR 
      \ -DCMAKE_BUILD_TYPE=debugfull
      \ -DKDE4_BUILD_TESTS=TRUE
nice make -j2 # for faster compiles use -j(X+1)' where X is your number of processor cores
make install

If you have a developer account the Subversion command will be:

svn checkout svn+ssh://<username>@svn.kde.org/home/kde/branches/KDE/<branch>/<module>

Useful Tips

make /fast

If you want to recompile part of a module without rebuilding any other parts of a module that it uses then you can pass make the /fast option.

For example if you just want to rebuild the contentes of kdelibs/kdeui without rebuilding the contents of kdelibs/kdecore that it uses, then simply do:

 make kdeui/fast
 make install/fast


Requirements

The following table summarizes all the Projects contained in KDE Support and the versions required for building KDE Software. The optional/mandatory coloring is based on the requirements of the KDE Development Platform, the requirements for building other KDE Modules or Applications may vary.

Build Requirements
Requirement Stable Requires Unstable Requires Devel Pkgs? Details
Automoc 0.9.88 No
Attica 0.2.0 Yes
Polkit Qt 0.99 Yes Requires PolicyKit >= 0.98
Strigi 0.7.2 Yes After cloning the Strigi parent project, you will have to run the change_to_development_git.sh script to pull in all sub projects. See below for requirements.
Soprano Yes Soprano must be built BEFORE Akonadi.
Akonadi Yes Akonadi must be built AFTER Soprano.
Cagibi Yes
Phonon Yes You need to install this Phonon in the same location as Phonon from Qt i.e. in $QTDIR and NOT in $KDEDIR. You will also need to install a backend module.
Prison Any Yes Requires QRencode and Dmtx
Oxygen Icons No In KDESupport module (see below)
QImageBlitz Yes In KDESupport module (see below)
TagLib Yes In KDESupport module (see below)
cpp2xml No In KDESupport module (see below)

Strigi requirements

Project Build Requirements
Requirement Stable Requires Unstable Requires Devel Pkgs? Details
Qt >= 4.3.0 >= 4.3.0 Yes The Qt development framework.
libz Yes A library for zip file compression
libbz2 Yes A library for bzip2 file compression.
libxml2 Yes A library for parsing XML
Clucene >=0.9.16a >=0.9.16a Yes A high-performance indexing and searching API. Version 0.9.17 does not work.
Exiv2 Yes A library to manage image metadata.
FFMPEG Yes A library for reading audio and video files.
DBus Yes A message bus system.
FAM Yes A tool for file system monitoring.
Log4cxx Yes A logging framework for C++
CppUnit Yes A C++ Unit Testing framework

KDESupport module

cd <your source root directory>
svn checkout svn://anonsvn.kde.org/home/kde/trunk/kdesupport/
cd <your build root directory, or the module source dir>
mkdir <your module build dir>
cd <your module build dir>
cmake <path to your module source dir>
      \ -DCMAKE_INSTALL_PREFIX=$KDEDIR 
      \ -DCMAKE_BUILD_TYPE=debugfull
      \ -DKDE4_BUILD_TESTS=TRUE
make 
make install

KDE Libraries

KDE Libraries (kdelibs) is the core library of the KDE Development Platform.

Project Page https://projects.kde.org/projects/kde/kdelibs
Easy Repository git clone kde:kdelibs.git
Full Repository git clone git://anongit.kde.org/kdelibs.git


KDE Libraries Build Requirements
Requirement Stable Requires Unstable Requires Devel Pkgs? Details
Shared desktop ontologies ?? >= 0.6.50 ?? Support for the Nepomuk semantic desktop system.
This is needed if you intend to install kdepimlibs
Grantlee ?? >= 0.1.0 ?? Grantlee is used for generating compilable code by the ModelEventLogger.
Without Grantlee, the logger will do nothing.
Aspell ?? Spell checking support via Aspell.
HSpell ?? Spell checking support for Hebrew.

KDE PIM Libraries

KDE PIM Libraries (kdepimlibs) is the PIM library of the KDE Development Platform.

Project Page https://projects.kde.org/projects/kde/kdepimlibs
Easy Repository git clone kde:kdepimlibs.git
Full Repository git clone git://anongit.kde.org/kdepimlibs.git


KDE PIM Libraries Build Requirements
Requirement Stable Requires Unstable Requires Devel Pkgs? Details
[http:// Project] Yes A library for

Troubleshooting

If cmake tells you that it can not find Nepomuk, it may be that you are missing some of the nepomuk dependencies of kdelibs.

The solution is to rebuild kdelibs with the missing dependencies.

KDE Runtime

KDE Runtime (kde-runtime) is the runtime component of the KDE Development Platform.

Project Page https://projects.kde.org/projects/kde/kde-runtime/
Easy Repository git clone kde:kde-runtime.git
Full Repository git clone git://anongit.kde.org/kde-runtime.git


Project Build Requirements
Requirement Stable Requires Unstable Requires Devel Pkgs? Details
[http:// Project] Yes A library for

KActivities

API for using and interacting with Activities as a consumer, application adding information to them or as an activity manager.

Project Page https://projects.kde.org/projects/kde/kdelibs/kactivities
Easy Repository git clone kde:kactivities
Full Repository git clone git://anongit.kde.org/kactivities


Project Build Requirements
Requirement Stable Requires Unstable Requires Devel Pkgs? Details
[http:// Project] Yes A library for

Kate

TODO: Does it belong here or Apps?

Kate is the text editor component for the KDE Development Platform.

Project Page https://projects.kde.org/projects/kde/kdebase/kate
Easy Repository git clone kde:kate.git
Full Repository git clone git://anongit.kde.org/kate.git


Kate Build Requirements
Requirement Stable Requires Unstable Requires Devel Pkgs? Details
[http:// Project] Yes A library for

Konsole

TODO: Does it belong here or Apps?

Konsole is the terminal emulator component for the KDE Development Platform.

Project Page https://projects.kde.org/projects/kde/kdebase/konsole
Easy Repository git clone kde:konsole.git
Full Repository git clone git://anongit.kde.org/konsole.git


Konsole Build Requirements
Requirement Stable Requires Unstable Requires Devel Pkgs? Details
[http:// Project] Yes A library for

KDE SDK

The KDE SDK Module is not strictly speaking part of the KDE Development Platform, but it contains many useful tools and scripts that make developing KDE Software a lot easier and so is recommended to always be built or installed.

Project Page http://websvn.kde.org/trunk/KDE/kdesdk/
Easy Repository svn checkout svn://anonsvn.kde.org/home/kde/trunk/KDE/kdesdk/
Full Repository svn checkout svn://anonsvn.kde.org/home/kde/trunk/KDE/kdesdk/


KDE SDK Build Requirements
Requirement Stable Requires Unstable Requires Devel Pkgs? Details
[http:// Project] Yes A library for

KDE Workspace

KDE Workspace (kde-workspace) provides desktop, netbook and mobile workspaces..

Project Page https://projects.kde.org/projects/kde/kdebase/kde-workspace
Easy Repository git clone kde:kde-workspace.git
Full Repository git clone git://anongit.kde.org/kde-workspace.git


KDE Workspace Build Requirements
Requirement Stable Requires Unstable Requires Devel Pkgs? Details
[http:// Project] Yes A library for

Applications

Here we will try to compile an application, let's say blinken. You can find information about all KDE software at the KDE Projects page

First we will download the code

git clone git://anongit.kde.org/blinken


This will create a directory with blinken's source code inside. We also create a directory to contain the files generated during the build process, and change into that directory.

cd blinken; mkdir build; cd build


Now we'll set up the development system by calling cmake. We're passing two parameters here: CMAKE_INSTALL_PREFIX indicates where the application will be installed, and CMAKE_BUILD_TYPE has the value "debugfull" to tell CMake not to throw away information that is useful for developers.

cmake .. -DCMAKE_INSTALL_PREFIX=<install_path> -DCMAKE_BUILD_TYPE=debugfull

If you just want to install it in the same place as the rest of KDE, you can do

cmake .. -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` -DCMAKE_BUILD_TYPE=debugfull


The moment we were all expecting has arrived, now you can start compiling.

make -j3

The -j3 option tells make to try to do up to three things at once. A good rule for this option is to add one to the number of cores your computer has. In this example, we're assuming you have a dual-core computer (which is fairly common). If you have a quad-core computer, you may want to pass -j5. If you want to do other things on your computer at the same time, you may want to lower the number. Note that if you are not sure you should rather take a lower number.

Some applications can work without installing but that's usually not the case so just do it if you know what you're doing, otherwise you will want to install probably.

make install


If you're installing it to a directory where the owner is root, then you'll probably need some extended privileges to install. That's not the only option, though. You can create a specific install directory by pointing the PATH and KDEDIRS variables to it, more information here: Getting_Started/Build/Environment