KDEConnect/Build kdesrc-build

Set up environment

Install kdesrc-build

kdesrc-build is a tool that allows you to easily build KDE software using its source repos.

  1. Call the following commands in a Terminal window: -
    mkdir -p ~/kde/src
    cd ~/kde/src/
  2. The development version of kdesrc-build is currently recommended, and can be downloaded from KDE's git server by running: -
    git clone https://invent.kde.org/sdk/kdesrc-build.git && cd kdesrc-build
  3. Next, it's time to set up kdesrc-build and pick up the changes it made to your ~/.bashrc for the current terminal session:
    ./kdesrc-build --initial-setup
    source ~/.bashrc
  4. To be sure you are up to speed up to this point, run the following bunch of commands: -
    cd $HOME
    kdesrc-build -v

You should get something like the following as output: -
kdesrc-build xx.xx (...)

Congrats! you have set up kdesrc-build.

  • Now, run the following to have kdesrc-build download the latest information about KDE repositories:
kdesrc-build --metadata-only
  • To see what kdesrc-build would do for a given command, without really doing any changes to your system:
kdesrc-build --pretend

Build kdeconnect-kde from latest source code

To build kdeconnect-kde out of the source code, use the following command.: -

kdesrc-build --include-dependencies kdeconnect-kde
  • You can find the kdeconnect-kde repo in $HOME/kde/src/ once this command is done.

Test changes

If you make changes to the source code, build by running the following command:

kdesrc-build --no-include-dependencies kdeconnect-kde

Developer Recommendation

  • Add this to your $HOME/.bashrc file:
## Update shell environment to prefer programs installed by kdesrc-build

function source-kdesrc
  PS1="\[\033[01;33m\]  ! !  K D E S R C - T E S T - M O D E  ! ! \n$PS1"
  source "$HOME/kde/build/network/kdeconnect-kde/prefix.sh"
  export PATH="$HOME/kde/usr/lib/libexec/:$PATH"

Once this is triggered, the environment will be updated to prefer kdesrc-build versions of any built programs (for eg: kdeconnect-kde).

Once you have this, whenever the build process is successful, run the following command to switch the shell environment to testing mode:


Now, run the relevant executable from the terminal. Confirm which executable would be triggered by using the which command.

which kdeconnectd

You should get something like the following as output: -


We are only human! There are many doubts that we face commonly, during DevSprints and during the onboarding of new contributors. We want to expedite this process for you by enlisting all the commonly asked questions in one place so you don't have to ask around like others had to!

  1. How can I contact the KDE Connect team? I'd like to talk to the team about an issue/ suggestion.

Be sure to let us know in case you get stuck somewhere while setting up the dev environment. You can mail us. Yes we read and reply to the mails!

This page was last edited on 20 July 2021, at 02:36. Content is available under Creative Commons License SA 4.0 unless otherwise noted.