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.2 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.67.0, extra-cmake-modules-5.46.0, docbook-xml-4.5, docbook-xsl-1.79.2, giflib-5.1.4, libepoxy-1.5.2, libgcrypt-1.8.3, libjpeg-turbo-1.5.3, libpng-1.6.34, libxslt-1.1.32, lmdb-0.9.22, OpenSSL-1.0.2o Libraries, phonon-4.10.1, shared-mime-info-1.9, URI-1.74, and Wget-1.19.5 (required to download the packages)



BlueZ-5.49 (needed to build Bluez-Qt), ModemManager-1.6.12 (needed to build ModemManager-Qt)

Runtime dependency for FrameworkIntegration

Oxygen fonts and Noto fonts

Runtime dependencies for kapidox

Doxygen-1.8.14, Jinja2-2.10, and PyYAML-3.12

Additional image formats support in KImageFormats

JasPer-2.0.14 and OpenEXR

Optional dependencies for KIO

MIT Kerberos V5-1.16.1

Optional dependencies for Solid

UDisks-2.7.6, UPower-0.99.7 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.46.0.md5 << "EOF"
744dc9e456797eb65dc17708a4f6930f  attica-5.46.0.tar.xz
#f5a2ddb5160e16399f748313647d4916  extra-cmake-modules-5.46.0.tar.xz
b7c7dd61a1975fccbe2223f3d96dfa7e  kapidox-5.46.0.tar.xz
9a82e32ecaeecb65fa43393ab4f3a48f  karchive-5.46.0.tar.xz
7320c55f1394465d801a0f838e847bd1  kcodecs-5.46.0.tar.xz
eed27bdc7f37eb035bb78d3ed4b1bf09  kconfig-5.46.0.tar.xz
56b18e58fa143141f2a906aea58473cc  kcoreaddons-5.46.0.tar.xz
5d67200c6d00b7abbba5608e38eb3adc  kdbusaddons-5.46.0.tar.xz
76849742e7a0a8a755639b421f61269f  kdnssd-5.46.0.tar.xz
f031ccc85572a5bbecf7996be60b72a7  kguiaddons-5.46.0.tar.xz
563a1497e4be62b2f45289ebb05a1015  ki18n-5.46.0.tar.xz
39e01a23876ff8c3b7d7bf5476f51507  kidletime-5.46.0.tar.xz
99970c570cf6f68b62b7c2850fee91e3  kimageformats-5.46.0.tar.xz
d89c65ea022e193de5bec88e17622073  kitemmodels-5.46.0.tar.xz
15893a114ad2fe67cafa49aa4270ca44  kitemviews-5.46.0.tar.xz
dc8c9ba081a0c76af6a3bf24b3500fdf  kplotting-5.46.0.tar.xz
9401525c36516b6719ff3b902b539d00  kwidgetsaddons-5.46.0.tar.xz
481a95d42da42756b3071310cdca8413  kwindowsystem-5.46.0.tar.xz
512bc966f8522eea4660d4db424519eb  networkmanager-qt-5.46.0.tar.xz
a961e64883eb99d7ddd374d8e64f77ab  solid-5.46.0.tar.xz
477c6fc7cd97aed8a6a47a26cbc9807c  sonnet-5.46.0.tar.xz
f750df59bb52f74fceea9085fc0cd737  threadweaver-5.46.0.tar.xz
dd084a4c52e8e308fe2f17a5a6ffaab8  kauth-5.46.0.tar.xz
56559cc6ff7db07896625edcdc8a175a  kcompletion-5.46.0.tar.xz
60b2d68fbc8236e9595f2d7c2528dbe9  kcrash-5.46.0.tar.xz
7bf01d27a5b8ea92da09d4b1f0cb9be8  kdoctools-5.46.0.tar.xz
d5881c9502a3867f9ac2537c5c4d8139  kpty-5.46.0.tar.xz
c53b9c65b204135d7df8235b1e27126b  kunitconversion-5.46.0.tar.xz
cb263a59b6750f30dc219523873e9dd7  kconfigwidgets-5.46.0.tar.xz
da3837c37c31983e2f485cd858cbee1a  kservice-5.46.0.tar.xz
95eb20ed9270be73d545519483aa3aff  kglobalaccel-5.46.0.tar.xz
de6d426f6091c513986d5db4b37ea50b  kpackage-5.46.0.tar.xz
84fbce9781af3acaa7e0e94abfaa3405  kdesu-5.46.0.tar.xz
3ad0c95edfbedd383b535670876b2724  kemoticons-5.46.0.tar.xz
80750b3c4d479761448021c708515ad4  kiconthemes-5.46.0.tar.xz
736ee2bbe38de09f3a5dfbb125181f83  kjobwidgets-5.46.0.tar.xz
ead32ea5179d53a211251e05dfe0d6cf  knotifications-5.46.0.tar.xz
b95b19128aeef4a2e6b5a111ccb11b42  ktextwidgets-5.46.0.tar.xz
d8d9fc6b81317d553bc9ad1d49351e7b  kxmlgui-5.46.0.tar.xz
1c5c1ca0f47540e0306fe0b861f04cf7  kbookmarks-5.46.0.tar.xz
2e0d088d7ba5582d63035050bbad7f0b  kwallet-5.46.0.tar.xz
679181b29e12c7ea2c40613d4ceb1c04  kio-5.46.0.tar.xz
16214091286562cdd2dbcf3a00be599b  kdeclarative-5.46.0.tar.xz
5afc45d52f95a7ffba330412982a7164  kcmutils-5.46.0.tar.xz
dce9d8af74cddf8c56ae1d3c5bdd3d6f  kirigami2-5.46.0.tar.xz
b7dacfcf9de03166de6facf12ccd3290  knewstuff-5.46.0.tar.xz
6e28b6d861469f4f994149ab9126c464  frameworkintegration-5.46.0.tar.xz
af8348379145e77ce82731ff99d59332  kinit-5.46.0.tar.xz
643e1b77386aaf549b24e6a454f96a5f  knotifyconfig-5.46.0.tar.xz
04c8cd1ab1e59b11836b33b012297bdd  kparts-5.46.0.tar.xz
c5a455b91f0fce3fa9d05b5dd7b6e4ba  kactivities-5.46.0.tar.xz
7f34228533707b5c85f8ab2bae7b97a4  kded-5.46.0.tar.xz
#c0ee2de3ff585aefd74e16c766d183f3  kdewebkit-5.46.0.tar.xz
ab7de9568bec23ad56f11183570dee07  syntax-highlighting-5.46.0.tar.xz
82c8036688d81514b25dc83d535027c9  ktexteditor-5.46.0.tar.xz
6731356c0c86e9c706e58ce2cd621286  kdesignerplugin-5.46.0.tar.xz
1a5dab28ff9e07f13f528200cf3059d6  kwayland-5.46.0.tar.xz
f2ec2306159c76c3a9ed0d97c3e5c80f  plasma-framework-5.46.0.tar.xz
abf80b50c4717b01df213ef1db7a3e2a  modemmanager-qt-5.46.0.tar.xz
373d2ee51895074269fc1cd09641c8c3  kpeople-5.46.0.tar.xz
bb1058cbd1142e34e2b5dbbed790e507  kxmlrpcclient-5.46.0.tar.xz
2147a40a14d725bdf7538eb4f7a631e8  bluez-qt-5.46.0.tar.xz
5109a64c107385a71f7de575ebe0ce94  kfilemetadata-5.46.0.tar.xz
899dfc68daf13a71fb1146b57b1d26c9  baloo-5.46.0.tar.xz
#9db3c27c991006fef65b3a5ec82c2ba6  breeze-icons-5.46.0.tar.xz
#7c7a54154aa904d6a6ea9f3ce120376e  oxygen-icons5-5.46.0.tar.xz
58a50ac1aab2b36bcdcd6591ffd91d65  kactivities-stats-5.46.0.tar.xz
624ac26b1c64a06056535eaae7f1c73b  krunner-5.46.0.tar.xz
#9e76c7991e42b1f2edbd6e942c5519f0  prison-5.46.0.tar.xz
35b9cb4ec4fb46911da127a7403e7947  qqc2-desktop-style-5.46.0.tar.xz
a7c73a1b7563f8210a5dc26a3796a20f  kjs-5.46.0.tar.xz
c715aa25dd115088670ac89b4f41ceeb  kdelibs4support-5.46.0.tar.xz
545a88b8fc4099cdcddd012327c73c59  khtml-5.46.0.tar.xz
77febd8baf2bfb43cb02d61288887855  kjsembed-5.46.0.tar.xz
ad923a227080d356dd2af479e500c3a9  kmediaplayer-5.46.0.tar.xz
51f5582aed47ec1ab45fee3a427ee74f  kross-5.46.0.tar.xz
01648a0c6d839f71edef5020a8e114e8  kholidays-5.46.0.tar.xz
a28a44a1f985e757e911cd90ba2c0d32  purpose-5.46.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.46.0 and oxygen-icons5-5.46.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.23 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:

export CXXFLAGS='-isystem /usr/include/openssl-1.0'

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

    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.46.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.46.0
ln -sfvn kf5-5.46.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.46.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 2018-05-17 16:55:41 -0500