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-11.0 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.77.0, extra-cmake-modules-5.85.0, docbook-xml-4.5, docbook-xsl-1.79.2, giflib-5.2.1, libepoxy-1.5.9, libgcrypt-1.9.4, libical-3.0.10, libjpeg-turbo-2.1.1, libpng-1.6.37, libxslt-1.1.34, lmdb-0.9.29, qrencode-4.1.1, phonon-4.11.1, plasma-wayland-protocols-1.3.0, shared-mime-info-2.1, URI-5.09, and Wget-1.21.2 (required to download the packages)



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

Runtime dependency for FrameworkIntegration

Oxygen fonts and Noto fonts

Additional recommended dependencies for kapidox

Other python modules needed by kapidox

requests, doxyqml, doxypypy, urllib3, idna, charset-normalizer, and certifi (all will be automatically installed at build time if not present on the system)

Additional image formats support in KImageFormats

JasPer-2.0.33 and OpenEXR

Optional dependencies for KIO

MIT Kerberos V5-1.19.2

Optional dependencies for Solid

UDisks-2.9.4, UPower-0.99.13 and media-player-info (runtime)

Optional dependency for KWallet

GPGME-1.16.0, 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.85.0.md5 << "EOF"
06d286995319fd9565d43bf736576a82  attica-5.85.0.tar.xz
#e4d8d5d70334eb9f40feb14c0e5fa1c3  extra-cmake-modules-5.85.0.tar.xz
007581e41e7c13cc52f03c50f65c9826  kapidox-5.85.0.tar.xz
deee0085dbd22032a437106ba01ba7b2  karchive-5.85.0.tar.xz
3fb5aba8c68be4c384ee17a91798ddec  kcodecs-5.85.0.tar.xz
eef295c85781ddf9a3abbd95a4da5df3  kconfig-5.85.0.tar.xz
d7a2748aebb1206fc38cb00bb39bc0eb  kcoreaddons-5.85.0.tar.xz
c9b3062073d8fb0977aa63fab7582d1e  kdbusaddons-5.85.0.tar.xz
510b0e437a855592d3512faa94fcd4ba  kdnssd-5.85.0.tar.xz
7b5b4d7610c45895ac5138c1e762ef41  kguiaddons-5.85.0.tar.xz
e9463a50c2bc56a6cebc70c487b5a45d  ki18n-5.85.0.tar.xz
58a3e469ac54cb78469b27f216c87c0a  kidletime-5.85.0.tar.xz
5cb4de5a5215b8f9412bbff02ac59f11  kimageformats-5.85.0.tar.xz
3f00cbe1c9ded4b9f061f0dcc3c38071  kitemmodels-5.85.0.tar.xz
5ed293814f6ca4c37a9fef6963431db0  kitemviews-5.85.0.tar.xz
040eaecd9952dc73b11ab4570f7b93f8  kplotting-5.85.0.tar.xz
381c75cf800cfe1483ea3493e2de245c  kwidgetsaddons-5.85.0.tar.xz
4d9cca227b795280ee920156cdec4859  kwindowsystem-5.85.0.tar.xz
f530333f5635266765b9d998ddc51d33  networkmanager-qt-5.85.0.tar.xz
254a03e4914ad144126a615ebbcbc11c  solid-5.85.0.tar.xz
6883eeb4c62837d70c6d6cbd01ba4cb8  sonnet-5.85.0.tar.xz
ceb00c86052dd1c9e4bef970c19f46d4  threadweaver-5.85.0.tar.xz
7e097f4474c43e08b2540a8883dc1e00  kauth-5.85.0.tar.xz
dcf9b03389d733eac8ae930b26d5389a  kcompletion-5.85.0.tar.xz
cc72c9ac7cba7207ef1a170bb2e4719e  kcrash-5.85.0.tar.xz
2676c29e1d3a93bd42e4f84f86961c4d  kdoctools-5.85.0.tar.xz
f85fe1b8f7319ed6e69d562671a705d0  kpty-5.85.0.tar.xz
298c9df17377b26ccd76d34f54ffad6c  kunitconversion-5.85.0.tar.xz
530e29b6a5993c0f23adbe09c48a7f16  kconfigwidgets-5.85.0.tar.xz
3081cf3c1eae4121b9b1fb71a1aa7c64  kservice-5.85.0.tar.xz
c3a62eeaf5d94bf326cab38dd1380204  kglobalaccel-5.85.0.tar.xz
5203415a3948fb0c3c1937bcba5c5758  kpackage-5.85.0.tar.xz
f57850b50533be59335bdf2d76fcfc76  kdesu-5.85.0.tar.xz
c4c930b28e1c5bd4e2a1aad9e8c328b0  kemoticons-5.85.0.tar.xz
edf31862bd801304fdb578050b0326d2  kiconthemes-5.85.0.tar.xz
b73b00a29afcf70d964190219ee6ccbc  kjobwidgets-5.85.0.tar.xz
8b7c4520f6ffc7cfc1fbd22e0c9ffa18  knotifications-5.85.0.tar.xz
fd3490e92465f433a5576b40ac348cbd  ktextwidgets-5.85.0.tar.xz
5b2362e1d485d80c3111679ae4cad68b  kxmlgui-5.85.0.tar.xz
679bb7a808f2d51e43f9dc26ce3f62d1  kbookmarks-5.85.0.tar.xz
ceaebee871b3f792766377c1074216a3  kwallet-5.85.0.tar.xz
aa1168d883e43dc304bbd809c9aa2f3d  kded-5.85.0.tar.xz
30c8871003edb993afc385e16f8b1a64  kio-5.85.0.tar.xz
1da45e0185075d0c384100c17d8a789f  kdeclarative-5.85.0.tar.xz
2e11d1726375387f2942cf9f3845760a  kcmutils-5.85.0.tar.xz
975fa5fd7a1db023639eb26f0d5e6809  kirigami2-5.85.0.tar.xz
8de5ea8546df1d8a23a2eb1ce465dbc9  syndication-5.85.0.tar.xz
7b1926330878c8c9c8a28f2403ff2e81  knewstuff-5.85.0.tar.xz
f6178e5a138b0fe4260bb74bfabd2a5f  frameworkintegration-5.85.0.tar.xz
e86d84f9d34aa94e55d0ca177f49a57c  kinit-5.85.0.tar.xz
14c79ffe82f063ff67392f64005477d2  kparts-5.85.0.tar.xz
0fef80b90c110adfe7c775f93e1f3e1d  kactivities-5.85.0.tar.xz
#3557d248cdecb2bd03e0a00b0dab7ae2  kdewebkit-5.85.0.tar.xz
1ef1c6039a3e91ec533af11af19539ec  syntax-highlighting-5.85.0.tar.xz
535adfca5246321df0f69de579c5f29c  ktexteditor-5.85.0.tar.xz
6f09f3c76f6a698ede4fb67f6bb709cc  kdesignerplugin-5.85.0.tar.xz
5253a422ba21dcb9bf92ffb53c035f2a  kwayland-5.85.0.tar.xz
fa2e79613982549dca6e20ecd0907fa5  plasma-framework-5.85.0.tar.xz
#1ad46346789bc04b7ff10bb4bb257e84  modemmanager-qt-5.85.0.tar.xz
424f8cbccde63734ca9a41d2be38ce44  kpeople-5.85.0.tar.xz
148e239b5fd08a66e655116a7399c22d  kxmlrpcclient-5.85.0.tar.xz
0a90f655455ab7dcbe5e652a84a06a6e  bluez-qt-5.85.0.tar.xz
866ba6788b62d46011d6d23f4195230d  kfilemetadata-5.85.0.tar.xz
e4fa06ec978fece6eb13c2a9e6749fcc  baloo-5.85.0.tar.xz
#42665314255bdf88736973c28c8c0a65  breeze-icons-5.85.0.tar.xz
#b6cad03903a685db1b323db2165355eb  oxygen-icons5-5.85.0.tar.xz
65e8097e66204a7b8ae8fd616a9789a9  kactivities-stats-5.85.0.tar.xz
0da888b4320299c93b56259da68563a8  krunner-5.85.0.tar.xz
baf7228889d33913fffd26faedca61e5  prison-5.85.0.tar.xz
daf55ba893a81e851c42507cb7b99e48  qqc2-desktop-style-5.85.0.tar.xz
5c1a1d58b3ad5bb0d7fbbf427fc0dff1  kjs-5.85.0.tar.xz
f5e0ca6f84d143f216a38cfb0c083267  kdelibs4support-5.85.0.tar.xz
06c9c414894382a06a150967d2b1bbee  khtml-5.85.0.tar.xz
e8f677e831ec75d8894ab77b139b0d77  kjsembed-5.85.0.tar.xz
346789a75525372ac67d46c39834b150  kmediaplayer-5.85.0.tar.xz
2e92ff7e9cc04bd2a3e06dfa24cf0f1f  kross-5.85.0.tar.xz
75032ec4d4b432c7e3bb83b0bdbe0cac  kholidays-5.85.0.tar.xz
7921bd89698216109cde504e59e115c0  purpose-5.85.0.tar.xz
eaee772562d93a2752547c09427679cc  kcalendarcore-5.85.0.tar.xz
565639b8a34802e97efaeac520d894a3  kcontacts-5.85.0.tar.xz
07a1780a5e1cb8479232cf2244b69f7a  kquickcharts-5.85.0.tar.xz
345e20cbc8d815173ab5861a72b084bb  knotifyconfig-5.85.0.tar.xz
fc2b4c6df2f4f7c50955b31445774d3a  kdav-5.85.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.85.0 and oxygen-icons5-5.85.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.8p2 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       &&
ln -sfv /usr/share/polkit-1 $KF5_PREFIX/share       &&
install -v -dm755           $KF5_PREFIX/lib         &&
ln -sfv /usr/lib/systemd    $KF5_PREFIX/lib

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
          sed -i 's/${EGL_TARGET}/GL EGL/' src/declarativeimports/core/CMakeLists.txt ;;

      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.85.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.85.0
ln -sfvn kf5-5.85.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.85.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 Mon Sep 6 19:42:49 2021 +