KDE Frameworks 5 Pre-installation Configuration

If you have installed Polkit and are installing KDE in /opt/kf5 then you should run ln -sfv /usr/share/polkit-1 $KF5_PREFIX/share


Kf5 ('frameworks') is the basis of kde-5.

If you intend to build plasma (the desktop environment), most of these packages will be required.

possible omissions

A few comments on things which can (or cannot) be omitted


As of 5.14.0 nothing in the release uses this, which is why the optional Python runtime deps are not in the book.


Although this is recommended as the backend for kdnssd, if you are not going to use zeroconf then you do not need it.


If you are going to build plasma, this (and networkmanager-qt) is required.


You can omit this, and therefore bluez, if you are not using bluetooth.


Not required if you do not use a modem.


The desktop clock in plasma requires that /etc/localtime is a symlink : if it is a file, the clock will be wrong. For LFS (sysvinit) such a change was rejected, but providing /usr is not a separate filesystem you can fix this:

test -h /etc/localtime || mv -v /etc/localtime{,.orig}
ln -sv /usr/share/zoneinfo/GB /etc/localtime

obviously, change GB to whichever timezone you selected in LFS.

If you are using a desktop manager such as sddm, with qt in /opt/qt5 and both kf5 and plasma in /opt/kf5 you will need to fix up plasma.desktop to invoke a wrapper script which ensures everything can be found.

cp -v $KF5_PREFIX/share/xsessions/plasma.desktop /usr/share/xsessions/plasma.desktop

# based on
# but altered for BLFS

export QT5DIR=$QT5DIR
export kdehome=$KF5_PREFIX

echo \$PATH | grep -q kf5 || export PATH=$KF5_PREFIX/bin:\$PATH
export XDG_CONFIG_DIRS=/etc/xdg:/opt/kf5/etc/xdg
export XDG_DATA_DIRS=/usr/share:/opt/kf5/share
echo \$QT_PLUGIN_PATH | grep -q kf5 || export QT_PLUGIN_PATH=$KF5_PREFIX/lib/plugins
echo \$QML_IMPORT_PATH | grep -q kf5 || export QML_IMPORT_PATH=$KF5_PREFIX/lib/qml

echo \$PATH | grep -q qt5 || export PATH=/opt/qt5/bin:\$PATH
echo \$QT_PLUGIN_PATH | grep -q qt5 || export QT_PLUGIN_PATH=/opt/qt5/plugins:\$QT_PLUGIN_PATH
echo \$QML_IMPORT_PATH | grep -q qt5 || export QML_IMPORT_PATH=/opt/qt5/qml:\$QML_IMPORT_PATH


exec startkde

chmod +x /usr/share/xsessions/

sed -i -e 's%Exec=.*%Exec=/usr/share/xsessions/' \
       -e 's%TryExec=.*%TryExec=/usr/share/xsessions/' \


These notes were originally written for kf5-5.13 and 5.14. Now that Plasma is in the sysv book as well as the systemd book I have removed most of the comments on plasma.

A new version requires the corresponding extra-cmake-modules, after you install that, any attempt to build an older version of a kf5 package will probably fail.

static libs

*many* of the kf5 packages require libKF5XsltKde.a from kdoctools. Several packages (kjsembed, kross, kwidgetsaddons, kwin) require libQt5UiTools.a.


Last modified 22 months ago Last modified on 12/19/2021 07:26:01 PM
Note: See TracWiki for help on using the wiki.