Getting Started
In this chapter, we show how to use the to checkout modules from the repository and build them. We also provide a basic explanation of the source code 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 Build from Source article, at the Community Wiki. If you are compiling 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 installation.

Preparing the System to Build

Setup a new user account
It is recommended that you use a different user account to build, install, and run your software from, since less permissions are required, and to avoid interfering with your distribution's packages. If you already have packages installed, the best choice would be to create a different (dedicated) user to build and run the new .
Leaving your system untouched also allows you to have an emergency fallback in case a coding mistake causes your latest software build to be unusable.
You can do also setup to install to a system-wide directory (⪚ /usr/src/local) if you wish. This document does not cover this installation type, since we assume you know what you are doing.

Ensure your system is ready to build software
Before using the script (or any other building strategy) you must install the development tools and libraries needed for . The nearly complete list of required tools can be found from the Community Wiki Build Requirements page.
Here is a list of some of the things you will need:
You will need , this software is what uses to handle build-time configuration of the source code and generation of the specific build commands for your system. The required version will vary depending on what versions of software you are building (see TechBase for specifics), but with modern distributions the included with your distribution should be quite sufficient.
You must also install the source control clients needed to checkout the source code. This means you need at least the following:
The Git source control manager, which is used for all source code
Although it is not required, the Bazaar source control manager is used for a single module (libdbusmenu-qt) that is required for the libraries. Most users can install this library through their distribution packages but supports building it as well if you desire. But to build libdbusmenu-qt, you must have Bazaar installed.
The Perl scripting language is required for , some repositories, and (if you build that from source).
The Perl that comes with your distribution should be suitable (it needs to be at least Perl 5.14), but you will also need some additional modules ( will warn if they are not present):
IO::Socket::SSL
JSON::PP or JSON::XS
YAML::PP, YAML::XS, or YAML::Syck
You will need a full C++ development environment (compiler, standard library, runtime, and any required development packages). The minimum required versions vary based on the module: the Frameworks 5 collection supports the oldest compilers, while Plasma 5 and Applications tend to require more recent compilers.
The GCC 4.8 or Clang 4 compilers are the minimum recommended. Many distributions support easily installing these tools using a build-essentials package, an option to install "build dependencies" with , or similar features. The KDE Community Wiki has a page tracking recommended packages for major distributions.
You will need a build tool that actually performs the compilation steps (as generated by ). GNU Make is recommended and should be available through your package manager. does support others options, such as the build tool, which can be used by using the custom-build-command configuration file option.
Finally, you will need the appropriate libraries (including development packages) for the version of software you are building. does not officially support building 5 (the current major version), so it is recommended to use your distribution's development packages or to see the KDE Community wiki page on self-building Qt 5.
Most operating system distributions include a method of easily installing required development tools. Consult the Community Wiki page Required devel packages to see if these instructions are already available.
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.

Setup

Install
The developers make frequent changes to to keep it in sync with advances in development, including improvements to the recommended configuration, added modules, improving flags,
Because of this, we recommend obtaining directly from its source repository and then periodically updating it.
You can obtain from its source repository by running:

$ git clone https://invent.kde.org/sdk/kdesrc-build.git ~/kdesrc-build

Replace ~/kdesrc-build with the directory you would like to install to.
You can update later by running:

$ cd ~/kdesrc-build
$ git pull

We recommend adding the installation directory to your PATH environment variable, so that you can run without having to fully specify its path every time.

Prepare the configuration file
uses a configuration file to control which modules are built, where they are installed to, etc. This file is located at ~/.config/kdesrc-buildrc ($XDG_CONFIG_HOME/kdesrc-buildrc, if $XDG_CONFIG_HOME is set).
You can use kdesrc-build --generate-config in order to prepare a simple kdesrc-build configuration. You can then edit the ~/.config/kdesrc-buildrc configuration file to make any changes you see fit.

Manual setup of configuration file
You can also setup your configuration file manually, by copying the included sample configuration file kdesrc-buildrc-kf5-sample to ~/.config/kdesrc-buildrc and then editing the file. will be a useful reference for this, especially its table of configuration options.
contains many recommended configuration files to support Frameworks 5, 5, and other applications. See for information on how to use other configuration files from your own kdesrc-buildrc.
You can find more information about the syntax of the configuration file in and in .