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.3 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.69.0, extra-cmake-modules-5.53.0, docbook-xml-4.5, docbook-xsl-1.79.2, giflib-5.1.4, libepoxy-1.5.3, libgcrypt-1.8.4, libjpeg-turbo-2.0.1, libpng-1.6.36, libxslt-1.1.33, lmdb-0.9.23, phonon-4.10.1, shared-mime-info-1.10, URI-1.74, and Wget-1.20.1 (required to download the packages)



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

Runtime dependency for FrameworkIntegration

Oxygen fonts and Noto fonts

Runtime dependencies for kapidox

Doxygen-1.8.15, Jinja2 , and PyYAML

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.1, 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.53.0.md5 << "EOF"
56fbdc261e2821bb20775f1346d07321  attica-5.53.0.tar.xz
#a57cf2aa488fdcce7323a2a4b9aecb65  extra-cmake-modules-5.53.0.tar.xz
4ecdd6e9ab36b9bbdbe183f042eecb62  kapidox-5.53.0.tar.xz
81b62cf06f46166c16c194c88a2cc0fe  karchive-5.53.0.tar.xz
968d1595082a3e167204a3b9585aa815  kcodecs-5.53.0.tar.xz
94c1924e39827a9bdfe19d1746383553  kconfig-5.53.0.tar.xz
#6c568d586c85e82b1d81221818862761  kcoreaddons-5.53.0.tar.xz
919bc0c53aa22cb45705ec1761198508  kcoreaddons-5.53.1.tar.xz
750d39201cca1bd29a1c6e10d33e77c0  kdbusaddons-5.53.0.tar.xz
b3547e0cca796eedfada7a850969f307  kdnssd-5.53.0.tar.xz
f2dee5c934be5a795c8caae2c9ef9c2f  kguiaddons-5.53.0.tar.xz
95e67ba518ac2983e33ce8370bf0d3cd  ki18n-5.53.0.tar.xz
176fb9a35f39ff79694c2a14be20ad44  kidletime-5.53.0.tar.xz
ea2af0d9b0b3cd76b2f78e929c417f6f  kimageformats-5.53.0.tar.xz
f4d5826a20517d81387d20afb558ad0a  kitemmodels-5.53.0.tar.xz
ec88c97513d84ce37de888721a3012bb  kitemviews-5.53.0.tar.xz
34125fa1563feb9af831b1f7e05629ae  kplotting-5.53.0.tar.xz
d73f5e3087bac6610b217df937024f5a  kwidgetsaddons-5.53.0.tar.xz
6f7d0cc6d6fda9795035426ca14011ee  kwindowsystem-5.53.0.tar.xz
0c55c1c31cc8c78b748d09cd5e4da395  networkmanager-qt-5.53.0.tar.xz
b7ca9416caae95bb56d72e062a31023b  solid-5.53.0.tar.xz
fd28bda2bd2c1c0d40e477930394ed14  sonnet-5.53.0.tar.xz
58eda3124d5b24282e20471ed8275816  threadweaver-5.53.0.tar.xz
a98963e45c078d47f57e0f43c369baf2  kauth-5.53.0.tar.xz
113a86c053589b02024fe2e2052968b1  kcompletion-5.53.0.tar.xz
cabf02514d5ef0d5b25c44ff7d708ac3  kcrash-5.53.0.tar.xz
905d494671f33de9827c9a4467c0bdc7  kdoctools-5.53.0.tar.xz
102ec25afd116f79bb78699e3bf90bd7  kpty-5.53.0.tar.xz
89e6c4d46895f827fc36cab1b3782bf1  kunitconversion-5.53.0.tar.xz
295ec19de064d7ce1e0d5a89b8a21fbb  kconfigwidgets-5.53.0.tar.xz
fd8aa91bad5b676a1d0c90588ff2220c  kservice-5.53.0.tar.xz
ae6ea47653d2828821ec897b7e723134  kglobalaccel-5.53.0.tar.xz
532cd48d56e1adc7f716d4721a78bfe1  kpackage-5.53.0.tar.xz
253c8af01d93472f5940fd6f7fb33271  kdesu-5.53.0.tar.xz
cf48b7990b0026a6eb193bff21eb2ad8  kemoticons-5.53.0.tar.xz
234017ec51e4dc3f02989af75121e8f5  kiconthemes-5.53.0.tar.xz
3437728b6b9a09a59720d86392c05624  kjobwidgets-5.53.0.tar.xz
ec855d38c17ab4bba8d07b5e8532d6c7  knotifications-5.53.0.tar.xz
41089d37d64582213161d5ea55833afa  ktextwidgets-5.53.0.tar.xz
b4c155182fd4ce55a40c9805fb405952  kxmlgui-5.53.0.tar.xz
f047e46e6b2ff7555a35678dbfaf06d5  kbookmarks-5.53.0.tar.xz
69bab15cc17486a5fcb73a811df6bd46  kwallet-5.53.0.tar.xz
23e7ef2aedfca8e77907d50d5bcfcb7e  kio-5.53.0.tar.xz
89d9a968e01ad5c5937628dfc0b107f1  kdeclarative-5.53.0.tar.xz
62046f1c778dbc0cb1d4cdf2964006c6  kcmutils-5.53.0.tar.xz
66df9ccd7ad082f04aaa5d602f6c9744  kirigami2-5.53.0.tar.xz
f9b94bfbfc7658ff675c6f81085172f7  knewstuff-5.53.0.tar.xz
9957a52e9b75dd61a62f3ad7a61e299a  frameworkintegration-5.53.0.tar.xz
f4c46a0a8e3e0cd7134c82895b47bb83  kinit-5.53.0.tar.xz
6df039f32bce1f4c0f487a8997526d2f  knotifyconfig-5.53.0.tar.xz
81379bd6d6adf476d776c74874594c09  kparts-5.53.0.tar.xz
c05f22156c27da1ad2f7d2d07026b2e8  kactivities-5.53.0.tar.xz
8edde556c89c783dbd6bd9956f52e0cf  kded-5.53.0.tar.xz
#fea737d2db9d792bdc24eb3de83276cc  kdewebkit-5.53.0.tar.xz
62d67899a9cd5cd6b93761ebafd88942  syntax-highlighting-5.53.0.tar.xz
fec5ca67093aa83378d2b0daae131a43  ktexteditor-5.53.0.tar.xz
1d4e9805bb6d3748b01140fdb0ecff41  kdesignerplugin-5.53.0.tar.xz
89674cb577a239da0c6decddb62e8e28  kwayland-5.53.0.tar.xz
b083d295d7f2ba6236ca466b0cdaca64  plasma-framework-5.53.0.tar.xz
21d412157131d544fe2fd76e230af5e8  modemmanager-qt-5.53.0.tar.xz
4a734ace32596aa1a08922a291dc117f  kpeople-5.53.0.tar.xz
130b79df792e0cd4be15a0f9fec54278  kxmlrpcclient-5.53.0.tar.xz
a95dc95f2ab7b4892d3cb166516b6c73  bluez-qt-5.53.0.tar.xz
e2d2de67f9dcbdabc950ef0a3ad5d5c5  kfilemetadata-5.53.0.tar.xz
deed1d430e5c9b73008ca45c78df9ee3  baloo-5.53.0.tar.xz
#a556bc1666851b8437ccaafd8cefe1d2  breeze-icons-5.53.0.tar.xz
#0a7d75f573c34fc1d2781cea90c2074e  oxygen-icons5-5.53.0.tar.xz
74f48c21cc7ccf14fcc441b7ec53ae65  kactivities-stats-5.53.0.tar.xz
284425457f8270e91e94d13d1a522cce  krunner-5.53.0.tar.xz
#49f35779816680e7da357abba972ceb0  prison-5.53.0.tar.xz
b873771ad44ec37625a79d7a41e8679f  qqc2-desktop-style-5.53.0.tar.xz
14303adfba7c862f0a7f4761f90d079b  kjs-5.53.0.tar.xz
4cc726dd1c9633b8c41e64b6c41264d5  kdelibs4support-5.53.0.tar.xz
3c483e076a47512970fa887eaf50c276  khtml-5.53.0.tar.xz
91b293e616518e7603ef4063c748b324  kjsembed-5.53.0.tar.xz
2b0aa8e7fc91286e8b5df927f77babb8  kmediaplayer-5.53.0.tar.xz
690b0c422b7b22b7adf030be6a178e59  kross-5.53.0.tar.xz
680e4656504ef2fc0e25c6a60e53a39e  kholidays-5.53.0.tar.xz
13631f878f957b8a5c3103336f856b92  purpose-5.53.0.tar.xz
0fe62a714eadf8e52a0f99e49ad647ae  syndication-5.53.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.53.0 and oxygen-icons5-5.53.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:

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.53.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.53.0
ln -sfvn kf5-5.53.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.53.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-12-15 23:24:03 -0600