#### Beyond Linux® From Scratch (systemd Edition) - Version r12.0-1685

### Chapter 30. KDE Frameworks 5

- Prev

  KDE Frameworks 5 Pre-installation Configuration

- Next

  KDE Frameworks 5 Based Applications

- Up
- Home

# 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 12.1 platform.

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

### Package Information

- Download (HTTP): https://download.kde.org/stable/frameworks/5.115

- Download MD5 sum: See Below

- Download size: 347 MB

- Estimated disk space required: 2.5 GB (252 MB installed)

- Estimated build time: 7.4 SBU (using parallelism=4)

### KF5 Dependencies

#### Required

Boost-1.84.0, extra-cmake-modules-5.115.0, docbook-xml-4.5, docbook-xsl-nons-1.79.2, giflib-5.2.1, libepoxy-1.5.10, libgcrypt-1.10.3, libical-3.0.17, libjpeg-turbo-3.0.1, libpng-1.6.42, libxslt-1.1.39, lmdb-0.9.31, qca-2.3.8, qrencode-4.1.1, phonon-4.12.0, plasma-wayland-protocols-1.12.0, shared-mime-info-2.4, URI-5.27, and Wget-1.21.4 (required to download the packages)

#### Recommended

Aspell-0.60.8.1 (Dictionary backend for Sonnet), Avahi-0.8 (DNS-SD backend for KDNSSD), libdbusmenu-qt-0.9.3+16.04.20160218 (built with qt5), ModemManager-1.18.12 (needed to build ModemManager-Qt), NetworkManager-1.44.2 (needed to build NetworkManager-Qt), PCRE-8.45, and polkit-qt-0.114.0 (Authentication backend for KAuth)

Furthermore, the instructions below assume that the environment has been set up as described in Introduction to KF5.

#### Optional

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

#### Runtime dependency for FrameworkIntegration

Noto fonts

#### Additional recommended dependencies for kapidox

Doxygen-1.10.0 (Run time), doxypypy-0.8.8.7, doxyqml-0.5.3, PyYAML-6.0.1, and requests-2.31.0

#### Additional image formats support in KImageFormats

JasPer-4.2.0, libavif-1.0.4, libraw-0.21.2, libheif, libjxl, and OpenEXR

#### Optional dependencies for KIO

MIT Kerberos V5-1.21.2

#### Optional dependencies for Solid

UDisks-2.10.1, UPower-1.90.2 and media-player-info (runtime)

#### Optional dependency for KWallet

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

#### Optional dependency for kdewebkit

QtWebkit

#### Optional dictionary backends for Sonnet

Hspell and Hunspell

## 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.115/
    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.115.0.md5 << "EOF"
    28643b6e6d1883390ba8cc138f98e4e0  attica-5.115.0.tar.xz
    #125bbaa9cd2853caf029b67b48a3b3d9  extra-cmake-modules-5.115.0.tar.xz
    6db6b6fef4a89e40a97cfaf121b7bb39  kapidox-5.115.0.tar.xz
    0c22e60234f50e95d76a45d6a8135bba  karchive-5.115.0.tar.xz
    c87402505994a05fbf4c368a22016ef5  kcodecs-5.115.0.tar.xz
    fcb77cb2d9349b33e9e085ca4d2ebe7f  kconfig-5.115.0.tar.xz
    159559a9fcc0812b4145acdd073a73d7  kcoreaddons-5.115.0.tar.xz
    8c5b4a9555618c620a2e94a5d45798df  kdbusaddons-5.115.0.tar.xz
    2327fbcd8dea339ca3ef24b889a71e63  kdnssd-5.115.0.tar.xz
    c89c04e2ec19cab40c023f70e58dc941  kguiaddons-5.115.0.tar.xz
    50ba903da49c6b9acf8d2e3881164787  ki18n-5.115.1.tar.xz
    #abe7fcdfce4a066fdef6236ab15d11b2  ki18n-5.115.0.tar.xz
    1bf59dbd22248f150f3b9c977af8b51f  kidletime-5.115.0.tar.xz
    63e0fd1101429ab4dd94130074e732bb  kimageformats-5.115.0.tar.xz
    49a623828ead35d4fa2d3255bbdca470  kitemmodels-5.115.0.tar.xz
    c134615e17dd472b93230f6712f9f01b  kitemviews-5.115.0.tar.xz
    a4ff537eb676fc53db9b3b7b8ecdc2ac  kplotting-5.115.0.tar.xz
    148cb8009939e1ae53928d0d75111efb  kwidgetsaddons-5.115.0.tar.xz
    7ff6c4358016468807c4d8c9ab9e0f5e  kwindowsystem-5.115.0.tar.xz
    ec9afc8825fe4ffed7fdc69954682bd3  networkmanager-qt-5.115.0.tar.xz
    4bc3f8554b526f0e39d8c2a6f228a988  solid-5.115.0.tar.xz
    fe0e704f92fd43e6748ace4146616ef3  sonnet-5.115.0.tar.xz
    4115012f00ffed36c9939f23cfb677ea  threadweaver-5.115.0.tar.xz
    637f364c6e5ce6fbbca7a14e56f04c64  kauth-5.115.0.tar.xz
    f0c3fc3ad2f0ad70c612d672d0ecb980  kcompletion-5.115.0.tar.xz
    e4d7458f0df9c5adbe4e01dc2c917839  kcrash-5.115.0.tar.xz
    bb297f2112003546b94c89c705578316  kdoctools-5.115.0.tar.xz
    4efa94dabf55b53594a44efce08af107  kpty-5.115.0.tar.xz
    c01766f3867f156ae2869031be469a5f  kunitconversion-5.115.0.tar.xz
    22f355d87607bc76b9257724048ca73e  kconfigwidgets-5.115.0.tar.xz
    1fc0908df48b8041271b88350b1f59f0  kservice-5.115.0.tar.xz
    97f8e0b90a7c2ae352a9c6b3442e1a1f  kglobalaccel-5.115.0.tar.xz
    e4bbae93076e4cc5f1f05c555d982837  kpackage-5.115.0.tar.xz
    871278a972963eb6242688de2c3abc2e  kdesu-5.115.0.tar.xz
    2c2978ff806b9a4a3e7eed141e7fae06  kemoticons-5.115.0.tar.xz
    818c95b686e9257db6b4cdf007e2c49b  kiconthemes-5.115.0.tar.xz
    e7bcd0c302c603e51ec20f9777ba1c0b  kjobwidgets-5.115.0.tar.xz
    e3951d19de26c6b83e0fd2dc46b9ed55  knotifications-5.115.0.tar.xz
    94a3182125744d25654f2c507dea6614  ktextwidgets-5.115.0.tar.xz
    30270996c70d97fbda952aa2f822339f  kxmlgui-5.115.0.tar.xz
    ae18d83dae4dd64ab4a728d26a6d79de  kbookmarks-5.115.0.tar.xz
    1101eaf6d63a1c873cf21ee091821592  kwallet-5.115.0.tar.xz
    4bc257fbce10119918d48593b203cf2e  kded-5.115.0.tar.xz
    502f27350ad2538c843c6bdf4031ef8a  kio-5.115.0.tar.xz
    934c4f217a34a44a82704be7f47a6ef6  kdeclarative-5.115.0.tar.xz
    011fc001cffe0fd611ea516ced255578  kcmutils-5.115.0.tar.xz
    a6b54d0321cecb9b9ce4fe8bdc2bdf75  kirigami2-5.115.0.tar.xz
    0b47f08e5502871d9d7a483b75bb6ac4  syndication-5.115.0.tar.xz
    32e234371b5454850f17441d15b5748e  knewstuff-5.115.0.tar.xz
    c1cc6f7cb0b35ec6e1ef691ec4b1943b  frameworkintegration-5.115.0.tar.xz
    7ae60737e857a72bf8af9859a65886f0  kinit-5.115.0.tar.xz
    a1593f1c8024c1287b44e0035d00f2c6  kparts-5.115.0.tar.xz
    b7b6252b2414fb108617f8cf73f0a810  kactivities-5.115.0.tar.xz
    #dd11151488180073a39557afa9a1907e  kdewebkit-5.115.0.tar.xz
    813461682389193e4fd0e589ffad866b  syntax-highlighting-5.115.0.tar.xz
    e30c868032b7d722b75695b8f1eae46b  ktexteditor-5.115.0.tar.xz
    474caf85f2b192e7f2bb68cce60aa273  kdesignerplugin-5.115.0.tar.xz
    5031ae48f5214293ca8484e719a78895  kwayland-5.115.0.tar.xz
    553e0499f311ad2cf96177e3e76abf64  plasma-framework-5.115.0.tar.xz
    45d49e1ef3d42dc35fe07c36a45c612e  modemmanager-qt-5.115.0.tar.xz
    a21b59445d190328cad46c6e8d5e48b0  kpeople-5.115.0.tar.xz
    76e6ec2b6740ec77ff958fbe86d40932  kxmlrpcclient-5.115.0.tar.xz
    872b72db316483eb4fcfb013de091403  bluez-qt-5.115.0.tar.xz
    27eee2497d1e878693cd4cbeaf571379  kfilemetadata-5.115.0.tar.xz
    d145b146adf0ae1d3c104d17a79e156a  baloo-5.115.0.tar.xz
    #8a90f95057b7ab8ab03f3e4140b7adff  breeze-icons-5.115.0.tar.xz
    #98931250d009db3750132d74447a030a  oxygen-icons-5.115.0.tar.xz
    7f2a7726a6bba2f0a9c0474175fc69f6  kactivities-stats-5.115.0.tar.xz
    021a50470de1860b96bc5edb8f3ef11c  krunner-5.115.0.tar.xz
    abf08dfa6dd1d274e7834964e5cd23c5  prison-5.115.0.tar.xz
    476bf46c139885de38b717e229f9a39d  qqc2-desktop-style-5.115.0.tar.xz
    7af70230b69f0de4bb76c585b2af5733  kjs-5.115.0.tar.xz
    51d2788c1bff19b532d4208dd5e778a2  kdelibs4support-5.115.0.tar.xz
    d11bceb4cb9104d900a90708d6197bed  khtml-5.115.0.tar.xz
    97bdb8d6a40d3dd499e1fb1297656f97  kjsembed-5.115.0.tar.xz
    795fcee43ff4be908389f60942e8cba3  kmediaplayer-5.115.0.tar.xz
    95fef271cb5197f9a0f009e41e2072c9  kross-5.115.0.tar.xz
    06ab59b2662a0ddb5b77b0cc43173b7d  kholidays-5.115.0.tar.xz
    27623b7ac58f7ed7d0a42208dc18aad2  purpose-5.115.0.tar.xz
    ffacabefa59d96ac6d2fef1f9d33176f  kcalendarcore-5.115.0.tar.xz
    ea0c60ec29421be2c26be53b0f6d135e  kcontacts-5.115.0.tar.xz
    6ae56540d6d56086701a5dc130917e32  kquickcharts-5.115.0.tar.xz
    0fdec6499fe1bfdf5ba509d0d9874f0a  knotifyconfig-5.115.0.tar.xz
    7ec159103a24ed3d72b4680de952db20  kdav-5.115.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 ki18n-5.115.0 package has been replaced by ki18n-5.115.1. The icon packages are covered separately at breeze-icons-5.115.0 and oxygen-icons-5.115.0. The kdewebkit package may be built if the external package QtWebkit has been built.

## Installation of KDE Frameworks

### 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.15p5 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

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 --no-cache-dir $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.115.0.md5

    exit

### 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.115.0
    ln -sfvn kf5-5.115.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.115.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

- Prev

  KDE Frameworks 5 Pre-installation Configuration

- Next

  KDE Frameworks 5 Based Applications

- Up
- Home