It would be nice if kdesrc-build could be configured and used to setup common env variables needed at runtime, like for example these ones export XDG_DATA_DIRS=$KF5/share:$XDG_DATA_DIRS:/usr/share export XDG_CONFIG_DIRS=$KF5/etc/xdg:$XDG_CONFIG_DIRS:/etc/xdg export PATH=$KF5/bin:$QTDIR/bin:$PATH export QT_PLUGIN_PATH=$KF5/lib/plugins:$KF5/lib64/plugins:$KF5/lib/x86_64-linux-gnu/plugins:$QTDIR/plugins:$QT_PLUGIN_PATH export QML2_IMPORT_PATH=$KF5/lib/qml:$KF5/lib64/qml:$KF5/lib/x86_64-linux-gnu/qml:$QTDIR/qml export QML_IMPORT_PATH=$QML2_IMPORT_PATH export KDE_SESSION_VERSION=5 export KDE_FULL_SESSION=true export SASL_PATH=/usr/lib/sasl2:$KF5/lib/sasl2 KDEHOME=$DEV_ROOT/home-dir export XDG_DATA_HOME=$KDEHOME/.local/share export XDG_CONFIG_HOME=$KDEHOME/.config export XDG_CACHE_HOME=$KDEHOME/.cache export QT_MESSAGE_PATTERN='%{appname}(%{pid})/%{category} %{function}: %{message}' And then show a bash prompt indicator that the environment was modified by kdesrc-build. This way, not every new developer has to find his/her own way of setting up these common variables and the default ones could be maintained centrally.
This type of thing is what the "install-session-driver" kdesrc-buildrc option [1] is meant for. It uses a couple of files in the kdesrc-build source as a template for bash shell environment variables (although meant for the specific purpose of launching a Plasma session). It's still sort of buggy in my experience though, I've run into scenarios where kdesrc-build warns me that it's overwriting my customizations even though the .xsession and related files are as they were created by kdesrc-build It would be easy enough to take this existing feature to support the use case you mention, I think. [1] https://docs.kde.org/trunk5/en/extragear-utils/kdesrc-build/conf-options-table.html#conf-install-session-driver
extra-cmake-modules now automatically installs a prefix.sh file on every build that does a lot of this stuff automatically. Is there anything left for kdesrc-build to do?
For KF5/Plasma/KDE apps, no. But kdesrc-build can be used outside of KDE context (including for Qt-based dependencies that don't use extra-cmake-modules, like taglib, qjson or grantlee). Notionally things can also be more complicated than would be supported by a single repository's prefix.sh (e.g. having some apps install into their own prefix, you'd want a single PATH= entry that fixes this for all the prefixes). On the other hand I'd be in absolutely no rush to support this kind of use case. But we'd still need to potentially support cases that fall outside a single prefix.sh. After all, which prefix.sh would we pick? The plasma-desktop one for users running Plasma 5 perhaps, but if you just built dolphin for testing you'd want the dolphin one instead, I think. Perhaps it's easy to automagically guess the proper prefix.sh though?
If you run `kdesrc-build <thing>` then kdesrc-build compiles ~/kde/build/kde/<category>/<thing>, and as a part of that build process, ~/kde/build/kde/<category>/<thing>/prefix.sh was created. If that file exists, it would seem reasonable to source it before terminating.
They are sourced with --run option.