
In this chapter, we show how to use the Kdesvn-build to checkout modules from the KDE repository and build them. We also provide a basic explanation of the KDE Subversion structure and the steps you have to perform before running the script.
All topics present in this chapter are covered with even more detail in the Building KDE from Source Step by Step Guide, at the KDE Quality Team Web site. If you are compiling KDE for the first time, it is a good idea to read it, or consult it as a reference source. You will find detailed information about packaging tools and requirements, common compilation pitfalls and strategies and information about running your new KDE installation.
In addition, the KDE TechBase wiki maintains a procedure for building KDE from source code.
It is recommended that you download and build KDE using a separate user account. If you already have KDE packages installed, the best choice would be to create a different (dedicated) user to build and run the new KDE. The advantage of building KDE with a dedicated user is you can not break the base system, and you will always have a way to comfortably work when things go wrong.
Later, you can do a system installation if you wish. This document does not cover a system installation. If you are performing a system wide install, you should already know what you are doing. If not, then you may want to consult the documentation, or help sites, for your distribution in order to prepare and use the system installation correctly.
Before using the Kdesvn-build script (or any other building strategy) you must install the development tools and libraries needed for KDE. The complete list of required tools can be found from the KDE Compilation Requirements page. Requirements for the KDE 4 series may be obtained from the KDE TechBase.
Here is a list of some of the things you will need:
Automake version 1.7, or higher. (KDE 3 only)
Autoconf version 2.57, or higher. (KDE 3 only)
CMake 2.4.7, or higher.
The Subversion client program, including support for Secure
HTTP (https). To ensure needed support, you can run
svn .
If the ra_dav module says that it handles the https scheme then you should be
set to go.--version
The gcc compiler, with support for C++. Versions 3.3 or higher are the best supported.
Be sure to check the KDE Compilation Requirements page to make sure that any other needed libraries are included.
One exception is the Qt™ library. Kdesvn-build will normally install a copy of Qt™ whether you have it installed or not, so it is not necessary for you to have it. If you do not want to use the Qt™ copy, you need to do these things:
Make sure to remove the qt-copy module from your configuration file, as you will not need it, and having it would add extra time to your build.
Change the setting of the qtdir
option in your configuration file to point to your system Qt™. This is normally
equal to the setting of $QTDIR for your system.
If you do not already have Qt™ installed, install it, including any relevant -dev or -devel packages. You will need at least Qt™ 3.3 if you are building KDE 3.5, or Qt™ 4.3 if you are building KDE 4.
If you are building KDE 4 it is highly recommended to use the qt-copy version of Qt™, making sure to apply recommended patches (this is the default setting, controlled by the apply-qt-patches option).
Some of these packages are divided into libraries (or programs or utilities), and development packages. You will need at least the program or library and its development package. If in doubt, install all. The libraries you need will change depending on the modules you intend to build, as each module has its own requirements. The Building KDE from Source Step by Step Guide has more details about the specific tools and techniques used to install and find the required software.
You probably already have a version of the Kdesvn-build script installed in your system. However, if you do not, you can download it from Kdesvn-build home page, or you can find it from its home in the KDE source repository.
Kdesvn-build is included with the kdesdk module, and the module is often installed by distributions already. If you have downloaded Kdesvn-build ensure that you are using the version you downloaded. You can use the --version option to be sure you are running the version you think you are.
To download Kdesvn-build from its home page, simply go to the
Kdesvn-build home page and download the latest appropriate release. The release is
packaged as a compressed tarball archive, which you can extract using Ark or
tar. The contents of the archive include the actual
Kdesvn-build script, and a sample configuration file
(kdesvn-buildrc-sample).
Or, you can obtain Kdesvn-build from its source repository,
located at: http://websvn.kde.org/trunk/KDE/kdesdk/scripts/.
This is the KDE Software Development Kit scripting directory, which is the
home of Kdesvn-build. You can click on the kdesvn-build entry which will
bring you to a page where you can download the latest revision. Do so, and
save it to a convenient spot on your hard disk. Do the same for kdesvn-buildrc-sample
if you need to.
No matter which technique you use, you need to make sure that the
kdesvn-build file is executable. For convenience you
should make sure it is in a directory contained in the PATH
environment variable, otherwise you may get messages saying that the command
was not found, or you may run a previously-installed version by mistake.
Although Kdesvn-build does not require you to create a configuration file, it makes the work flow much easier. Using a configuration file, you can control which modules are installed, or remove modules you do not want to install. Kdesvn-build by default installs a useful KDE installation using very generic installation flags, which may be different from your needs. So it is best to use a configuration file.
The configuration file should be called .kdesvn-buildrc.
This file should be installed on
the home folder (~/), and contain all configuration data
required for the script to run, like configuration options,
compiling options, location of the sources, the destination of the installation
(prefix), the modules that should be built, etc.. The default configuration
data is provided by the kdesvn-buildrc-sample file, which
you can copy over as ~/.kdesvn-buildrc and then edit.
You can find more information about the syntax of the configuration file in the section called “Setting the Configuration Data” and in Chapter 4, The Format of .kdesvn-buildrc.
Would you like to make a comment or contribute an update to this page?
Send feedback to the KDE Docs Team