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-10.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.75.0, extra-cmake-modules-5.79.0, docbook-xml-4.5, docbook-xsl-1.79.2, giflib-5.2.1, libepoxy-1.5.5, libgcrypt-1.9.2, libical-3.0.9, libjpeg-turbo-2.0.6, libpng-1.6.37, libxslt-1.1.34, lmdb-0.9.28, qrencode-4.1.1, phonon-4.11.1, plasma-wayland-protocols-1.1.1, shared-mime-info-2.1, URI-5.07, and Wget-1.21.1 (required to download the packages)



BlueZ-5.55 (needed to build Bluez-Qt), ModemManager-1.14.10 (needed to build ModemManager-Qt), Datamatrix (deemed recommended for Prison by upstream)

Runtime dependency for FrameworkIntegration

Oxygen fonts and Noto fonts

Runtime dependencies for kapidox

Doxygen-1.9.1, Jinja2-2.11.3, and PyYAML-5.3.1

Additional image formats support in KImageFormats

JasPer-2.0.25 and OpenEXR

Optional dependencies for KIO

MIT Kerberos V5-1.19.1

Optional dependencies for Solid

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

Optional dependency for KWallet

GPGME-1.15.1, built with C++ bindings (which is the default).

Optional dictionary backends for Sonnet

Hspell and Hunspell

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.79.0.md5 << "EOF"
2d37fbeda8a1863f49b4020094d27328  attica-5.79.0.tar.xz
#020c6267046a065ee505c9b03d1bbe56  extra-cmake-modules-5.79.0.tar.xz
b291790cba30ba5ca1a007e809c190a2  kapidox-5.79.0.tar.xz
d9f0b3edb5610f709f849d0fcbeaa6a7  karchive-5.79.0.tar.xz
a275f28db8233c408e41e086f770f703  kcodecs-5.79.0.tar.xz
0fa5b0f1e2f995242e493c9681970e3b  kconfig-5.79.0.tar.xz
048d39a0aea41c1fb52143db4d4ec588  kcoreaddons-5.79.0.tar.xz
94f13ec26cc751662ed00a2184a3a3f7  kdbusaddons-5.79.0.tar.xz
16b9f5c62c5718ba89f19753337b0d53  kdnssd-5.79.1.tar.xz
66d2801bfe21a83d48da4617f7298de0  kguiaddons-5.79.0.tar.xz
086b5b66351ffd6b9c734896b6a740f9  ki18n-5.79.0.tar.xz
e6523c6192b0a1247deb4df16490eb3e  kidletime-5.79.0.tar.xz
0408433275e69e30d282bde4d62b383f  kimageformats-5.79.0.tar.xz
0731f3adb4f88b9dd4acab7c454c8133  kitemmodels-5.79.0.tar.xz
0bae5399c32c011ab3a211200454dafd  kitemviews-5.79.0.tar.xz
b314220f88558d50c557e4a64237f08a  kplotting-5.79.0.tar.xz
b67544527fcc3c8a38cc14813da45290  kwidgetsaddons-5.79.0.tar.xz
61e99965def3149523d985361daeeeb5  kwindowsystem-5.79.0.tar.xz
8925ca98dfe1ded943ccb7b67ab22d99  networkmanager-qt-5.79.0.tar.xz
dd47932e6d4cf3165f92656cf0331699  solid-5.79.0.tar.xz
e564b71d2bf7f017890beca4a123c89b  sonnet-5.79.0.tar.xz
8f056c25791b760cd5cbefd7f4833a4f  threadweaver-5.79.0.tar.xz
29569aea274980c7be0fa113fbdd72b5  kauth-5.79.0.tar.xz
7ce37448704e52f833bf8745e2da1735  kcompletion-5.79.0.tar.xz
724d4809ae5a9ffac862f7e1eb3961d9  kcrash-5.79.0.tar.xz
def0bffe069de1a332fd8ee3bc57da6f  kdoctools-5.79.0.tar.xz
49f5d2ff5cbb2259aa599eeacc42408b  kpty-5.79.0.tar.xz
a59d86a63028c25e5a6e6870d38137cc  kunitconversion-5.79.0.tar.xz
3e594da911338a9ea526f3b6ec1e1edd  kconfigwidgets-5.79.0.tar.xz
f2430143ec93ab42afa8f4c71398ee6d  kservice-5.79.0.tar.xz
6e5217c6621e97fe90e99385720f968d  kglobalaccel-5.79.0.tar.xz
724d79ae4f9019d793588c75dde5c69c  kpackage-5.79.0.tar.xz
6dd0f61fd2defdd1d7a0edc44bf7a06c  kdesu-5.79.0.tar.xz
bda61c05c220c53f4866a6c5a43b8612  kemoticons-5.79.0.tar.xz
2cc3443c13bf99e7660a8df09cd6fc95  kiconthemes-5.79.0.tar.xz
c5456e8581dada4a7d4bf8f08a89963f  kjobwidgets-5.79.0.tar.xz
3f4611dfc589da49a5ea7a844e58262c  knotifications-5.79.0.tar.xz
4f2f01042c5b6a28c3ceb0ecdeec5577  ktextwidgets-5.79.0.tar.xz
c57d052f56800b4adb88b3daddd320f6  kxmlgui-5.79.0.tar.xz
216a661a5dec0ad28ac04893e9ad805c  kbookmarks-5.79.0.tar.xz
66e705d82e006aac8071105f517f275b  kwallet-5.79.0.tar.xz
1a730e3d51c5a6f8d568f91f433afb00  kded-5.79.0.tar.xz
d796080d51e62c2b3cc3fbdb19ceaf66  kio-5.79.0.tar.xz
a19eb4911c2fece7c2d5849f046733f7  kdeclarative-5.79.0.tar.xz
15f2b2030e36ae4d2ab1fbe572c60b45  kcmutils-5.79.0.tar.xz
56a4ea8393daec54189832d767f8f080  kirigami2-5.79.0.tar.xz
a07e2d9babf366a29656d21e4ee66cf6  knewstuff-5.79.0.tar.xz
c7c3bde5eb426f717f530ac03a19ef15  frameworkintegration-5.79.0.tar.xz
047c3d951b94c667b33e19e11c61e2ae  kinit-5.79.0.tar.xz
317290d8ec99b95e73c680e65c29e4e4  knotifyconfig-5.79.0.tar.xz
03d1d45c3f029da0431f3145db65f25b  kparts-5.79.0.tar.xz
aa85d3aa9c57681b61d8330667062e77  kactivities-5.79.0.tar.xz
#dae7d15553315aa7cc352c54d19dae9b  kdewebkit-5.79.0.tar.xz
a4db3d3a35151aeaebc9eaa8b825cbc9  syntax-highlighting-5.79.1.tar.xz
42d01794017416e54cabf71376d160b8  ktexteditor-5.79.0.tar.xz
d23f9c74b3dc20f15c86e88723e2de00  kdesignerplugin-5.79.0.tar.xz
9d221f6fc2f4d704fa115b59275218fd  kwayland-5.79.0.tar.xz
4dc731b88b3e28748622284622e65fc6  plasma-framework-5.79.0.tar.xz
#7acca01fc2d463224b92c4095cfbcd69  modemmanager-qt-5.79.0.tar.xz
9261af304aff1defe6e5ef91f276a12a  kpeople-5.79.0.tar.xz
af9aed54f0ddcc9a481b58f585d48f90  kxmlrpcclient-5.79.0.tar.xz
18579f11a8763c02ab476aa886af91f5  bluez-qt-5.79.0.tar.xz
71bdc5e4dc4b4bda01190a9fea6209f4  kfilemetadata-5.79.0.tar.xz
4126fc0077942bcd09ecb5833010203f  baloo-5.79.0.tar.xz
#6977e21486ea56c642a5037647636925  breeze-icons-5.79.0.tar.xz
#7266f03969ef7c91257d5a023bb0ddac  oxygen-icons5-5.79.0.tar.xz
1a9684e30416fdead96fdd72dd5f1e59  kactivities-stats-5.79.0.tar.xz
c86ae5aef97956907f8686819042def8  krunner-5.79.0.tar.xz
ec189c854e1e671a030692d1eb17b2d4  prison-5.79.0.tar.xz
c10d6a8662b4215cab57379827ea4d80  qqc2-desktop-style-5.79.0.tar.xz
3df2c2ad1f05499252c249a5bb9381e3  kjs-5.79.0.tar.xz
9055eb30f76245929b22b453bea681b9  kdelibs4support-5.79.0.tar.xz
79a58b58e4a14717413ab4344e5d9f84  khtml-5.79.0.tar.xz
861bff4ffdfa60fea90776817f959d51  kjsembed-5.79.0.tar.xz
3c20d76012b40f047c2ebcb9fdfa23fe  kmediaplayer-5.79.0.tar.xz
0e8b13cdf366b09313c46b835184272f  kross-5.79.0.tar.xz
4ff475cef2ff786c7218af07dda1e123  kholidays-5.79.0.tar.xz
eccbb4b9427e07e9b0d88cbbe116beb9  purpose-5.79.0.tar.xz
2a92913826be0c89fa4980eff8dc1763  kcalendarcore-5.79.0.tar.xz
7830c9f2540d6726be23f36a399afb1c  kcontacts-5.79.0.tar.xz
4a67bab900bcb25d7a2da20a098f438e  kquickcharts-5.79.0.tar.xz
2534a448766bd73b8803c2e5c628d919  kdav-5.79.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.79.0 and oxygen-icons5-5.79.0. The modemmanager-qt package may be built if its optional dependency has been 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.9.5p2 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

      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.79.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.79.0
ln -sfvn kf5-5.79.0 /opt/kf5

Command Explanations

-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: balooctl, baloo_file, baloo_file_extractor, baloosearch, balooshow, checkXML5, depdiagram-generate, depdiagram-generate-all, depdiagram-prepare, desktoptojson, gentrigrams, kactivities-cli, kapidox_generate, kate-syntax-highlighter, kbuildsycoca5, kcookiejar5, kdebugdialog5, kded5, kdeinit5, kdeinit5_shutdown, kdeinit5_wrapper, kf5-config, kf5kross, kgendesignerplugin, kglobalaccel5, kiconfinder5, kjs5, kjscmd5, kjsconsole, knewstuff-dialog, kpackagelauncherqml, kpackagetool5, kquitapp5, kreadconfig5, kshell5, ktelnetservice5, ktrash5, kwalletd5, kwallet-query, kwrapper5, kwriteconfig5, meinproc5, parsetrigrams, plasmapkg2, preparetips5, protocoltojson, and solid-hardware5
Installed Libraries:,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, and
Installed Directories: /opt/kf5 (symlink to /opt/kf5-5.79.0) if installing in /opt

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


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


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 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 2021-02-25 10:55:23 -0800