Develop KDE Software That’s Shipped on the OS Image
This workflow is used for developing KDE software that’s shipped on the base system — or even Qt.
A list of such software can be found here (note that “workspace” includes Plasma, KWin, and Plasma-aligned apps such as System Settings and Discover).
The best way to do this is by using systemd-sysext, which allows overlaying built-from-source content on top of /usr/ without impacting the base system.
Setup
Run the setup script:
set-up-system-development
Use
In a nutshell, you’ll compile and install software using kde-builder, then refresh the systemd extension, and then finally restart any services that you changed (e.g. Plasma), or the entire system.
For example, to compile and test a change to plasma-pa, do the following:
kde-builder plasma-pa run0 systemd-sysext refresh --always-refresh=yes systemctl restart --user plasma-plasmashell.service
If you replace a core system component and find that everything is crashing after the refresh is applied, try rebooting in order to fully reload the new dependency in all running software.
When you’re finished developing or testing the change, disable (“un-merge”) the system extension:
run0 systemd-sysext unmerge
When you’re done with your built-from-source software (e.g. because it was accepted as a patch and merged), delete the installed files:
rm -r ~/kde/usr/* # When you’re prompted to delete the read-only extension-release.kde file, answer 'n'
Article contributed by Nate Graham under the CC-BY-4.0 license.