Building KDE Frameworks 6 (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).

[Note]

Note

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

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

Package Information

KF6 Dependencies

Required

extra-cmake-modules-6.1.0, docbook-xml-4.5, docbook-xsl-nons-1.79.2, libcanberra-0.30, libgcrypt-1.10.3, libical-3.0.18, libxslt-1.1.39, lmdb-0.9.31, qca-2.3.8, qrencode-4.1.1, plasma-wayland-protocols-1.12.0, shared-mime-info-2.4, URI-5.28, and Wget-1.24.5 (required to download the packages)

Recommended

Optional

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

Runtime dependency for FrameworkIntegration

Noto fonts

Additional recommended dependencies for kapidox

Additional image formats support in KImageFormats

libavif-1.0.4, libjxl-0.10.2, 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.1/
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.1.0.md5 << "EOF"
2ea9b1e25d890f1bba27760d8c9b3953  attica-6.1.0.tar.xz
#1109efb1a8e84918f74c2e8e650a049a  extra-cmake-modules-6.1.0.tar.xz
440a8c01da58cfd7e4f857a66cdd3b28  kapidox-6.1.0.tar.xz
145c3ec54b23bdbd6bf8f18fd64868fe  karchive-6.1.0.tar.xz
00be41140dcecc9c6ac823fd27dfc9b7  kcodecs-6.1.0.tar.xz
50c79892fb59a879fa929cc23f377b9c  kconfig-6.1.0.tar.xz
f35bca04c8a22197c5ff0929868cc368  kcoreaddons-6.1.0.tar.xz
8840182685d4a4bb92b9fa8c47574611  kdbusaddons-6.1.0.tar.xz
f9b60ee071ee5b810460d46d60180aa6  kdnssd-6.1.0.tar.xz
1ca4e766eaf6ecc75aa3700bd371280e  kguiaddons-6.1.0.tar.xz
78229a5127e3514369d7267d45069213  ki18n-6.1.0.tar.xz
6305247d06bb9b28b4eaca9bb04c5b8d  kidletime-6.1.0.tar.xz
a9fe7f30eb8dfd289fef060d38bbab7c  kimageformats-6.1.0.tar.xz
854103ad3d8698c4ee947c3255c3a8d1  kitemmodels-6.1.0.tar.xz
e8ce0d5ae9a5ae43602945a0ced68b3d  kitemviews-6.1.0.tar.xz
66811dcda2ad18be2efa7f4e0b07985f  kplotting-6.1.0.tar.xz
4d20beb9c658c24246649dd8f9ec98fb  kwidgetsaddons-6.1.0.tar.xz
0157d6b3717278454e4d4890d37537c7  kwindowsystem-6.1.0.tar.xz
794c4993dbd31cae17ca78ef5c0ccf92  networkmanager-qt-6.1.0.tar.xz
76137f869de9fb084ce8944e320bd19d  solid-6.1.1.tar.xz
5935e8552015db47c311d9ef03bcc377  sonnet-6.1.0.tar.xz
7df40ccb0e87c1a947f67f89ef109ffb  threadweaver-6.1.0.tar.xz
332f96f9356f2b90f8cde116b96cc320  kauth-6.1.0.tar.xz
29d3700496362f61b4af60e73de6253b  kcompletion-6.1.0.tar.xz
5211c51c2c48ce8d42053329ea9a6455  kcrash-6.1.0.tar.xz
00494474335a7a847fbfc0ce9cc32b7b  kdoctools-6.1.0.tar.xz
0eee89e837bd262638b852ee6e8c7c49  kpty-6.1.0.tar.xz
dec360a19f2653bf20d17005d305b73a  kunitconversion-6.1.0.tar.xz
328b11d4dc905bb4dbeb067ea8115a0f  kcolorscheme-6.1.0.tar.xz
6df45f2cbe0607889a557e62b35184ef  kconfigwidgets-6.1.0.tar.xz
7c0750ee394f58cda0d4dd73975309a4  kservice-6.1.0.tar.xz
87312ffd4ee3c805ed67864d9dee4ec3  kglobalaccel-6.1.0.tar.xz
3bc4b0aa05aec8566155aa0bf3317714  kpackage-6.1.0.tar.xz
3293aa08539521b78dde13aef330b043  kdesu-6.1.0.tar.xz
d4f9bab5b8006328a96c5ce05ae61851  kiconthemes-6.1.0.tar.xz
5ff9cc47d71a9111f2960145c3177f08  knotifications-6.1.0.tar.xz
a0801b79ec1f543a64c2fd7d23399a84  kjobwidgets-6.1.0.tar.xz
09029c7d5b7934e2838ae760d87b7ddd  ktextwidgets-6.1.0.tar.xz
d7aa6d7d29197abaa699ad28002c4cc4  kxmlgui-6.1.0.tar.xz
3c6fc85d22238971ad7bcbab77d94b0f  kbookmarks-6.1.0.tar.xz
01f6026145fac0707feb3c744e13bc48  kwallet-6.1.0.tar.xz
f09462c9ef3a243abab31420e3943528  kded-6.1.0.tar.xz
d41f53f00db6b4a2709d9fb24e81ad45  kio-6.1.0.tar.xz
d1552e0c680ebc5b1162f894b6671c7b  kdeclarative-6.1.0.tar.xz
a2a3e33fb573e8bc5e8d49fe789043e9  kcmutils-6.1.0.tar.xz
d052029caf5d6411507d326609292700  kirigami-6.1.0.tar.xz
0ffe7c71589b34ee6dde32707fb84fea  syndication-6.1.0.tar.xz
63fca0fcb82dd8173184d14f6ff519c1  knewstuff-6.1.0.tar.xz
96953c094839f886fc43d287576d9803  frameworkintegration-6.1.0.tar.xz
ec7504166ea139c8fef17e83f651e5ef  kparts-6.1.0.tar.xz
8282b873eceba18b47974e382cbc2ee5  syntax-highlighting-6.1.0.tar.xz
b531f57c24203d3972421fb816588410  ktexteditor-6.1.0.tar.xz
390b1c5de3944f6e94d3ae5bfc20711e  modemmanager-qt-6.1.0.tar.xz
c061f51583773539bbc1ba0167d5baae  kcontacts-6.1.0.tar.xz
772b9f66446d3cba45b603fa610e6e6b  kpeople-6.1.0.tar.xz
0e602a520f5f8539dd95574f4a04f344  bluez-qt-6.1.0.tar.xz
3e8c83dc749f935b6e39f66b086118d4  kfilemetadata-6.1.0.tar.xz
5ce22318eddec82b8f95eef7e99b2fa2  baloo-6.1.0.tar.xz
#97bcb1e182e8f1cf20417ca65ce17a8f  breeze-icons-6.1.0.tar.xz
ae2041981ba891a57c34b7c8dd41a9f6  krunner-6.1.0.tar.xz
d4226bf24a8014c9921f3cafcc851289  prison-6.1.0.tar.xz
4bec26db5300fb0a76dd5dd70f82a1ff  qqc2-desktop-style-6.1.0.tar.xz
272813a08f40a2879bbe7b0b89eb2ca7  kholidays-6.1.0.tar.xz
05a36c14152b46b1c906a7512050b6f1  purpose-6.1.0.tar.xz
5b87511f9f09182b141849ed4bf4a989  kcalendarcore-6.1.0.tar.xz
5809b8240d26f837d9f83f3e0f64c343  kquickcharts-6.1.0.tar.xz
216d353820eda22e2b1435152b0c02f2  knotifyconfig-6.1.0.tar.xz
ec2be1ead3532396c9953498c3442f8c  kdav-6.1.0.tar.xz
d94fdcee06950ba7ec7e0c6d62e1e82d  kstatusnotifieritem-6.1.0.tar.xz
de907b29d1e2160a09ca8ec4ead1538f  ksvg-6.1.0.tar.xz
5a240a769c7bfbb374345b4fda2e7bc4  ktexttemplate-6.1.0.tar.xz
9e288ba87210b6bd7af76ad6f68dbd44  kuserfeedback-6.1.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.1.0.

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

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

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_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.1.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.

Useless systemd units have been installed in $KF6_PREFIX/lib. Remove them now (as root):

rm -rf $KF6_PREFIX/lib/systemd

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.1.0
ln -sfvn kf6-6.1.0 /opt/kf6

Command Explanations

-DCMAKE_PREFIX_PATH=$QT6DIR: 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, 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.1.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