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-8.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.64.0, extra-cmake-modules-5.37.0, docbook-xml-4.5, docbook-xsl-1.79.1, giflib-5.1.4, libepoxy-1.4.3, libgcrypt-1.8.0, libjpeg-turbo-1.5.2, libpng-1.6.31, libxslt-1.1.29, lmdb-0.9.21, OpenSSL-1.0.2l Libraries, QtWebkit-5.9.0, phonon-4.9.1, shared-mime-info-1.8, URI-1.72, and Wget-1.19.1 (required to download the packages)

Recommended

Optional

BlueZ-5.46 (needed to build Bluez-Qt), ModemManager-1.6.8 (needed to build ModemManager-Qt)

Runtime dependency for FrameworkIntegration

Oxygen fonts and Noto fonts

Runtime dependencies for kapidox

Doxygen-1.8.13, Jinja2 , and PyYAML

Additional image formats support in KImageFormats

JasPer-2.0.12 and OpenEXR

Optional dependencies for KIO

MIT Kerberos V5-1.15.1

Optional dependencies for Solid

UDisks-2.7.2, UPower-0.99.5 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.37/
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.37.0.md5 << "EOF"
b6c54ce0f87384c070e3dfb5488380c5  attica-5.37.0.tar.xz
#29883c1580c5b9e4c736a138fc832e1a  extra-cmake-modules-5.37.0.tar.xz
d359828a8c026643374782268e099372  kapidox-5.37.0.tar.xz
141bf68d72d41056b1d1485da8a47a9e  karchive-5.37.0.tar.xz
8d85c7e7e8fcafd111ee4926160c60e4  kcodecs-5.37.0.tar.xz
b25eebcac5447af9435f2effc2f566ce  kconfig-5.37.0.tar.xz
76bf9525d2eebf95fbc4dde189b7dc74  kcoreaddons-5.37.0.tar.xz
2697c6440c566da94341f4bc3bf3164c  kdbusaddons-5.37.0.tar.xz
e12d09fb176c0533d2a4eed6b43cbfc3  kdnssd-5.37.0.tar.xz
a395b2479d99128cba078c3a1299a566  kguiaddons-5.37.0.tar.xz
97bdebb717431b400add03d60484db72  ki18n-5.37.0.tar.xz
e070c69d7785532d0671a077e3cc370f  kidletime-5.37.0.tar.xz
127c01934d68a3b3b88231e9602831e5  kimageformats-5.37.0.tar.xz
db88454a0c4335432055ac074104dc43  kitemmodels-5.37.0.tar.xz
062bfca05e8bb81fa8eb360c6944d75f  kitemviews-5.37.0.tar.xz
12f507e62783ce6a17e61328b3a85b07  kplotting-5.37.0.tar.xz
70161280f8e10ac69fc7d334a8531fdd  kwidgetsaddons-5.37.0.tar.xz
05864840b694d3a587590c38e2170df0  kwindowsystem-5.37.0.tar.xz
80523443bbb0a0882631f22793e7ff9c  networkmanager-qt-5.37.0.tar.xz
edf069c6ea563318ae710a36d55af35a  solid-5.37.0.tar.xz
3e2a53802d204bc73d975fd769cbdae2  sonnet-5.37.0.tar.xz
bd38a5cc79c9f2dc8e7f0fcf7df482c9  threadweaver-5.37.0.tar.xz
ed6136acf490dcdaa145e09f2f517338  kauth-5.37.0.tar.xz
b0efe7abac21241f3b5933c5b1ddb8ef  kcompletion-5.37.0.tar.xz
34d013abaaae22b45a46956997b0b82c  kcrash-5.37.0.tar.xz
fe3f523474c3e65a86884b3e88a18d2a  kdoctools-5.37.0.tar.xz
c5732adada0f8ab44eaefbfd458351c4  kpty-5.37.0.tar.xz
6260f91d8340ab7505dbefd58cc7d3bf  kunitconversion-5.37.0.tar.xz
e13440e05800f7187c7e98eb6babfa96  kconfigwidgets-5.37.0.tar.xz
d2d343de16c69c7b5d8c492fefa3115f  kservice-5.37.0.tar.xz
36bf35d34827bb6b78c7b4cb8be3c554  kglobalaccel-5.37.0.tar.xz
b594e9d93bcfac2f6b2aa98f2642f9ca  kpackage-5.37.0.tar.xz
d717f6061cac42035e133618bf043965  kdesu-5.37.0.tar.xz
cc5ff7c6f686c1278d56fcec5df38222  kemoticons-5.37.0.tar.xz
47babcad619664866c880623fd86ff2f  kiconthemes-5.37.0.tar.xz
8c5f7d0160aadeb1392e44315bd3c706  kjobwidgets-5.37.0.tar.xz
b8fe7fc1e9180d7a2519d8401b42cd65  knotifications-5.37.0.tar.xz
deda1b1ac51fe9e4859bafb7c0144133  ktextwidgets-5.37.0.tar.xz
ef28a72da7beffaef6dfcaebcb509d30  kxmlgui-5.37.0.tar.xz
da82f6881e3b1de522b0ca6ce80c7634  kbookmarks-5.37.0.tar.xz
e5900cdfe4a4958965e25002b9f1cab8  kwallet-5.37.0.tar.xz
6d46bb8e26222e3c68a60611c62cd298  kio-5.37.0.tar.xz
6313ca5c3501ce1f4d00ceef3a441ced  kdeclarative-5.37.0.tar.xz
d3a81d2cf8d4bcdcb8f1b4a018107e99  kcmutils-5.37.0.tar.xz
0b620a47aca20b155ae461e12a437ae5  knewstuff-5.37.0.tar.xz
5cb0433c25ace0fad2b49cf3b8459704  frameworkintegration-5.37.0.tar.xz
a931963d19b927560b5d81f4fb8bec12  kinit-5.37.0.tar.xz
10db039a62f903c42ddbe762fcef13b1  knotifyconfig-5.37.0.tar.xz
1fde7d6c99345e29d7c0a900a8c67659  kparts-5.37.0.tar.xz
53162e9c01be1e793e6407d2d3cde628  kactivities-5.37.0.tar.xz
ecff152277532d352cb2957a81c44300  kded-5.37.0.tar.xz
f24c53f5b36d23d24ca0b96f027051e0  kdewebkit-5.37.0.tar.xz
a6033d9a6240b133938602a4b7cb98d6  syntax-highlighting-5.37.0.tar.xz
b33dcff501812990fd3065a42264aca2  ktexteditor-5.37.0.tar.xz
2790a476fd712e9c9686a6ff151267dc  kdesignerplugin-5.37.0.tar.xz
a1ebab3f95697555278c3bef60647647  kwayland-5.37.0.tar.xz
e73d212673dd92bfc4b943f9d1a21be4  plasma-framework-5.37.0.tar.xz
#b814194b5e8e03c04736567e178d1932  modemmanager-qt-5.37.0.tar.xz
06fbfd8fa30aace3d75fc156de5417d3  kpeople-5.37.0.tar.xz
8372393ce57eb14fb85e54602e24ae47  kxmlrpcclient-5.37.0.tar.xz
4eed8acd2acb2633cba4dd7f8a248b49  bluez-qt-5.37.0.tar.xz
438fe87d54d35f99a71a61cf3b8a9944  kfilemetadata-5.37.0.tar.xz
f317f652591702315c7a9f0d8f95031a  baloo-5.37.0.tar.xz
#bf3a1386e6b3daf7b6ee27d59bd55a91  breeze-icons-5.37.0.tar.xz
#3f7cdadd2adc1b82b5600fbea90d0888  oxygen-icons5-5.37.0.tar.xz
18dcba6b6021a6ec21617816113b62fa  kactivities-stats-5.37.0.tar.xz
ebac192db60aac4edf29da8cf09b6bd9  krunner-5.37.0.tar.xz
#f4e54c14d94e70c154ebc4d57d868b2f  prison-5.37.0.tar.xz
#74de56d367913ec08c547e916bfe3b24  kirigami2-5.37.0.tar.xz
4ef52deab5f709ddf0d3e99bf7747077  kjs-5.37.0.tar.xz
7584d933213c7a3f56c55f1eede7b717  kdelibs4support-5.37.0.tar.xz
691bc2e2a5b763e21333fbac28d039b3  khtml-5.37.0.tar.xz
d21ea2f8177d503b826809b614e37471  kjsembed-5.37.0.tar.xz
73d2101fb4aa04df9918b46e1e91bf7a  kmediaplayer-5.37.0.tar.xz
cd2f2748eed19cfe8552b6444c27a021  kross-5.37.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.37.0 and oxygen-icons5-5.37.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 kirigami2 package is a set of libraries for the android platform (see https://techbase.kde.org/Kirigami for more information.)

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.20p2 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:

export CXXFLAGS='-isystem /usr/include/openssl-1.0'

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

    tar -xf $file
    pushd $packagedir

      case $packagedir in
        syntax-highlighting* )
          sed -i.orig 's|w-|w\\-|' data/syntax/rest.xml
        ;;

        kdelibs4support*)
          sed -i.orig \
             '/OPENSSL_FOUND/i set(OPENSSL_INCLUDE_DIR "/usr/include/openssl-1.0")' \
             src/CMakeLists.txt
        ;;
      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.37.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.37.0
ln -sfvn kf5-5.37.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.37.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 2017-08-26 21:18:25 -0700