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).

[Note]

Note

Development versions of BLFS may not build or run some packages properly if dependencies have been updated since the most recent stable versions of the book.

The instructions below build all of the KDE Frameworks packages in one step by using a bash script.

Package Information

KF5 Dependencies

Required

Boost-1.81.0, extra-cmake-modules-5.101.0, docbook-xml-4.5, docbook-xsl-nons-1.79.2, giflib-5.2.1, libepoxy-1.5.10, libgcrypt-1.10.1, libical-3.0.16, libjpeg-turbo-2.1.5, libpng-1.6.39, libxslt-1.1.37, lmdb-0.9.29, qca-2.3.5, qrencode-4.1.1, phonon-4.11.1, plasma-wayland-protocols-1.10.0, shared-mime-info-2.2, URI-5.17, and Wget-1.21.3 (required to download the packages)

Recommended

Optional

BlueZ-5.66 (needed to build Bluez-Qt), ModemManager-1.18.12 (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

Additional image formats support in KImageFormats

JasPer-4.0.0 and OpenEXR

Optional dependencies for KIO

MIT Kerberos V5-1.20.1

Optional dependencies for Solid

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

Optional dependency for KWallet

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

Optional dictionary backends for Sonnet

Hspell and Hunspell

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/kf5

Downloading KDE Frameworks

The easiest way to get the KDE Frameworks packages is to use a single wget to fetch them all at once:

url=https://download.kde.org/stable/frameworks/5.101/
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.101.0.md5 << "EOF"
a4c2e458aa82077a801ec5cb82594df9  attica-5.101.0.tar.xz
#d9c1cdbe014fed6a451f02f0b4debfa7  extra-cmake-modules-5.101.0.tar.xz
8694c6bc1157af7c412077bad9ef59bc  kapidox-5.101.0.tar.xz
8a9c8f0c2640cf185202a8127658dc42  karchive-5.101.0.tar.xz
7871d7b9e5d5fbfb065953d27e1f0b3c  kcodecs-5.101.0.tar.xz
2ddd6e0bdb352e4df15472efdd1badb9  kconfig-5.101.0.tar.xz
7c7c6c2cf8298f0d6b9b34366879566f  kcoreaddons-5.101.0.tar.xz
a8c2d1bb072acf77ed09f88001250439  kdbusaddons-5.101.0.tar.xz
563207df1ba8641855f0bc2096e426c8  kdnssd-5.101.0.tar.xz
eeb32c747e137117d124aa861aad7144  kguiaddons-5.101.0.tar.xz
0419618dcfcd07b8b7275d55b1cc08b1  ki18n-5.101.0.tar.xz
aaf06f0c309974375c0425b97a0b29ec  kidletime-5.101.0.tar.xz
79b1fafc0b1a57c62e4a7a8ea8910120  kimageformats-5.101.0.tar.xz
5fc03df6be2e2c26b4821b8da9fe13d5  kitemmodels-5.101.0.tar.xz
adcb905a7dc6aa97c7152314df9806c6  kitemviews-5.101.0.tar.xz
f0d55e374279cde2931b4f359188885b  kplotting-5.101.0.tar.xz
1bbd20834bedd54f243165b312fa2dd2  kwidgetsaddons-5.101.0.tar.xz
d8c0435cf25503c5ed4f188ac3e7d73f  kwindowsystem-5.101.0.tar.xz
1267e2555046ed91ae082283c65a6dc2  networkmanager-qt-5.101.0.tar.xz
6a3d4b9e161fa6fa10e91b08462747d6  solid-5.101.0.tar.xz
b0d25a3564df7339eeb5b865d0b67a90  sonnet-5.101.0.tar.xz
0df99fcc3a2af08b4a9640294daa272f  threadweaver-5.101.0.tar.xz
7e7309adfe46cc168ee35a79e29d1849  kauth-5.101.0.tar.xz
7fa25bc8d094f3aa300864437361c715  kcompletion-5.101.0.tar.xz
b006a7888c619272fdaebd1192b1b195  kcrash-5.101.0.tar.xz
885498a3a07d448d4a76c6f4f33c5643  kdoctools-5.101.0.tar.xz
e62f507a5615974663da4b9969bf3bec  kpty-5.101.0.tar.xz
428b959b65e0554ab52b7936348110e8  kunitconversion-5.101.0.tar.xz
60bb6220e81269526975f07a50af534c  kconfigwidgets-5.101.0.tar.xz
be74b473295adb65022b68bbb261387b  kservice-5.101.0.tar.xz
5881eb04a6c1e2c7f1b0c1c7c9756c90  kglobalaccel-5.101.0.tar.xz
67891a31b5642865b90f39eeff0c7d67  kpackage-5.101.0.tar.xz
2a9642691c9c2503165a6af1b688cb7a  kdesu-5.101.0.tar.xz
aa1a62de293c14fad711e7db33b08c97  kemoticons-5.101.0.tar.xz
efeb8383250954c291d7985ccb01091a  kiconthemes-5.101.0.tar.xz
ca997d3349a1f312e8051bd8b55a85db  kjobwidgets-5.101.0.tar.xz
876831c19fe0e66d4b27de516ad6bd41  knotifications-5.101.0.tar.xz
d2cbcf9966f472a54827ef23d17d37c5  ktextwidgets-5.101.0.tar.xz
4354cdc69757bd9695084daefffa8f0d  kxmlgui-5.101.0.tar.xz
8f7b11b9c7e3a319fd81f2fb80cd12fa  kbookmarks-5.101.0.tar.xz
5cde3972bfe496c31e6d26c45f8cbd55  kwallet-5.101.0.tar.xz
341e5c4786c51aab9da709f9ccedace9  kded-5.101.0.tar.xz
b3f13364ce4c94163afac024ac5aa3a4  kio-5.101.0.tar.xz
d9d37abe187906604b1c07d4019042ea  kdeclarative-5.101.0.tar.xz
cda417cb24cf5bbfb3a368fbdea1e478  kcmutils-5.101.0.tar.xz
7d421207ba332694c90b6dd9e3577b52  kirigami2-5.101.0.tar.xz
c387dc1ee3d2d7c33811a6640b4682ec  syndication-5.101.0.tar.xz
01ced6f4d475f3423ef7edfd3ead265b  knewstuff-5.101.0.tar.xz
29df1e203ed9f00e7b4980169efcb863  frameworkintegration-5.101.0.tar.xz
ba872350c6c2f6dcbc7980d724426b86  kinit-5.101.0.tar.xz
c321446c771a416f3b1db518d5fa0a19  kparts-5.101.0.tar.xz
008da6c3a624531915b1e8057c04d4b2  kactivities-5.101.0.tar.xz
#ad4fb163c3b10dd1a6dd62eeea5afdcc  kdewebkit-5.101.0.tar.xz
4c206cea70f899fa01cd48daeb5df76d  syntax-highlighting-5.101.0.tar.xz
be99ceae9a93fb4c14fb7511f6e397d7  ktexteditor-5.101.0.tar.xz
67e0a767aada6593f0ec414dc7140d34  kdesignerplugin-5.101.0.tar.xz
9424f989d07126b2dda5d4e416cd35fc  kwayland-5.101.0.tar.xz
77d731dedc7a7da106ecf2dcb7f0185c  plasma-framework-5.101.0.tar.xz
#403543d8c14947135b9705fde7365c83  modemmanager-qt-5.101.0.tar.xz
d8c1fe3563bc1bb80ee2b729fb57d28e  kpeople-5.101.0.tar.xz
83729946f2ef3cfe5140b56312b0de78  kxmlrpcclient-5.101.0.tar.xz
6e4296f6e70b2443285edb0259c7f766  bluez-qt-5.101.0.tar.xz
1ee27a9a46dcd38099eb943f9bdf8888  kfilemetadata-5.101.0.tar.xz
33ae3ad511db114a9b69eb8da2b26677  baloo-5.101.0.tar.xz
#fd0d088682c5597d0bf0890dab56fd83  breeze-icons-5.101.0.tar.xz
#49a0e7efa4c325a7907f4421be1acd14  oxygen-icons5-5.101.0.tar.xz
cd8354282540594dde1661c7fdeebb51  kactivities-stats-5.101.0.tar.xz
0e43ac9aedb01e7565bd96854d308e8a  krunner-5.101.0.tar.xz
c25f2ab8ef0b7d315e3b9f640ffb1dc0  prison-5.101.0.tar.xz
8ccce54834e04decd274a732110878d4  qqc2-desktop-style-5.101.0.tar.xz
21159b2dee3f985063fb8b94caa68999  kjs-5.101.0.tar.xz
f4854856b54c28d71e51dea512485b2a  kdelibs4support-5.101.0.tar.xz
c4ede3338a03349d1a7ae90e1746b18c  khtml-5.101.0.tar.xz
11733a079fcd9431d22c6c36dfdfa1c8  kjsembed-5.101.0.tar.xz
aa16c24318f79b7e5c1f19db6086db14  kmediaplayer-5.101.0.tar.xz
4cea90b5e8b4badd82b28c3756affd1a  kross-5.101.0.tar.xz
cf9d3fc6a85301cc043ded35b9e9c859  kholidays-5.101.0.tar.xz
07c85066d41aa72bc1124edffe13f2f5  purpose-5.101.0.tar.xz
ed07dae20d9b8d829de99616d321b0fb  kcalendarcore-5.101.0.tar.xz
51e3491915ccf12ec6b7cbbaf168a2ed  kcontacts-5.101.0.tar.xz
7bb958822d0c6090502d0f1110e6f201  kquickcharts-5.101.0.tar.xz
506aeb414202a910d56cb8f4d6bfa5c2  knotifyconfig-5.101.0.tar.xz
d595ea2c824ac87a6104e7d767f39a73  kdav-5.101.0.tar.xz
EOF

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.101.0 and oxygen-icons5-5.101.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

[Note]

Note

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.12p2 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.

as_root()
{
  if   [ $EUID = 0 ];        then $*
  elif [ -x /usr/bin/sudo ]; then sudo $*
  else                            su -c \\"$*\\"
  fi
}

export -f as_root
[Caution]

Caution

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

      # kapidox is a python module
      case $name in
        kapidox)
          pip3 wheel -w dist --no-build-isolation --no-deps $PWD
          as_root pip3 install --no-index --find-links dist --no-cache-dir --no-user kapidox
          popd
          rm -rf $packagedir
          continue
      esac

      mkdir build
      cd    build

      cmake -DCMAKE_INSTALL_PREFIX=$KF5_PREFIX \
            -DCMAKE_PREFIX_PATH=$QT5DIR        \
            -DCMAKE_BUILD_TYPE=Release         \
            -DBUILD_TESTING=OFF                \
            -Wno-dev ..
      make
      as_root make install
    popd

  as_root rm -rf $packagedir
  as_root /sbin/ldconfig

done < frameworks-5.101.0.md5

exit
[Note]

Note

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.101.0
ln -sfvn kf5-5.101.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.

Contents

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: libkdeinit5_klauncher.so, libKF5Activities.so, libKF5ActivitiesStats.so, libKF5Archive.so, libKF5Attica.so, libKF5AuthCore.so, libKF5Auth.so, libKF5Baloo.so, libKF5BluezQt.so, libKF5Bookmarks.so, libKF5CalendarCore.so, libKF5CalendarEvents.so, libKF5Codecs.so, libKF5Completion.so, libKF5ConfigCore.so, libKF5ConfigGui.so, libKF5ConfigWidgets.so, libKF5Contacts.so, libKF5CoreAddons.so, libKF5Crash.so, libKF5DAV.so, libKF5DBusAddons.so, libKF5Declarative.so, libKF5DNSSD.so, libKF5DocTools.so, libKF5Emoticons.so, libKF5FileMetaData.so, libKF5GlobalAccel.so, libKF5GuiAddons.so, libKF5Holidays.so, libKF5I18n.so, libKF5IconThemes.so, libKF5IdleTime.so, libKF5ItemModels.so, libKF5ItemViews.so, libKF5JobWidgets.so, libKF5JSApi.so, libKF5JsEmbed.so, libKF5JS.so, libKF5KCMUtils.so, libKF5KDELibs4Support.so, libKF5KHtml.so, libKF5KIOCore.so, libKF5KIOFileWidgets.so, libKF5KIOGui.so, libKF5KIONTLM.so, libKF5KIOWidgets.so, libKF5Kirigami2.so, libKF5KrossCore.so, libKF5KrossUi.so, libKF5MediaPlayer.so, libKF5NetworkManagerQt.so, libKF5NewStuffCore.so, libKF5NewStuff.so, libKF5Notifications.so, libKF5NotifyConfig.so, libKF5Package.so, libKF5Parts.so, libKF5PeopleBackend.so, libKF5People.so, libKF5PeopleWidgets.so, libKF5PlasmaQuick.so, libKF5Plasma.so, libKF5Plotting.so, libKF5Prison.so, libKF5Pty.so, libKF5Purpose.so, libKF5PurposeWidgets.so, libKF5QuickAddons.so, libKF5Runner.so, libKF5Service.so, libKF5Solid.so, libKF5SonnetCore.so, libKF5SonnetUi.so, libKF5Style.so, libKF5Su.so, libKF5SyntaxHighlighting.so, libKF5TextEditor.so, libKF5TextWidgets.so, libKF5ThreadWeaver.so, libKF5UnitConversion.so, libKF5Wallet.so, libKF5WaylandClient.so, libKF5WaylandServer.so, libKF5WidgetsAddons.so, libKF5WindowSystem.so, libKF5XmlGui.so, libKF5XmlRpcClient.so, and libkwalletbackend5.so
Installed Directories: /opt/kf5 (symlink to /opt/kf5-5.101.0) if installing in /opt

Short Descriptions

checkXML5

is a tool to check for syntax errors in KDE DocBook XML files

depdiagram-generate

is a tool to generate a dependency diagram

depdiagram-generate-all

is a tool to generate a dependency diagram for all frameworks at once

depdiagram-prepare

is a tool to prepare dot files

desktoptojson

is a tool to convert a .desktop file to a .json file

kbuildsycoca5

rebuilds the KService desktop file system configuration cache

kcookiejar5

is a command line interface to the HTTP cookie store used by KDE, a D-BUS service to store/retrieve/clean cookies

kded5

consolidates several small services in one process

kdeinit5

is a process launcher somewhat similar to the famous init used for booting UNIX

kf5-config

is a command line program used to retrieve information about KDE installation or user paths

kf5kross

executes kross scripts written in KDE Javascript, Python, Ruby, Java and Falcon

kgendesignerplugin

generates widget plugins for Qt(TM) Designer

kglobalaccel5

is a daemon use to register the key bindings and for getting notified when the action triggered

kjs5

is KDE ECMAScript/JavaScript engine

kjscmd5

is a tool for launching KJSEmbed scripts from the command line

kjsconsole

is a console for kjs5

kpackagelauncherqml

is a commandline tool for launching kpackage QML application

kpackagetool5

is a command line kpackage tool

kreadconfig5

is a command line tool to retrieve values from KDE configuration files

kshell5

start applications via kdeinit

ktelnetservice5

is a telnet service

ktrash5

is a helper program to handle the KDE trash can

kwalletd5

is the wallet manager daemon

kwriteconfig5

is a command line tool to write values in KDE configuration files

meinproc5

converts DocBook files to HTML

plasmapkg2

is a tool to install, list, remove Plasma packages

preparetips5

is a script to extract the text from a tips file

solid-hardware5

is a command line tool to investigate available devices