Building KDE Frameworks 6.5.0 (KF6)

#### Beyond Linux® From Scratch (systemd Edition) - Version 12.2

### Chapter 30. KDE Frameworks 6

- Prev

  KDE Frameworks 6 Pre-installation Configuration

- Next

  KDE Frameworks 6 Based Applications

- Up
- Home

# Building KDE Frameworks 6.5.0 (KF6)

KDE Frameworks is a collection of libraries based on top of Qt6 and QML derived from the previous KDE libraries. They can be used independent of the KDE Display Environment (Plasma 6).

This package is known to build and work properly using an LFS 12.2 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/6.5

- Download MD5 sum: See Below

- Download size: 99 MB

- Estimated disk space required: 2.6 GB (183 MB installed)

- Estimated build time: 18 SBU (using parallelism=8)

### KF6 Dependencies

#### Required

extra-cmake-modules-6.5.0, breeze-icons-6.5.0, docbook-xml-4.5, docbook-xsl-nons-1.79.2, libcanberra-0.30, libgcrypt-1.11.0, libical-3.0.18, libxslt-1.1.42, lmdb-0.9.31, qca-2.3.9, qrencode-4.1.1, plasma-wayland-protocols-1.13.0, PyYAML-6.0.2, shared-mime-info-2.4, URI-5.28, and Wget-1.24.5 (required to download the packages)

#### Recommended

Aspell-0.60.8.1 (Dictionary backend for Sonnet), Avahi-0.8 (DNS-SD backend for KDNSSD), ModemManager-1.18.12 (needed to build ModemManager-Qt), NetworkManager-1.48.8 (needed to build NetworkManager-Qt), polkit-qt-0.200.0 (Authentication backend for KAuth), and Vulkan-Loader-1.3.294 (Add support for Vulkan graphics drivers)

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

#### Optional

BlueZ-5.77 (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.12.0 (Run time), doxypypy-0.8.8.7, doxyqml-0.5.3, and requests-2.32.3

#### Additional image formats support in KImageFormats

libavif-1.1.1, libjxl-0.10.3, libraw-0.21.2, libheif, OpenEXR

#### Optional dependencies for Solid

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

#### Optional dependency for KWallet

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

#### 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/6.5/
    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-6.5.0.md5 << "EOF"
    9f93da02571dc32c0c39db4911546731  attica-6.5.0.tar.xz
    #bceea430e534852558b54f4bd3354474  extra-cmake-modules-6.5.0.tar.xz
    05e0a1b09e3abb81068e4614f7e9b4a5  kapidox-6.5.0.tar.xz
    77c9c2100e36a44714c665644a4773c3  karchive-6.5.0.tar.xz
    facb9708090a0eb54a3f6c22f2baa86e  kcodecs-6.5.0.tar.xz
    698ab95acdc713571f917bb70073e2df  kconfig-6.5.0.tar.xz
    ab4868788299d29e9016bc57be64b6e6  kcoreaddons-6.5.0.tar.xz
    763aa4bc47b19a4b7471eca628be7e8a  kdbusaddons-6.5.0.tar.xz
    a30dc9bc14f6f2c2316a252e1f6ee7b7  kdnssd-6.5.0.tar.xz
    e23c576829b3a35631b729a3826eb381  kguiaddons-6.5.0.tar.xz
    54d5c5dc203772577b6e01e7704f23d2  ki18n-6.5.0.tar.xz
    fb7a5aec22e99bc69d4c4d50ee418dd5  kidletime-6.5.0.tar.xz
    6751e1b3b08bfd34b7f791f90419796a  kimageformats-6.5.0.tar.xz
    5fd3404f7197097a23d2db7cd776432e  kitemmodels-6.5.0.tar.xz
    6b6f3cd08284cef4c7bed3d31c5735a4  kitemviews-6.5.0.tar.xz
    0a33080b08df165501d065eb0ccbb4d6  kplotting-6.5.0.tar.xz
    ff9f14101fe8bb6686cc3bc8e1d352f7  kwidgetsaddons-6.5.0.tar.xz
    5631073e18780513a3005159dd73e290  kwindowsystem-6.5.0.tar.xz
    579eea31abc156e82cc4b746d212f4d2  networkmanager-qt-6.5.0.tar.xz
    712a3c59785bd0de4862cce34de58e4c  solid-6.5.0.tar.xz
    afe1cc49342b0b78993172c8a9e1dc20  sonnet-6.5.0.tar.xz
    b9df82b41676d91ea0371bd61e6082d0  threadweaver-6.5.0.tar.xz
    952c44490af601ebd58cae56a5c38481  kauth-6.5.0.tar.xz
    1db39b1e20b31bbff7d2079e9856b067  kcompletion-6.5.0.tar.xz
    104bcce4ba8d7d5936ffb4be66762ff0  kcrash-6.5.0.tar.xz
    43dfbda305f57ae0cda57091202d034a  kdoctools-6.5.0.tar.xz
    b39dc81ffbea67c69a1e9e41e6c4acb5  kpty-6.5.0.tar.xz
    f721e794c896d48f4143bf8054f471d0  kunitconversion-6.5.0.tar.xz
    5f37c1b7b58d13109f9d77f2f47610a0  kcolorscheme-6.5.0.tar.xz
    3da8c7755a7207ce332775f7bea879a9  kconfigwidgets-6.5.0.tar.xz
    36af7db35be0bdae9d9ae10d67ea1b1f  kservice-6.5.0.tar.xz
    51be7e11487b2d3ef3a35bdd2d3eec74  kglobalaccel-6.5.0.tar.xz
    1bc8471d498ad3de7c144bcac545ab29  kpackage-6.5.0.tar.xz
    c12d163df68d8aaee566618c2b886fe0  kdesu-6.5.0.tar.xz
    a94b4e76eff97c0e2fe461e10535cf11  kiconthemes-6.5.0.tar.xz
    f75c675a77172fd1cb8eaee62086fd93  knotifications-6.5.0.tar.xz
    878a3dc9bb42497d6c6b3f9744372635  kjobwidgets-6.5.0.tar.xz
    ea43454373673b7dfdc928609b80fbf1  ktextwidgets-6.5.0.tar.xz
    7aef61c37386c5750f83a438fc140453  kxmlgui-6.5.0.tar.xz
    11f331d02cd2f542cfa5be32f3c780dd  kbookmarks-6.5.0.tar.xz
    fe89e3850dfe0200c3ee04e0bcf0ea86  kwallet-6.5.0.tar.xz
    dadc7cc6e488d1db9b8dc482e89f07a7  kded-6.5.0.tar.xz
    0f2bd915931d6501c212ff3c84433126  kio-6.5.0.tar.xz
    7ef47616f65781126b29f3ff7c6637d4  kdeclarative-6.5.0.tar.xz
    3478698203e69dc14ca9a8fe58b6263c  kcmutils-6.5.0.tar.xz
    82ff71c1903a2d205b873e0b04715839  kirigami-6.5.0.tar.xz
    39559a047c8da6aba78ba1d619353808  syndication-6.5.0.tar.xz
    a6d662cf3920c575bb2fb7541c33f691  knewstuff-6.5.0.tar.xz
    cb414562458340f793878c5a2b328af8  frameworkintegration-6.5.0.tar.xz
    bad702d8866893c19339eab1b65c9c24  kparts-6.5.0.tar.xz
    16874e76c5058e1943d04bc3bf512f03  syntax-highlighting-6.5.0.tar.xz
    fbe2608ded4b47a1e7974c92d458596a  ktexteditor-6.5.0.tar.xz
    7dc07ea6306795a866e4ef62e03b54da  modemmanager-qt-6.5.0.tar.xz
    ca118c3fa1d01c5e98290475a4ef341d  kcontacts-6.5.0.tar.xz
    ab5907924e9e35d8f328a66a5fa241ad  kpeople-6.5.0.tar.xz
    124cf04998f0399a300baa585a01db6b  bluez-qt-6.5.0.tar.xz
    f5d8507325dce3768b77e2565f3e70d7  kfilemetadata-6.5.0.tar.xz
    00951e5fd64e184f5e1d4bc3e71f28a2  baloo-6.5.0.tar.xz
    #25c0a753edc62593ecca9f56a34f7ef1  breeze-icons-6.5.0.tar.xz
    940fe29e162175c932475ed20f241979  krunner-6.5.0.tar.xz
    4598c42a8a4e1a93457cb2aebd392bb2  prison-6.5.0.tar.xz
    c2eb5204f9f7b43798566666b06fa3ae  qqc2-desktop-style-6.5.0.tar.xz
    612f5190aebd9d4c89122113fd97e73e  kholidays-6.5.0.tar.xz
    9c92e566404c25c2bd142c8c5937441f  purpose-6.5.0.tar.xz
    5bf4fa5abc19addec2ab47440c0b660e  kcalendarcore-6.5.0.tar.xz
    2f3150f1162013f6c089dd9c48358a58  kquickcharts-6.5.0.tar.xz
    9e3db7659cfe0735461d64bb959a115f  knotifyconfig-6.5.0.tar.xz
    780193271545a8f7add8a171effcb36c  kdav-6.5.0.tar.xz
    78b6317709ad47539b4728b22618379f  kstatusnotifieritem-6.5.0.tar.xz
    7bb7d7f6ff6a4d41e81389dba5982fac  ksvg-6.5.0.tar.xz
    f24694fc1e66236182cf41f1f8a789e2  ktexttemplate-6.5.0.tar.xz
    52e318daedfd8b855e0554f66041535a  kuserfeedback-6.5.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 package is covered separately at breeze-icons-6.5.0.

## 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/kf6 either as a regular directory or a symbolic link, it should be reinitialized (as `root`):

    mv -v /opt/kf6 /opt/kf6.old                         &&
    install -v -dm755           $KF6_PREFIX/{etc,share} &&
    ln -sfv /etc/dbus-1         $KF6_PREFIX/etc         &&
    ln -sfv /usr/share/dbus-1   $KF6_PREFIX/share       &&
    ln -sfv /usr/share/polkit-1 $KF6_PREFIX/share       &&
    install -v -dm755           $KF6_PREFIX/lib         &&
    ln -sfv /usr/lib/systemd    $KF6_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|-6.*$||') # 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 -D CMAKE_INSTALL_PREFIX=$KF6_PREFIX \
                -D CMAKE_INSTALL_LIBEXECDIR=libexec \
                -D CMAKE_PREFIX_PATH=$QT6DIR        \
                -D CMAKE_SKIP_INSTALL_RPATH=ON      \
                -D CMAKE_BUILD_TYPE=Release         \
                -D BUILD_TESTING=OFF                \
                -W no-dev ..
          make
          as_root make install
        popd

      as_root rm -rf $packagedir
      as_root /sbin/ldconfig

    done < frameworks-6.5.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/kf6 /opt/kf6-6.5.0
    ln -sfvn kf6-6.5.0 /opt/kf6

## Command Explanations

`-D CMAKE_PREFIX_PATH=$QT6DIR`: This switch is used to allow cmake to find the proper Qt libraries.

`-D CMAKE_BUILD_TYPE=Release`: This switch is used to apply higher level of the compiler optimizations.

`-D BUILD_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, checkXML6, depdiagram-generate, depdiagram-generate-all, depdiagram-prepare, desktoptojson, gentrigrams, kactivities-cli, kapidox_generate, kate-syntax-highlighter, kbuildsycoca6, kcookiejar6, kdebugdialog6, kded6, kdeinit6, kdeinit6_shutdown, kdeinit6_wrapper, kf6-config, kf6kross, kgendesignerplugin, kglobalaccel6, kiconfinder6, kjs6, kjscmd6, kjsconsole, knewstuff-dialog, kpackagelauncherqml, kpackagetool6, kquitapp6, kreadconfig6, kshell6, ktelnetservice6, ktrash6, kwalletd6, kwallet-query, kwrapper6, kwriteconfig6, meinproc6, parsetrigrams, plasmapkg2, preparetips6, protocoltojson, and solid-hardware6
Installed Libraries: libkdeinit6_klauncher.so, libKF6Activities.so, libKF6ActivitiesStats.so, libKF6Archive.so, libKF6Attica.so, libKF6AuthCore.so, libKF6Auth.so, libKF6Baloo.so, libKF6BluezQt.so, libKF6Bookmarks.so, libKF6CalendarCore.so, libKF6CalendarEvents.so, libKF6Codecs.so, libKF6Completion.so, libKF6ConfigCore.so, libKF6ConfigGui.so, libKF6ConfigWidgets.so, libKF6Contacts.so, libKF6CoreAddons.so, libKF6Crash.so, libKF6DAV.so, libKF6DBusAddons.so, libKF6Declarative.so, libKF6DNSSD.so, libKF6DocTools.so, libKF6Emoticons.so, libKF6FileMetaData.so, libKF6GlobalAccel.so, libKF6GuiAddons.so, libKF6Holidays.so, libKF6I18n.so, libKF6IconThemes.so, libKF6IdleTime.so, libKF6ItemModels.so, libKF6ItemViews.so, libKF6JobWidgets.so, libKF6JSApi.so, libKF6JsEmbed.so, libKF6JS.so, libKF6KCMUtils.so, libKF6KDELibs4Support.so, libKF6KHtml.so, libKF6KIOCore.so, libKF6KIOFileWidgets.so, libKF6KIOGui.so, libKF6KIONTLM.so, libKF6KIOWidgets.so, libKF6Kirigami2.so, libKF6KrossCore.so, libKF6KrossUi.so, libKF6MediaPlayer.so, libKF6NetworkManagerQt.so, libKF6NewStuffCore.so, libKF6NewStuff.so, libKF6Notifications.so, libKF6NotifyConfig.so, libKF6Package.so, libKF6Parts.so, libKF6PeopleBackend.so, libKF6People.so, libKF6PeopleWidgets.so, libKF6PlasmaQuick.so, libKF6Plasma.so, libKF6Plotting.so, libKF6Prison.so, libKF6Pty.so, libKF6Purpose.so, libKF6PurposeWidgets.so, libKF6QuickAddons.so, libKF6Runner.so, libKF6Service.so, libKF6Solid.so, libKF6SonnetCore.so, libKF6SonnetUi.so, libKF6Style.so, libKF6Su.so, libKF6SyntaxHighlighting.so, libKF6TextEditor.so, libKF6TextWidgets.so, libKF6ThreadWeaver.so, libKF6UnitConversion.so, libKF6Wallet.so, libKF6WaylandClient.so, libKF6WaylandServer.so, libKF6WidgetsAddons.so, libKF6WindowSystem.so, libKF6XmlGui.so, libKF6XmlRpcClient.so, and libkwalletbackend6.so
Installed Directories: /opt/kf6 (symlink to /opt/kf6-6.5.0) if installing in /opt

### Short Descriptions

checkXML6 | 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
kbuildsycoca6 | rebuilds the KService desktop file system configuration cache
kcookiejar6 | is a command line interface to the HTTP cookie store used by KDE, a D-BUS service to store/retrieve/clean cookies
kded6 | consolidates several small services in one process
kdeinit6 | is a process launcher somewhat similar to the famous init used for booting UNIX
kf6-config | is a command line program used to retrieve information about KDE installation or user paths
kf6kross | executes kross scripts written in KDE Javascript, Python, Ruby, Java and Falcon
kgendesignerplugin | generates widget plugins for Qt(TM) Designer
kglobalaccel6 | is a daemon use to register the key bindings and for getting notified when the action triggered
kjs6 | is KDE ECMAScript/JavaScript engine
kjscmd6 | is a tool for launching KJSEmbed scripts from the command line
kjsconsole | is a console for kjs6
kpackagelauncherqml | is a commandline tool for launching kpackage QML application
kpackagetool6 | is a command line kpackage tool
kreadconfig6 | is a command line tool to retrieve values from KDE configuration files
kshell6 | start applications via kdeinit
ktelnetservice6 | is a telnet service
ktrash6 | is a helper program to handle the KDE trash can
kwalletd6 | is the wallet manager daemon
kwriteconfig6 | is a command line tool to write values in KDE configuration files
meinproc6 | converts DocBook files to HTML
plasmapkg2 | is a tool to install, list, remove Plasma packages
preparetips6 | is a script to extract the text from a tips file
solid-hardware6 | is a command line tool to investigate available devices

- Prev

  KDE Frameworks 6 Pre-installation Configuration

- Next

  KDE Frameworks 6 Based Applications

- Up
- Home