Get Involved/development

By joining the ranks of KDE developers, you will get to implement new features and defeat bugs both daunting and simple, all while collaborating to make coherent and stable releases. Developers collaborate in teams based on what area they are working in. These can be small teams working on a single application, up to large teams working on a group of related pieces of software. Many developers are in more than one team.

KDE runs or participates in several mentoring programs to help new developers, including an informal list of people who are willing to help newcomers get started. See the Mentoring page for more details.

Information

While any operating system can be used to patch or develop KDE software, it's easiest if you use a Linux distribution that provides relatively recent versions of Qt and KDE Frameworks, such as KDE Neon, openSUSE Tumbleweed, Arch/Antergos/Manjaro, Fedora, or non-LTS versions of Ubuntu.

Support for distros that ship older software (such as Debian, Ubuntu/Kubuntu 18.04, and openSUSE Leap 15) is still experimental and you may have a better experience developing with KDE Neon Developer Edition in a virtual machine.

New to C++/Qt software development?

Most KDE software is written in C++ using the Qt toolkit and KDE Frameworks. Though prior experience with these technologies or other programming languages is helpful, you don't need to be a C++ programmer to get started! For example, no programming knowledge whatsoever is required to do things like improve text labels.

One-time setup: your development environment

To build software, you need a development environment: a set of tools that allows you to access and edit the source code, compile it into a form that the computer can run, and deploy it to a safe location. We will now go through the process of setting one up. To accomplish these tasks, you will need to enter commands using a terminal program, such as KDE's Konsole (but any terminal program will suffice).

If you're not familiar with the command line interface, you can find a reasonable tutorial here. However advanced command-line skills are not required, and you will learn what you need along the way!

Note

Everything in this section only needs to be done once. Once you've done it, your development environment is set up and you can use it to submit patches and develop KDE Software!

Install basic tools

First you will need to use your operating system's package manager to install some basic tools:

Arch/Antergos/Manjaro: sudo pacman -S git cmake dialog

Fedora: sudo dnf install git cmake dialog perl

KDE Neon/Kubuntu/Ubuntu/Debian: sudo apt install git cmake dialog

openSUSE Leap & Tumbleweed: sudo zypper install git cmake dialog

Some operating systems also require that you turn on the source repositories before you can install build dependencies (more about that later). Do that now, if necessary:

The name you provide should be your actual name, not your KDE Identity username.

The email address you specify above must be the same as the email address used for your https://bugs.kde.org account. If they don't match, then the BUG: and FEATURE: keywords won't work (see this page for more information).

Now we will set up a Git prefix to make it easier to interact with KDE's remote Git repositories. Use a text editor to open the ~/.gitconfig file and add the following:

Then save the file and close it. This essentially tells Git to accept "kde:" in place of "https://anongit.kde.org/", which allows us to check out repositories more easily, as we will soon see.

Set up kdesrc-build

Next, we need a method of managing dependencies. Every software has dependencies: other pieces of software that provide the functionality they rely on. In order to compile any piece of software, its dependencies must be available.

Most Linux-based operating systems do not provide development packages that are up-to-date enough for working on KDE software, so we will compile all the KDE dependencies ourselves. To do this, we use a command-line tool called kdesrc-build to download, manage, and build KDE source code repositories. Let's set it up now:

mkdir -p ~/kde/src
cd ~/kde/src/
git clone kde:kdesrc-build

Notice how we're using the "kde:" prefix in our git clone command!

We want to add kdesrc-build to your system's $PATH variable so you can access it from anywhere, not just when you're inside ~/kde/src/kdesrc-build. Use a text editor to open the ~/.bashrc file and add export PATH=~/kde/src/kdesrc-build:$PATH. Then save the file, close it, and run source ~/.bashrc to pick up the changes.

Next, set up kdesrc-build using its built-in wizard. The default options should be ok, but feel free to customize anything:

kdesrc-build --initial-setup

Note

Do not quote or escape any file paths entered in the wizard!

This command does two things. First, it tries to install the basic packages for compiling Qt and KDE software on your distro. Second, it creates a the ~/.kdesrc-buildrc configuration file. By default, kdesrc-build will build all the dependencies that a program or framework needs, down to Qt. If you don't want this to be the default behavior, edit the configuration file and set include-dependencies to false.

If your Linux distribution provides a recent version of Qt (>= 5.11), you don't need to build Qt yourself, saving you time and disk space. Simply comment out the qtdir and two include lines related to qt5 in that same configuration file.

If you want a more guided setup process for kdersc-build, run the command <code<>kdesrc-build-setup</code> instead. However, unlike --initial-setup, it won't install packages from your distro for compiling programs so you will have to do that yourself. Please consult the kdesrc-build manual for more information and options in using the tool.

Download non-KDE dependencies

Even though kdesrc-build will take care of the KDE dependencies for you, it does not yet have the ability to install non-KDE dependencies (see https://bugs.kde.org/show_bug.cgi?id=402428), which are typically acquired using your package manager. To install the required non-KDE dependencies, read this page and follow the instructions laid out there.

Once that's done, your development environment is set up and ready to build software! Let's take it for a spin.

Build some software

Note

It can take an hour or more to compile a KDE Application, Framework, or Plasma itself for the first time. The reason for this is that kdesrc-build is compiling all of the KDE dependencies (See https://invent.kde.org/kde/kdesrc-build/issues/17). The next time you want to compile that or any other piece of KDE software, it will be much faster since most of the dependencies will have already been compiled.

Applications

KDE Applications like Dolphin, Okular, Konsole and Gwenview are standalone apps that can be run on multiple platforms, such as Plasma, GNOME, even macOS and Windows! New versions of KDE Applications are released three times a year. Note that the Discover app store (git repo name: plasma-discover) and System Settings app (git repo name: systemsettings) are distributed alongside Plasma, but they build like apps app using the below instructions. A list of all KDE applications can be found here: https://userbase.kde.org/Applications.

For example, here is how to build Dolphin, the KDE file manager:

kdesrc-build dolphin --include-dependencies

As a part of this process, Dolphin was installed to ~/kde/usr/bin/dolphin. There is no need to manually install anything;kdesrc-build installed it for you! Source the project's auto-generated prefix.sh file every time you want to run your custom-compiled version of Dolphin:

source ~/kde/build/dolphin/prefix.sh
~/kde/usr/bin/dolphin

Did it run? If so, then congratulations, you just compiled your own version of Dolphin from source code!

Now you can run an existing app using your custom-made version of the framework! For example, the following will run Dolphin, but it will be using the KIO library that you just built:

source ~/kde/build/kio/prefix.sh
~/kde/usr/bin/dolphin

Plasma

KDE Plasma is the environment in which you can run apps. Plasma is responsible for providing a desktop with wallpaper, app launchers, and widgets; displaying notifications; managing wired and wireless networks; and similar operating-system level tasks. New versions of Plasma are released three times a year.

Here is how to build the Plasma desktop environment and its window manager, KWin:

How to solve build problems

Did one or more modules fail to build (displayed in red font) using kdesrc-build? Here's what to do:

Try building the failing module again from scratch using kdesrc-build [failing module] --refresh-build

Make sure that you have all the dependencies for the failing module. Go back to the #Download non-KDE dependencies section and re-install the non-KDE dependencies. If that doesn't fix the problem. Open the log file for the failing module, which kdesrc-build will print the path at the end of its output. Scroll to the bottom of the log file and read the output to see what missing dependency it is complaining about, then find and install the corresponding package using your distro's package manager your distro. If several looks relevant, install them all just to be safe.

Choose what to do

Now that you can compile and deploy custom versions of KDE software, you can open your editor and start hacking on the source code! The code for the version of Dolphin that you built earlier is located at ~/kde/src/dolphin/; other projects you build with kdesrc-build will live in similar locations.

A good place to start is with a small bug or feature in an existing piece of software that affects you personally ("scratch your own itch"). Get in touch with the existing developers (see Communicate with the team, below) and they can help you out, by pointing you to the right place in the code and giving advice about how to tackle the problem.

Try not to start by proposing or working on major features or significant design changes. These can be controversial, and the smoothest way to get going is by working on relatively non-controversial bugfixes. Start slowly and build trust!

Here are some other ideas for starting points:

Improve awkwardly-worded messages and labels that are written in English. This is a great way for non-programmers to contribute! If you can compile software and have a good grasp of English, you can make a big difference here.

Work on Junior Jobs, which are small tasks that are suitable for beginners (both bugs and features).

The English Breakfast Network searches out simple, common issues in code that should be fixed, and going through the problems on there can provide a good overview of the code.

Test your changes

Once you've made some changes, make sure the project still compiles and installs, and make sure the changes have the desired effect when you run the software. Then it's time to run the project's unit tests:

cd ~/kde/build/dolphin/
source ./prefix.sh
ctest --output-on-failure

If any test fails, that needs to be investigated and fixed before you can proceed. Once the tests pass, then run the software again to make sure it still behaves properly. If it doesn't, then go back and work on your patch some more, then re-compile and re-deploy, and test again, until the program does what you'd like it to do and all tests pass.

Submit a patch

Once you're happy with your patch and have verified that it does what you want, it's time to generate a diff. A diff is a textual representation of the differences between original versions of the files you changed, and the new ones you've produced. You can generate a diff by entering the source repository and running git diff, but we recommend using the arc tool, which will generate a diff and submit it for review very quickly and easily! You can learn how to set it up here.

These are general KDE development communication channels, and you may get directed to a more appropriate place for the project you are interested in. There is a list of mailing lists if you want to find a mailing list for a specific team directly. Many teams have their own real-time chat channels, too.

You can also try looking for the team's section on the Main Page of this wiki. Many teams have information there for new contributors.

Next steps

After you have had several drama-free patches accepted, a KDE developer is likely to suggest you get a Developer account, which will allow you to commit directly to KDE projects. With very few limits on where you can commit, you will be expected to act responsibly. At this point, congratulations! You are officially a KDE developer!