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-9.0 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.71.0, extra-cmake-modules-5.64.0, docbook-xml-4.5, docbook-xsl-1.79.2, giflib-5.2.1, libepoxy-1.5.3, libgcrypt-1.8.5, libjpeg-turbo-2.0.3, libpng-1.6.37, libxslt-1.1.34, lmdb-0.9.24, phonon-4.11.1, shared-mime-info-1.15, URI-1.76, and Wget-1.20.3 (required to download the packages)

Recommended

Optional

BlueZ-5.52 (needed to build Bluez-Qt), ModemManager-1.12.0 (needed to build ModemManager-Qt)

Runtime dependency for FrameworkIntegration

Oxygen fonts and Noto fonts

Runtime dependencies for kapidox

Doxygen-1.8.16, Jinja2-2.10.3, and PyYAML-5.1.2

Additional image formats support in KImageFormats

JasPer-2.0.14 and OpenEXR

Optional dependencies for KIO

MIT Kerberos V5-1.17

Optional dependencies for Solid

UDisks-2.8.4, UPower-0.99.11 and media-player-info (runtime)

Optional dependency for KWallet

gpgmepp

Optional dictionary backends for Sonnet

Hspell and Hunspell

Required dependencies for Prison

Datamatrix and QRencode

User Notes: http://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=http://download.kde.org/stable/frameworks/5.64/
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.64.0.md5 << "EOF"
04201c36ee67fc57179f4a646ca520e3  attica-5.64.0.tar.xz
#ca705855a8d06ae606e0d646dbf327b0  extra-cmake-modules-5.64.0.tar.xz
d2e7484e70045efce2ae03cbdb83e0ce  kapidox-5.64.0.tar.xz
8f245b3ffc777368f7394cd06bb60b26  karchive-5.64.0.tar.xz
cbc2f74150a910dc64f48a86cc2cf934  kcodecs-5.64.0.tar.xz
b16792f6cee787209ba678081fd9cc1c  kconfig-5.64.0.tar.xz
df043d47f24b6c983ed940cbe1af132b  kcoreaddons-5.64.0.tar.xz
d7de1a2c0cd9c3308aee5c932573a3da  kdbusaddons-5.64.0.tar.xz
974d79b965ebbee019f81b68e062aaec  kdnssd-5.64.0.tar.xz
7dc0b622ddf3ed90c7c8135e29950080  kguiaddons-5.64.0.tar.xz
374b0b8e7f4660f1e9159cc202e4d07e  ki18n-5.64.0.tar.xz
7e47e4020a5bd7728d81f24b9eaaa2a9  kidletime-5.64.0.tar.xz
9bedf2a73e4659ace5efd8415b8a10ea  kimageformats-5.64.0.tar.xz
9f8ec9983c19c52b3bbce8e308725e7d  kitemmodels-5.64.0.tar.xz
be56db58cd6537fe3a138f2b04fdf5c7  kitemviews-5.64.0.tar.xz
3f405d8c3511d4049f5a93ea66dd0cc8  kplotting-5.64.0.tar.xz
e3b457924fcaecb0073216c0899b1167  kwidgetsaddons-5.64.0.tar.xz
1c3e335bf029d0da1f4f6b4f9342ae84  kwindowsystem-5.64.0.tar.xz
44914f08bec33cc49ffeb886b13f6614  networkmanager-qt-5.64.0.tar.xz
2d17cc9129b3bad594c0dd09e663caa9  solid-5.64.0.tar.xz
cf7eedbf3fd395823e1cc90ce7321dcb  sonnet-5.64.0.tar.xz
6f969f0a793d5a25c0bd09d3ad466fd9  threadweaver-5.64.0.tar.xz
a94fc1e5fb09982808a3525f86492738  kauth-5.64.0.tar.xz
53889e7526d0a4e389523545bccf1d88  kcompletion-5.64.0.tar.xz
1110b19b78f7260d8b9a1aed4db21f09  kcrash-5.64.0.tar.xz
c5016655913132cc5a30896b77aeeb73  kdoctools-5.64.0.tar.xz
ac6bc187ab30a768777e00fe1eaa92bd  kpty-5.64.0.tar.xz
56b729998529c57f6dc6f8d4f1423fa9  kunitconversion-5.64.0.tar.xz
03518a7021c0af253ece25728f9ac25a  kconfigwidgets-5.64.0.tar.xz
2a3d3efa102078fafca0d34180137289  kservice-5.64.0.tar.xz
2e672c2bc14716b988e224b81772b569  kglobalaccel-5.64.0.tar.xz
02ac3300212b7426487e583ff0fec836  kpackage-5.64.0.tar.xz
5202294263f7b68c775b597095b2ccc4  kdesu-5.64.0.tar.xz
059f219e4b425bd18fbc0f5236eea29b  kemoticons-5.64.0.tar.xz
a72399f496b3813277e69477a56b98e8  kiconthemes-5.64.0.tar.xz
a5cc3b4abb1b7986f99d3977c00afd16  kjobwidgets-5.64.0.tar.xz
a78af6ba485f56bbbbf222e6b61aedb8  knotifications-5.64.0.tar.xz
914b35abd57934eec7abb8287d6f540a  ktextwidgets-5.64.0.tar.xz
ec74e7698e3f0f34facc0a189373b977  kxmlgui-5.64.0.tar.xz
3f8fc9273ab02e29b747ccd993f6f82d  kbookmarks-5.64.0.tar.xz
053848f2f12241de152c6b38623eb3c4  kwallet-5.64.0.tar.xz
bae95a766a2cec6dd7c9fa8f89aca9d2  kio-5.64.0.tar.xz
ab5a0303bcd8db7e4e9fb212103370fd  kdeclarative-5.64.0.tar.xz
8c408da1f427b049b742821b72f4bee5  kcmutils-5.64.0.tar.xz
de169a608b5af73f8253c6efd1fa07f1  kirigami2-5.64.0.tar.xz
5dce1312633d8e350280dbbdeea79772  knewstuff-5.64.0.tar.xz
20b263e99dd12f82e5cacdf0a8d5699e  frameworkintegration-5.64.0.tar.xz
f88eeb2e12a9ad23434e29046fe4fbc6  kinit-5.64.0.tar.xz
a17509998a3b61b1fd0732b45ad34389  knotifyconfig-5.64.0.tar.xz
d6f776cfe357c4f4387cc7df1e8dc82a  kparts-5.64.0.tar.xz
cad4b226ed9da8182db5c97d1cdbe45f  kactivities-5.64.0.tar.xz
6c59a0edae857dd261d724838193995d  kded-5.64.0.tar.xz
#1b009daa18a4d5dcea44a06a3cf565e3  kdewebkit-5.64.0.tar.xz
4266efccbf1500c4375b270e013060fd  syntax-highlighting-5.64.0.tar.xz
4b23b94d0f38d293b5c043bed8455451  ktexteditor-5.64.0.tar.xz
adbc56e452dca4a6c00ca70157d7d21d  kdesignerplugin-5.64.0.tar.xz
a6015cc5f0ebc88926e5de857c53572f  kwayland-5.64.0.tar.xz
da6a56cec4cda081a2f7b96a00adb02c  plasma-framework-5.64.0.tar.xz
#87e9399e34c1dafaf644d0a582016007  modemmanager-qt-5.64.0.tar.xz
c7329c21975ebe1d51e7d586adb931c8  kpeople-5.64.0.tar.xz
49dce029316e248018f7f63476a48203  kxmlrpcclient-5.64.0.tar.xz
30eb0e3a1eee677126ef34e888cf8aca  bluez-qt-5.64.0.tar.xz
b1e29c0c619b1018be697e899ff38dbf  kfilemetadata-5.64.0.tar.xz
a799d7e2b91840e34283725daba08f0c  baloo-5.64.0.tar.xz
#ecba20d51471d9cf6a76085d9f286905  breeze-icons-5.64.0.tar.xz
#2f6b2f619a737db9daf254b8bc91bb62  oxygen-icons5-5.64.0.tar.xz
39b04723e83a630dc845d0116d3ff127  kactivities-stats-5.64.0.tar.xz
329ea65e41c5d6e42fa69df0248404bf  krunner-5.64.0.tar.xz
#7c372e723a3cb713cbad3c0880157a0b  prison-5.64.0.tar.xz
a59fe759407bbf748f512e3e54236ac6  qqc2-desktop-style-5.64.0.tar.xz
616235430c5a93e70b235b3034e93650  kjs-5.64.0.tar.xz
bdad864bae23a0ec63ba0d89b4c186bf  kdelibs4support-5.64.0.tar.xz
3346439fb5d89c8cf73b606bdbd586a5  khtml-5.64.0.tar.xz
c6a3bcfb93bacdd2f042d731c8a3532d  kjsembed-5.64.0.tar.xz
4428adcff009b4b28fc75bfe8d17b2c5  kmediaplayer-5.64.0.tar.xz
75d4e6f1e5cc0d84ec6e89f9bda698c7  kross-5.64.0.tar.xz
8945bfcb4aa7d17cee36e7a5cfb9d5b8  kholidays-5.64.0.tar.xz
171824ce4bdaa06dc39de08bba266d27  purpose-5.64.0.tar.xz
61fe5e1da6dd470fe9385f52f217df2b  syndication-5.64.0.tar.xz
317e43aaabd64bbe60910aee9aec5d45  kcalendarcore-5.64.0.tar.xz
c1fbdda16f5bde8ec80e95d72e941c42  kcontacts-5.64.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.64.0 and oxygen-icons5-5.64.0. The modemmanager-qt package may be built if its optional dependency has been installed. The prison package (bar code reader) may be built if the required external libraries are 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.8.29 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

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.64.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.64.0
ln -sfvn kf5-5.64.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: There are 48 programs installed in /opt/kf5/bin.
Installed Libraries: There are too many kf5 libraries (191) to list separately.
Installed Directories: /opt/kf5 (symlink to /opt/kf5-5.64.0)

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.

kactivitymanagerd

is the KDE Plasma Workspace Activity Manager.

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.

kgenapidox

is a tool to generate API documentation in the KDE style.

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.

kmailservice5

is a mail service.

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 2019-11-09 22:06:03 -0600