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

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.78.0, extra-cmake-modules-5.91.0, docbook-xml-4.5, docbook-xsl-1.79.2, giflib-5.2.1, libepoxy-1.5.9, libgcrypt-1.10.0, libical-3.0.14, libjpeg-turbo-2.1.2, libpng-1.6.37, libxslt-1.1.35, lmdb-0.9.29, qrencode-4.1.1, phonon-4.11.1, plasma-wayland-protocols-1.6.0, shared-mime-info-2.1, URI-5.10, and Wget-1.21.2 (required to download the packages)

Recommended

Optional

BlueZ-5.63 (needed to build Bluez-Qt), ModemManager-1.18.6 (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.17.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.91/
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.91.0.md5 << "EOF"
5d9784ee2bd02ca0764c6bd1d8589dff  attica-5.91.0.tar.xz
#65a71fbf53cda26166fa315c496f16ca  extra-cmake-modules-5.91.0.tar.xz
f2a6670f535225cee132b0862af157ad  kapidox-5.91.0.tar.xz
c1bd7b16fd4b488f38d008574871e7a6  karchive-5.91.0.tar.xz
643759d7e8b7edafcd96fe57a31f65ba  kcodecs-5.91.0.tar.xz
503fb86945377cc4e6824526083a03c2  kconfig-5.91.0.tar.xz
4d39a971050164eca9cfd17267fbd49d  kcoreaddons-5.91.0.tar.xz
df8c55668581077a980ac34b97533a6a  kdbusaddons-5.91.0.tar.xz
4a39910f9fffa41bf636108046d11a62  kdnssd-5.91.0.tar.xz
d35d659076a7e693f534b075e977938c  kguiaddons-5.91.0.tar.xz
8def96f2eecd9351350f749344bfb6e7  ki18n-5.91.0.tar.xz
0277a06b454a12cb9081238acc20d9ff  kidletime-5.91.0.tar.xz
54ad4bf2891c9b83b368efd5e5ed0320  kimageformats-5.91.0.tar.xz
40cc3a14e1c2b30d0daf1a09946886cf  kitemmodels-5.91.0.tar.xz
7fccfc2d2f03620933623e2a92fb31d5  kitemviews-5.91.0.tar.xz
46fdbec50f3947966d25cbaa69abd727  kplotting-5.91.0.tar.xz
53ef80abdb614eb4b3db80299a648303  kwidgetsaddons-5.91.0.tar.xz
3741a8dd1af123a48f8f622c5000457f  kwindowsystem-5.91.0.tar.xz
022818490366c1c84b099855135882b3  networkmanager-qt-5.91.0.tar.xz
59f5148ddc67455188c81d570167147f  solid-5.91.0.tar.xz
ca8498069ae692512a7a884492898db9  sonnet-5.91.0.tar.xz
de397b8183b1c0827f0a541aa5d5f770  threadweaver-5.91.0.tar.xz
9771c45d5646210509a1f336f080db8a  kauth-5.91.0.tar.xz
e4ad9f872cddaa3deef16fcc202e8b53  kcompletion-5.91.0.tar.xz
f8444d0caacd92799fc9d869331899bb  kcrash-5.91.0.tar.xz
f49f6f134a370add0e901aae468c2164  kdoctools-5.91.0.tar.xz
77c52f14f2e49ff18d030c7284308389  kpty-5.91.0.tar.xz
37338dd3c41623cdf4e305966d497a49  kunitconversion-5.91.0.tar.xz
c29c3835fc89c0004c5d9586efdca8ee  kconfigwidgets-5.91.0.tar.xz
b45f86503ff166a69a7cd2fc2f3fdca2  kservice-5.91.0.tar.xz
da8b36e6c834f7181983fba73828ee42  kglobalaccel-5.91.0.tar.xz
6e72bd9c68eba7a05c735e4b17238ec9  kpackage-5.91.0.tar.xz
cf6a45110d6f7a5b3e74d133262c65a8  kdesu-5.91.0.tar.xz
f0872d10bc2caaf7eb3add7ce9e6546c  kemoticons-5.91.0.tar.xz
49df446c1150b92021c42e1d0ca70cc2  kiconthemes-5.91.0.tar.xz
eca731f12d135cc92d53cc95f9598d24  kjobwidgets-5.91.0.tar.xz
392da2d1e13bdfbbe9f799f8b6ffd216  knotifications-5.91.0.tar.xz
f67fa515f50c11fcb376d26f2197a4d8  ktextwidgets-5.91.0.tar.xz
6331ab56636c38cf9ca59ac3f43e4aa3  kxmlgui-5.91.0.tar.xz
4d76d18f66b841a5198d9e5449478bba  kbookmarks-5.91.0.tar.xz
890904a43d90486126cdc08ca32aabb4  kwallet-5.91.0.tar.xz
a272d2e425e1bcda33151c89d68b806b  kded-5.91.0.tar.xz
b1ce633d68b986a917cf81132927e574  kio-5.91.0.tar.xz
bd47095a50a31c273f48e5b0a0178f02  kdeclarative-5.91.0.tar.xz
393d52ba4883d61dd9b1f06df04b2f27  kcmutils-5.91.0.tar.xz
c0c4e2f09fea4440da5c1777cc3605b3  kirigami2-5.91.0.tar.xz
1fb3cce028aefdd1db4d613b300d7edf  syndication-5.91.0.tar.xz
140700c804ef89f06024524c8a51daa5  knewstuff-5.91.0.tar.xz
d6e68519c97992610722b0a68c563a34  frameworkintegration-5.91.0.tar.xz
aa0a82faf3749e707565bc0172ced5d3  kinit-5.91.0.tar.xz
fe2d0dbf070991d7ae51779db4fa8fd2  kparts-5.91.0.tar.xz
9f80142ffe37b515b34dc0889126fe65  kactivities-5.91.0.tar.xz
#27062fb86be35c87443e680721e8fa56  kdewebkit-5.91.0.tar.xz
d8c472435f2e7025e73cadc57d822bf0  syntax-highlighting-5.91.0.tar.xz
a6bfff981c61753c508cc5c45543cb58  ktexteditor-5.91.0.tar.xz
f8c2992823438e3800e5fa814194e178  kdesignerplugin-5.91.0.tar.xz
ceb9a445c9c074cd922c929454dfcf05  kwayland-5.91.0.tar.xz
0e8698ea83e84bfc6709f378a32b6ba3  plasma-framework-5.91.0.tar.xz
#996e0521066cf5c5cf73a23b5d24acc6  modemmanager-qt-5.91.0.tar.xz
aced764828de66a63eeb9c1226a2a36c  kpeople-5.91.0.tar.xz
e952784913e584b0764eaa8b277d7394  kxmlrpcclient-5.91.0.tar.xz
6603e4e589a0701526b620f6cbb76b49  bluez-qt-5.91.0.tar.xz
1e6fe97a90bf20bb5443f730426dd163  kfilemetadata-5.91.0.tar.xz
07e81669af7cec4d3ed04fa237aef72c  baloo-5.91.0.tar.xz
#864c1dde4188c17b02dac7fb71dd8695  breeze-icons-5.91.0.tar.xz
#e5608a99e4bc7a3320ad047feec69bb4  oxygen-icons5-5.91.0.tar.xz
645b3974745de2cfc3a12096088cb3fd  kactivities-stats-5.91.0.tar.xz
a2c3256fcb5784405328a306aecfd034  krunner-5.91.0.tar.xz
76b4b3595295fda99eedf9cd39ea9187  prison-5.91.0.tar.xz
baaec24cc963ca6667336b55a2b4f6c7  qqc2-desktop-style-5.91.0.tar.xz
e9f719f8b00c9339db2a85cc26218d85  kjs-5.91.0.tar.xz
c366867d52842fa7b720dafb5fb76b40  kdelibs4support-5.91.0.tar.xz
68ef440aa83a691f35210db7124d163f  khtml-5.91.0.tar.xz
18f7d38c4bf120c256dda9445119a08c  kjsembed-5.91.0.tar.xz
0cda6ca0293714bb966a3b500d2ecee1  kmediaplayer-5.91.0.tar.xz
38c919168a2156b1ee8028059e42f07c  kross-5.91.0.tar.xz
fbdffe1ebe8b4b64df7860ec551e7b96  kholidays-5.91.0.tar.xz
dbf82286cc4bd94226c1f587ae97ecf2  purpose-5.91.0.tar.xz
f93809564a2a94b69eede7d7b3c6b0de  kcalendarcore-5.91.0.tar.xz
7864dea3081e33463aa477359bf426de  kcontacts-5.91.0.tar.xz
4e66810dd1a30dc3cf9ba4704cf1fb0c  kquickcharts-5.91.0.tar.xz
d89c0336fb388a584210cb26f746b171  knotifyconfig-5.91.0.tar.xz
3dc723d9345877a478980f3892c144c6  kdav-5.91.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.91.0 and oxygen-icons5-5.91.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.9 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

      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.91.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.91.0
ln -sfvn kf5-5.91.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.91.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

Last updated on