Building KDE Frameworks 5 (KF5)

KDE Frameworks 5 is a collection of libraries based on top of Qt5 and QML derived from the monolithic KDE 4 libraries. They can be used independent of the KDE Display Environment (Plasma 5).

This package is known to build and work properly using an LFS-9.1 platform.

The instructions below build all of the KDE Frameworks packages in one step by using a bash script.

Package Information

KF5 Dependencies


Boost-1.72.0, extra-cmake-modules-5.67.0, docbook-xml-4.5, docbook-xsl-1.79.2, giflib-5.2.1, libepoxy-1.5.4, libgcrypt-1.8.5, libjpeg-turbo-2.0.4, libpng-1.6.37, libxslt-1.1.34, lmdb-0.9.24, phonon-4.11.1, shared-mime-info-1.15, URI-1.76, and Wget-1.20.3 (required to download the packages)



BlueZ-5.53 (needed to build Bluez-Qt), ModemManager-1.12.6 (needed to build ModemManager-Qt)

Runtime dependency for FrameworkIntegration

Oxygen fonts and Noto fonts

Runtime dependencies for kapidox

Doxygen-1.8.17, Jinja2-2.11.1, and PyYAML-5.3

Additional image formats support in KImageFormats

JasPer-2.0.14 and OpenEXR

Optional dependencies for KIO

MIT Kerberos V5-1.18

Optional dependencies for Solid

UDisks-2.8.4, UPower-0.99.11 and media-player-info (runtime)

Optional dependency for KWallet


Optional dictionary backends for Sonnet

Hspell and Hunspell

Required dependencies for Prison

Datamatrix and QRencode

User Notes:

Downloading KDE Frameworks

The easiest way to get the KDE Frameworks packages is to use a single wget to fetch them all at once:

wget -r -nH -nd -A '*.xz' -np $url

The options used here are:
  -r            recurse through child directories
  -nH           disable generation of host-prefixed directories
  -nd           do not create a hierarchy of directories 
  -A '*.xz'     just get the *.xz files
  -np           don't get parent directories

Setting Package Order

The order of building files is important due to internal dependencies. Create the list of files in the proper order as follows:

cat > frameworks-5.67.0.md5 << "EOF"
d3b975029a5b53673ea6503a2d5ae177  attica-5.67.0.tar.xz
#f59f70433adc17145b6ce2e8ab0c416d  extra-cmake-modules-5.67.0.tar.xz
d2b51d5f9a5e31ca870df0c48e4960e9  kapidox-5.67.0.tar.xz
ca01da6d4bedb8fbe9b99600f8f45ed2  karchive-5.67.0.tar.xz
080f45c31980d514774161d1b4a30ff8  kcodecs-5.67.0.tar.xz
3a40f76617827bff8e0c99b93be01fc1  kconfig-5.67.0.tar.xz
5c35270ed01148af9038e62350e51e32  kcoreaddons-5.67.0.tar.xz
818dbca1b3536e931aed3f6a4fb9d955  kdbusaddons-5.67.0.tar.xz
11c8c768748b562b928754d596b0aec6  kdnssd-5.67.0.tar.xz
96b919dfe2aedb0a5747b64216c95fff  kguiaddons-5.67.0.tar.xz
e6a5226f42a3cc444938fb80a7463ab4  ki18n-5.67.0.tar.xz
8049864248f5ab73af529140a10b0386  kidletime-5.67.0.tar.xz
3d17d70e54a82063c032ee9efee45874  kimageformats-5.67.0.tar.xz
588eba3b0ff5768e5aeda6dd0dcdfc29  kitemmodels-5.67.0.tar.xz
76990691b3c57e9c02c5da55144764a4  kitemviews-5.67.0.tar.xz
3242e4364f2f21980f208c1685019fd0  kplotting-5.67.0.tar.xz
9616a12c63a1c65562e7f5b5fcb29e07  kwidgetsaddons-5.67.0.tar.xz
b1d0b95573ff7cfe1ff4d468e7f9fed6  kwindowsystem-5.67.0.tar.xz
00b66a3798bf1abb074b4147ee0e5b7c  networkmanager-qt-5.67.0.tar.xz
0598657737a55b535d4bb0dbb9bba889  solid-5.67.0.tar.xz
37f09137396721abad617571464b9d9a  sonnet-5.67.0.tar.xz
8ee447185a4e603cc409ee4218cee195  threadweaver-5.67.0.tar.xz
8677547f35f4d4720d41325fbd3a6336  kauth-5.67.0.tar.xz
eb09a60dd4b5753e2aeaa8087efa4bb4  kcompletion-5.67.0.tar.xz
bfaeba1fad5c8440e37f145b011cf03e  kcrash-5.67.0.tar.xz
6f9879d824b265096b8384ab5061ccca  kdoctools-5.67.0.tar.xz
4add397011f28a5a08c363f0a5d2ad60  kpty-5.67.0.tar.xz
dc0bf58b6239d93e8d65b6a635256fd1  kunitconversion-5.67.0.tar.xz
f00cf13031ae84283c16b56c400a51f7  kconfigwidgets-5.67.0.tar.xz
290466bdeddfc2c04c5a872a773d974d  kservice-5.67.0.tar.xz
b688a1639bc9497fb3787f9d93950bda  kglobalaccel-5.67.0.tar.xz
6bf9110d2c3746fdf0c70cc8451c3596  kpackage-5.67.0.tar.xz
a4d9df054c4f7d4672be9f12596d877e  kdesu-5.67.0.tar.xz
6a806ed9f1854c24dcaf653c7f91511e  kemoticons-5.67.0.tar.xz
fd90eda4d83598fefb87db83463cca1f  kiconthemes-5.67.0.tar.xz
3a8533dcb22764c9f80eb9957d530170  kjobwidgets-5.67.0.tar.xz
37d8e17a44cca54f8e937bd1b80231d3  knotifications-5.67.0.tar.xz
fe7fefbc23ca7eef85f95cbc54f193b3  ktextwidgets-5.67.0.tar.xz
4565a3d1f277653e41310a3ae26dcc1e  kxmlgui-5.67.0.tar.xz
1236b6fd559c9ac85e5c7d82fe5bbb02  kbookmarks-5.67.0.tar.xz
895e560a0b748dbb007ff45ec71ce85d  kwallet-5.67.0.tar.xz
b3cd883d9892f47dfbb7b2c29be0ff1b  kio-5.67.0.tar.xz
5f491d1b51cbafefff0d502c2818a1c9  kdeclarative-5.67.0.tar.xz
3fd40a72390912440c06289b5a17faa8  kcmutils-5.67.0.tar.xz
f9077200aa86833705a7f4250d61c0e6  kirigami2-5.67.0.tar.xz
0033e888f61c2f257e6e6f4a2011a976  knewstuff-5.67.0.tar.xz
6dc5c1e55e8ca4cc19e6faa8719b9cc4  frameworkintegration-5.67.0.tar.xz
646771a2d35f1af7c5d0f4cfb3f80179  kinit-5.67.0.tar.xz
6e43a6a6cf0a60eb8f31269834795fc4  knotifyconfig-5.67.0.tar.xz
cc3125f7ae87b52e62571040749a4732  kparts-5.67.0.tar.xz
37a1c1995cd80c8c5d53de70f9fe61ed  kactivities-5.67.0.tar.xz
5857f91c556d03fa6178ddc7d2d6a3dd  kded-5.67.0.tar.xz
#a447900424cd04dbaf49e8bf9617f6dc  kdewebkit-5.67.0.tar.xz
91319edc9d27393df6812d60f1505b99  syntax-highlighting-5.67.0.tar.xz
de9f38ec3ad76a5f19b4fc665dee5b82  ktexteditor-5.67.0.tar.xz
923482f22930286d7f99af334c3a2181  kdesignerplugin-5.67.0.tar.xz
5141cdc1fcd46d43ac0043c10112be2b  kwayland-5.67.0.tar.xz
5203954a541766bd0def96fe2ddc1d05  plasma-framework-5.67.0.tar.xz
#f7b27e1fb53fbf7ccc3fabb3469b2ac3  modemmanager-qt-5.67.0.tar.xz
aa74dc95497e27a322668df02c21ba6f  kpeople-5.67.0.tar.xz
604ee822d3c31c025ea90a64692db277  kxmlrpcclient-5.67.0.tar.xz
4bf38a4919ea975deb71197c57a8edf0  bluez-qt-5.67.0.tar.xz
6fa27bb4fb5e3a08bc58b6d67e4ca396  kfilemetadata-5.67.0.tar.xz
05d339861c1b9082dc7b8f4822167954  baloo-5.67.0.tar.xz
#18d27b2f7d443a6e7e4fdc41a3fb9ae4  breeze-icons-5.67.0.tar.xz
#4d74544c61cb1db49a6b10da6835ec88  oxygen-icons5-5.67.0.tar.xz
b89c11f239048e4d65b4781fbc660a41  kactivities-stats-5.67.0.tar.xz
9da490e8e8ccfed43206d18a176019f8  krunner-5.67.0.tar.xz
#181d901dbda09ee7d26fd234eef56ed4  prison-5.67.0.tar.xz
46b9c80d3ef84a26803d47fc57426158  qqc2-desktop-style-5.67.0.tar.xz
b8352b2a459df37ac5fc8b5be5674d08  kjs-5.67.0.tar.xz
aa5d6287fdae772c72ac15bb56315e53  kdelibs4support-5.67.0.tar.xz
8c4ec0e9a3ac90622c64ecc0e3329d91  khtml-5.67.0.tar.xz
10163d7d799db8cc90afcb7f2acb89d8  kjsembed-5.67.0.tar.xz
88c78b268916199328c381de5d65020b  kmediaplayer-5.67.0.tar.xz
46ded68727de15c4d66ce29b4bb15831  kross-5.67.0.tar.xz
3d1831377c10ca2f90a5edd133501f84  kholidays-5.67.0.tar.xz
4039367834bc9039a84261b5a8d9912c  purpose-5.67.0.tar.xz
59240be3b390227198e8d94f5ae87fe8  syndication-5.67.0.tar.xz
91aadb3a165ac2ec1f5ab01f523bdeed  kcalendarcore-5.67.0.tar.xz
a8f99a97898c0489577204f219c7a5a3  kcontacts-5.67.0.tar.xz
b07cef12653a85091fadd25260942cf6  kquickcharts-5.67.0.tar.xz

In the above list, notice that some files have been commented out with a hash (#) character. The extra-cmake-modules entry has been commented out because it was built earlier in the Introduction to KDE. The icon packages are covered separately at breeze-icons-5.67.0 and oxygen-icons5-5.67.0. The modemmanager-qt package may be built if its optional dependency has been installed. The prison package (bar code reader) may be built if the required external libraries are installed. The kdewebkit may be built if the external package QtWebkit has been built.

Installation of KDE Frameworks



When installing multiple packages in a script, the installation needs to be done as the root user. There are three general options that can be used to do this:

  1. Run the entire script as the root user (not recommended).

  2. Use the sudo command from the Sudo-1.8.31 package.

  3. Use su -c "command arguments" (quotes required) which will ask for the root password for every iteration of the loop.

One way to handle this situation is to create a short bash function that automatically selects the appropriate method. Once the command is set in the environment, it does not need to be set again.

  if   [ $EUID = 0 ];        then $*
  elif [ -x /usr/bin/sudo ]; then sudo $*
  else                            su -c \\"$*\\"

export -f as_root


If installing in /opt and there is an existing /opt/kf5 either as a regular directory or a symbolic link, it should be reinitialized (as root):

mv -v /opt/kf5 /opt/kf5.old                         &&
install -v -dm755           $KF5_PREFIX/{etc,share} &&
ln -sfv /etc/dbus-1         $KF5_PREFIX/etc         &&
ln -sfv /usr/share/dbus-1   $KF5_PREFIX/share

First, start a subshell that will exit on error:

bash -e

Install all of the packages by running the following commands:

while read -r line; do

    # Get the file name, ignoring comments and blank lines
    if $(echo $line | grep -E -q '^ *$|^#' ); then continue; fi
    file=$(echo $line | cut -d" " -f2)

    pkg=$(echo $file|sed 's|^.*/||')          # Remove directory
    packagedir=$(echo $pkg|sed 's|\.tar.*||') # Package directory

    name=$(echo $pkg|sed 's|-5.*$||') # Isolate package name

    tar -xf $file
    pushd $packagedir

      case $name in
        kitemviews*) sed -i '/<QList>/a #include <QPersistentModelIndex>' \
          src/kwidgetitemdelegatepool_p.h ;;
        kplotting*) sed -i '/<QHash>/a #include <QHelpEvent>' \
          src/kplotwidget.cpp ;;
        knotifica*) sed -i '/<QUrl>/a #include <QVariant>' \
          src/knotification.h ;;
        kcompleti*) sed -i '/<QClipboard>/a #include <QKeyEvent>' \
          src/klineedit.cpp ;;
        kwayland*) sed -i '/<wayland-xdg-output-server-proto/a #include <QHash>' \
          src/server/xdgoutput_interface.cpp ;;

      mkdir build
      cd    build

            -DCMAKE_PREFIX_PATH=$QT5DIR        \
            -DCMAKE_BUILD_TYPE=Release         \
            -DBUILD_TESTING=OFF                \
            -Wno-dev ..
      as_root make install

  as_root rm -rf $packagedir
  as_root /sbin/ldconfig

done < frameworks-5.67.0.md5



Any modules that have been omitted can be installed later by using the same mkdir build; cd build; cmake; make; make install procedure as above.

Sometimes the installation paths are hardcoded into installed files. If the installed directory is not /usr, rename the directory and create a symlink:

mv -v /opt/kf5 /opt/kf5-5.67.0
ln -sfvn kf5-5.67.0 /opt/kf5

Command Explanations

case ...: Those modifications are required to build with Qt-5.14.1.

-DCMAKE_PREFIX_PATH=$QT5DIR: This switch is used to allow cmake to find the proper Qt libraries.

-DCMAKE_BUILD_TYPE=Release: This switch is used to apply higher level of the compiler optimizations.

-DBUILD_TESTING=OFF: This switch is used to prevent building test programs and libraries that are of no use to an end user.


Installed Programs: There are 48 programs installed in /opt/kf5/bin.
Installed Libraries: There are too many kf5 libraries (191) to list separately.
Installed Directories: /opt/kf5 (symlink to /opt/kf5-5.67.0)

Short Descriptions


is a tool to check for syntax errors in KDE DocBook XML files.


is a tool to generate a dependency diagram.


is a tool to generate a dependency diagram for all frameworks at once.


is a tool to prepare dot files.


is a tool to convert a .desktop file to a .json file.


is the KDE Plasma Workspace Activity Manager.


rebuilds the KService desktop file system configuration cache.


is a command line interface to the HTTP cookie store used by KDE, a D-BUS service to store/retrieve/clean cookies.


consolidates several small services in one process.


is a process launcher somewhat similar to the famous init used for booting UNIX.


is a command line program used to retrieve information about KDE installation or user paths.


executes kross scripts written in KDE Javascript, Python, Ruby, Java and Falcon.


is a tool to generate API documentation in the KDE style.


generates widget plugins for Qt(TM) Designer.


is a daemon use to register the key bindings and for getting notified when the action triggered.


is KDE ECMAScript/JavaScript engine.


is a tool for launching KJSEmbed scripts from the command line.


is a console for kjs5.


is a mail service.


is a commandline tool for launching kpackage QML application


is a command line kpackage tool.


is a command line tool to retrieve values from KDE configuration files.


start applications via kdeinit.


is a telnet service.


is a helper program to handle the KDE trash can.


is the wallet manager daemon.


is a command line tool to write values in KDE configuration files.


converts DocBook files to HTML.


is a tool to install, list, remove Plasma packages


is a script to extract the text from a tips file.


is a command line tool to investigate available devices.

Last updated on 2020-02-19 16:36:21 -0800