Kde-builder on KDE neon from scratch -- instructions that Just Work, june 2024

I wanted to start hacking my favourite KDE applications, so I got a KDE Neon image and started playing with it. After spending some time figuring it out, here are my instructions, in case anyone else needs.

Running KDE Neon in a VM

  1. Download the KDE Neon Developer Edition, at this point the version from 2024-05-27-16:04

  2. Install and launch Oracle VirtualBox. Make sure to:
    a. allocate enough have disk space for the VM. Building dolphin will occupy 12 Gb.
    b. Include enough CPU cores, it’s the maximum number of cores that the VM is allowed to use when it needs them.
    c. I had to enable 3D acceleration in the display options to make it boot.

  3. Launch KDE Neon.

Terminal commands

From a Konsole, enter the following commands

sudo apt update
sudo apt install git
mkdir -p ~/kde/kde-builder
curl 'https://invent.kde.org/sdk/kde-builder/-/raw/master/scripts/initial_setup.sh?ref_type=heads' > ~/kde/kde-builder/initial_setup.sh
echo 'PATH="$PATH:/home/neon/.local/bin"' >> /home/neon/.bashrc
source /home/neon/.bashrc
bash /home/neon/kde/kde-builder/initial_setup.sh
kde-builder --generate-config
sed -i -e "s/stop-on-failure true/stop-on-failure false/" ~/.config/kdesrc-buildrc
kde-builder --install-distro-packages

Notes:

  • apt update is necessary, otherwise apt install git will return errors due to IPs that do not exist anymore.
  • We change stop-on-failure to false such that it does not fail on some optional dependency.

Building a module

kde-builder dolphin
kde-builder --run dolphin

Note:

  • For most modules, it is compulsory to run the compiled code through kde-builder --run such that the correct libraries are called.

The code is in /home/neon/kde/src/. I’m now out correcting some bugs!

If your hardware computer’s operating system is Linux not Windows. Then you can use virt-manager/QEMU/KVM instead of Oracle VM VirtualBox. The QEMU virtual machine will be significantly faster and more performant. Instructions https://www.youtube.com/watch?v=dNZ19qO5f6M

1 Like

Thanks for the guide!

Two suggestions:

echo 'PATH="$PATH:/home/neon/.local/bin"' >> /home/neon/.bashrc

This is not necessary (and will add it to the path twice, I think). Neon automatically adds .local/bin to the path if it exists, but only in .profile which is run at session start. You can just log out and log in again.

echo 'PATH="$PATH:/home/neon/.local/bin"' >> /home/neon/.bashrc
source /home/neon/.bashrc
bash /home/neon/kde/kde-builder/initial_setup.sh

These have “neon” hardcoded as the username; replace /home/neon/ with ~/ to also work for installations that have a different username set up.