Building (parts of) KF5, Plasma 5 and/or KDE Applications from source

For testing new versions or helping with upstream development it can be helpful to compile (parts of) KDE Frameworks 5, Plasma 5, KDE Applications including KDEPIM from source.

For that see upstream notes.

Using self-built (parts of) KF5, Plasma 5 and/or KDE Applications

I found that specifically placing the following script into ~/.config/plasma-workspace/env and chmod +x it works for me:

~/.config/plasma-workspace/env> cat                                         

export KF5=/home/kde/install
export QTDIR=/usr/lib/x86_64-linux-gnu/qt5

export PATH=$KF5/bin:$QTDIR/bin:$PATH

export QT_PLUGIN_PATH=$KF5/lib/x86_64-linux-gnu/plugins:$QTDIR/plugins:$QT_PLUGIN_PATH
export QML2_IMPORT_PATH=$KF5/lib/x86_64-linux-gnu/qml:$QTDIR/qml

export XDG_DATA_DIRS=$KF5/share:/usr/share
export XDG_CONFIG_DIRS=$KF5/etc/xdg:/etc/xdg

export LD_LIBRARY_PATH=$KF5/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH

Although in upstream Frameworks runtime setup documentation it is not recommended to set LD_LIBRARY_PATH this is what works here. It still uses the system wide libraries for anything that is not self-built. From what I gathered so far it depends on whether you want to build all parts of Plasma / KF5 / Applications yourself and on whether you want the system wide stuff to use the new self-compiled libraries. At least for me without it krunner and plasmashell crashed badly with self-built KF5 5.14+ on top of packages KF5 5.13. I only built KF5 + KDEPIM stuff.