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-8.4 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.70.0, extra-cmake-modules-5.58.0, docbook-xml-4.5, docbook-xsl-1.79.2, giflib-5.1.9, libepoxy-1.5.3, libgcrypt-1.8.4, libjpeg-turbo-2.0.2, libpng-1.6.37, libxslt-1.1.33, lmdb-0.9.23, phonon-4.10.2, shared-mime-info-1.12, URI-1.76, and Wget-1.20.3 (required to download the packages)



BlueZ-5.50 (needed to build Bluez-Qt), ModemManager-1.10.2 (needed to build ModemManager-Qt)

Runtime dependency for FrameworkIntegration

Oxygen fonts and Noto fonts

Runtime dependencies for kapidox

Doxygen-1.8.15, Jinja2-2.10.1, and PyYAML-5.1

Additional image formats support in KImageFormats

JasPer-2.0.14 and OpenEXR

Optional dependencies for KIO

MIT Kerberos V5-1.17

Optional dependencies for Solid

UDisks-2.8.2, UPower-0.99.10 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.58.0.md5 << "EOF"
f1b0eba58f4e29c6c9af2a39a4d92052  attica-5.58.0.tar.xz
#ab2e42031a1aa96eca27d029827fe9d8  extra-cmake-modules-5.58.0.tar.xz
45ca6b083bf51ed1cebaf11431c20f71  kapidox-5.58.0.tar.xz
8d386da9f2e3a64018b979a8a0512a18  karchive-5.58.0.tar.xz
5e2fd0f6588523b30ab9c8ab53bb1d76  kcodecs-5.58.0.tar.xz
f0a5d4f90ff74a764691e1d31caa378c  kconfig-5.58.0.tar.xz
ea7e5f1f3f880e1814e9952998476f76  kcoreaddons-5.58.0.tar.xz
2c0b68f305c296ab785c65d356ae0f45  kdbusaddons-5.58.0.tar.xz
c373138c303866478fb848774bba0ce0  kdnssd-5.58.0.tar.xz
4485550ff755fd84f3126a2079dda66b  kguiaddons-5.58.0.tar.xz
82e0f37a01ad489db993833470ea59a8  ki18n-5.58.0.tar.xz
f9189c3ba90584800c51686167a310d5  kidletime-5.58.0.tar.xz
77c013f9a37934fc20239d0a3da205ba  kimageformats-5.58.0.tar.xz
7d1a541f0e3ecb0e31a1e02bf14ec043  kitemmodels-5.58.0.tar.xz
aa0444b0e1d59198eb5909931dacc8d7  kitemviews-5.58.0.tar.xz
d714d9cbcb2a5083f283c5831f9d9969  kplotting-5.58.0.tar.xz
05f0c66e03250369f296dfedf99ae9b4  kwidgetsaddons-5.58.0.tar.xz
596760bde216cb7335193fec16baeec4  kwindowsystem-5.58.0.tar.xz
95bc9df762d4a99b6e71f3fae9ee2bad  networkmanager-qt-5.58.0.tar.xz
f6a9c58ce4e5a6ff82dd11f431aa3610  solid-5.58.0.tar.xz
1bb0c7eaaa57e91364da4ff023eaa7fd  sonnet-5.58.0.tar.xz
39c96c38a87fee145d43d894cfbff64f  threadweaver-5.58.0.tar.xz
a5df25b21f6aab84e310cd1d4f201141  kauth-5.58.0.tar.xz
920cf624a739e63290743f5c3fa418f1  kcompletion-5.58.0.tar.xz
c526a1714cf265711e0a20e9888978eb  kcrash-5.58.0.tar.xz
0fb5dd4eb907b55782e321f3d86eb825  kdoctools-5.58.0.tar.xz
fb18265b0c83adbb4af57b7c0588ff31  kpty-5.58.0.tar.xz
dc840b7be1e9c8e4ba715b3fee264714  kunitconversion-5.58.0.tar.xz
1c3ef53c26083ccd886144d794f56b3f  kconfigwidgets-5.58.0.tar.xz
748c4fe209139249efaa669edb07fc91  kservice-5.58.0.tar.xz
36c37994da9057dbda764229c847e873  kglobalaccel-5.58.0.tar.xz
cddda5df856b84d82289056e2521e0f5  kpackage-5.58.0.tar.xz
4e927df18363fc6f7da0154e9d097f31  kdesu-5.58.0.tar.xz
b5ccd7868f3b506c238c3492a56ba65a  kemoticons-5.58.0.tar.xz
2111f28ff4051914be2b7caf355befb4  kiconthemes-5.58.0.tar.xz
ba814954d8506f44f3f683a427f4628c  kjobwidgets-5.58.0.tar.xz
4865198f8406068c67254ee3b59faab4  knotifications-5.58.0.tar.xz
1d030a5e1a52bac6528d39737d52ffb8  ktextwidgets-5.58.0.tar.xz
899f9dca54c336c0034fa0aee2b5bf8f  kxmlgui-5.58.0.tar.xz
979b5612fd76e0959736347b4dbccce7  kbookmarks-5.58.0.tar.xz
b27baeea7c21967609a4507cf616d47a  kwallet-5.58.0.tar.xz
1c8b5a0d4eddab6a97f387c5e5fd67a2  kio-5.58.0.tar.xz
c431a6562b643dcb1d56f3170d05025d  kdeclarative-5.58.0.tar.xz
cb3326fe23c757af9588f97f44882d71  kcmutils-5.58.0.tar.xz
ba2f49c4a857c4fc603d6e7930a4e665  kirigami2-5.58.0.tar.xz
c34bd0c3876e657c2dd92265a88071b3  knewstuff-5.58.0.tar.xz
4b8bd790e04ff1e7998fc96f4e505760  frameworkintegration-5.58.0.tar.xz
4d914c5ae3010ae600c858e9ccdeecb2  kinit-5.58.0.tar.xz
e5917ac42030612bfc952e3967072469  knotifyconfig-5.58.0.tar.xz
79b028e61cbab0cfeb167e02363fad44  kparts-5.58.0.tar.xz
e38977ae6c504a4f092c1c6ad3b6d28a  kactivities-5.58.0.tar.xz
4cb98a0531c0c9aea801f7678400c280  kded-5.58.0.tar.xz
#88b0b5fd5e7debdf6291263f1e4a9478  kdewebkit-5.58.0.tar.xz
a93c3854a98a7616f02676cd2d6f1ed3  syntax-highlighting-5.58.0.tar.xz
9b26b1c6de1b19e8995f66fd31ab9901  ktexteditor-5.58.0.tar.xz
2b96b2eab04f75ec34b2017ca95d5a16  kdesignerplugin-5.58.0.tar.xz
1f029fbeb30e11fa362fa9a5ef836111  kwayland-5.58.0.tar.xz
fc77bd0e0e3d0905be7b32cb7ae0f9eb  plasma-framework-5.58.0.tar.xz
#d1822d13276bde0be4dae6749a3b61b5  modemmanager-qt-5.58.0.tar.xz
d379b213cf068b4a73503c3922ca20b5  kpeople-5.58.0.tar.xz
4ca1ac3fd1d98a08baf8f70536c6a27a  kxmlrpcclient-5.58.0.tar.xz
13ba6a2b5051d0d03b0d0a6e056ec1a5  bluez-qt-5.58.0.tar.xz
5bd7d7b91b0c1e70a0c49bedc8eac381  kfilemetadata-5.58.0.tar.xz
cf5ba6707cd5ee804bc6ee57b712bd84  baloo-5.58.0.tar.xz
#551a7d46848ec758464a1cc96c68672f  breeze-icons-5.58.0.tar.xz
#4d2016bc53b675a776b7321e49132dee  oxygen-icons5-5.58.0.tar.xz
8e1d8fdda1588b98fe0fc8dcda08d217  kactivities-stats-5.58.0.tar.xz
f61cded81c889d8c92dde7c9234858e5  krunner-5.58.0.tar.xz
#7c2a5f7808304f3d8404a8083bf54e8f  prison-5.58.0.tar.xz
789d6b25e609a51e5fc86f397ccff7d2  qqc2-desktop-style-5.58.0.tar.xz
7c88ae56084c5b43538344af72b4b6d2  kjs-5.58.0.tar.xz
1c4d788d910c3d7c06734aed2524ad0d  kdelibs4support-5.58.0.tar.xz
d62ea2b2a7eecd46f3b95460b8a94956  khtml-5.58.0.tar.xz
d9cac6962c2820ab99661ba6e2d0d799  kjsembed-5.58.0.tar.xz
a117c2e069988d910ee5478346c6ca0f  kmediaplayer-5.58.0.tar.xz
5e09b84e2675fe3c545d41ae347877c2  kross-5.58.0.tar.xz
d3f3e84e2658cd46489b591d79d85226  kholidays-5.58.0.tar.xz
5fe559e1dc6f42b8b207f34b4aa8f340  purpose-5.58.0.tar.xz
3f83b4120f4de8021056d878bba60c9a  syndication-5.58.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.58.0 and oxygen-icons5-5.58.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.27 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.58.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.58.0
ln -sfvn kf5-5.58.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: 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.58.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 2019-05-14 08:53:09 -0500