Building Plasma 5

KDE Plasma 5 is a collection of packages based on top of KDE Frameworks 5 and QML. They implement the KDE Display Environment (Plasma 5).

This package is known to build and work properly using an LFS-9.1 platform.

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

Package Information

Plasma 5 Dependencies

Required

GConf-3.2.6, GTK+-2.24.32, GTK+-3.24.13, KDE Frameworks-5.67.0, libpwquality-1.4.2, libxkbcommon-0.10.0, Mesa-19.3.4 built with Wayland-1.18.0, NetworkManager-1.22.6, pipewire-0.2.7, PulseAudio-13.0, qca-2.2.1, sassc-3.6.1, taglib-1.11.1, and xcb-util-cursor-0.1.3

Recommended

Optional

GLU-9.0.1, ibus-1.5.21, Xorg Synaptics Driver-1.9.1, appstream-qt, KDevPlatform, libgps, libhybris, libraw1394, mockcpp, packagekit-qt, Qalculate, Qapt, SCIM, and socat (for pam_kwallet)

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/kf5

Downloading KDE Plasma5

The easiest way to get the KDE Plasma5 packages is to use a single wget to fetch them all at once:

url=http://download.kde.org/stable/plasma/5.18.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 > plasma-5.18.1.md5 << "EOF"
be7cccb3859c253740ad20eae56a1457  kdecoration-5.18.1.tar.xz
84b92ff5c7ab70537bc757122375ab3c  libkscreen-5.18.1.tar.xz
645e7d0e5167d89abfcb0011748179a8  libksysguard-5.18.1.tar.xz
0d6769306901883a9aadaaed4c199314  breeze-5.18.1.tar.xz
9c797eddc66820e119a32b3ca0e54327  breeze-gtk-5.18.1.tar.xz
2369c961fee61992bf16f8e5aabc296a  kscreenlocker-5.18.1.tar.xz
da5b0b9caca27a0b7faea3aac732e5d5  oxygen-5.18.1.tar.xz
c687fdd7a0c36a3a6d7ebd063f3aee61  kinfocenter-5.18.1.tar.xz
ae2bf8875c1b374d172267c7a0cca982  ksysguard-5.18.1.tar.xz
216b067f13f43238c7515815001fc862  kwin-5.18.1.tar.xz
97c106ec13bd9ecf87cc61e1cc29f374  plasma-workspace-5.18.1.tar.xz
8d3ea52e9b215523225e316d47469f3f  bluedevil-5.18.1.tar.xz
7c16855fe0c390a9eaa60d2f4e624736  kde-gtk-config-5.18.1.tar.xz
597ac5c22e2dc7bad5773781c4f5c563  khotkeys-5.18.1.tar.xz
cd59deb1769ed3fdcfd620f1d5e82676  kmenuedit-5.18.1.tar.xz
e957ca2f6374385e3b5598f839f843a5  kscreen-5.18.1.tar.xz
25db35f344bd12fdf6d6e54b87d4b90c  kwallet-pam-5.18.1.tar.xz
8bda1526aa7f9dbf6aa842b08cf22655  kwayland-integration-5.18.1.tar.xz
d0a29aed4ee8bcd9fce3e545f82832be  kwrited-5.18.1.tar.xz
2f4252bc1a8b07062e57d229fc3bc361  milou-5.18.1.tar.xz
8663fa971594bc70d6898e8604f8c99a  plasma-nm-5.18.1.tar.xz
0554888991a1f1f70cbbb95afa48184a  plasma-pa-5.18.1.tar.xz
25fcaf7cb52f20b3126af9baa1409e3c  plasma-workspace-wallpapers-5.18.1.tar.xz
0b88def5b87e822aa7370d91dfd07913  polkit-kde-agent-1-5.18.1.tar.xz
0326bf85fb50e15d5e78c43be9457993  powerdevil-5.18.1.tar.xz
58ec01d70d18f23a03ec2040beb506f1  plasma-desktop-5.18.1.tar.xz
9a44fb928f5dd22a695d38617660aeee  kdeplasma-addons-5.18.1.tar.xz
7200c6ebdc63dde79f64a9b2472b2d37  kgamma5-5.18.1.tar.xz
78d68fd989b451a8e75fd9278a0c1947  ksshaskpass-5.18.1.tar.xz
#4c907670bbe788499038254311f6ac0b  plasma-sdk-5.18.1.tar.xz
7533a7a459d476ece00d558d4fc9a8f7  sddm-kcm-5.18.1.tar.xz
2b2351beb674ce01cca0b58d3c8a49b2  user-manager-5.18.1.tar.xz
c76653dce9c3f9f1ac1edae6fe342ee7  discover-5.18.1.tar.xz
#ca25ee8ad60b64d19850ccba8994547c  breeze-grub-5.18.1.tar.xz
#c8377f0f2ac3109014c8062e74145def  breeze-plymouth-5.18.1.tar.xz
7b5e6cbb5d84b69745030773bea176c0  kactivitymanagerd-5.18.1.tar.xz
fa2e316a15f24c64a71c36d30b7f7585  plasma-integration-5.18.1.tar.xz
a5d8cc4a47ba59969f98be0cc5800f83  plasma-tests-5.18.1.tar.xz
#c13ae6eaa29760e67a9c17d6a1a48153  plymouth-kcm-5.18.1.tar.xz
d6e2d1a982c83a553607d46a04fcfff7  xdg-desktop-portal-kde-5.18.1.tar.xz
5b7bf736b767d40d77a4c51bca9708e0  drkonqi-5.18.1.tar.xz
1ccf74eb8b851b1dba87f2cd3ed54052  plasma-vault-5.18.1.tar.xz
a0f85c77e48c35a17cc326491155249e  plasma-browser-integration-5.18.1.tar.xz
7d73463b9115234991a631dc6741bab4  kde-cli-tools-5.18.1.tar.xz
d420ca0680c67496b8572b143aae1dc9  systemsettings-5.18.1.tar.xz
a2ae6b65f5ae2df57cfb29bf8ae56eda  plasma-thunderbolt-5.18.1.tar.xz
#3df1a7d13f5cce484ce8fb684c1c0015  plasma-nano-5.18.1.tar.xz
#498e4c99016d51bc44abdb8416e7dba2  plasma-phone-components-5.18.1.tar.xz
EOF
[Note]

Note

The breeze-grub, breeze-plymouth, and plymouth-kcm packages above are all for customized support of Plymouth which is designed to be run within an initial ram disk during boot (see the section called “About initramfs”). The plasma-sdk package is optional and used for software development. The plasma-nano package is used for embedded systems and plasma-phone-components provides phone functionality for Plasma.

Installation of Plasma5

[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.31 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

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

    tar -xf $file
    pushd $packagedir

       # Fix some build issues when generating some configuration files
       case $name in
         plasma-workspace)
           sed -i '/set.HAVE_X11/a set(X11_FOUND 1)' CMakeLists.txt
         ;;
      
         khotkeys)
           sed -i '/X11Extras/a set(X11_FOUND 1)' CMakeLists.txt
         ;;
      
         plasma-desktop)
           sed -i '/X11.h)/i set(X11_FOUND 1)' CMakeLists.txt
         ;;
       esac

       mkdir build
       cd    build

       cmake -DCMAKE_INSTALL_PREFIX=$KF5_PREFIX \
             -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 < plasma-5.18.1.md5

exit

If you did not set $KF5_PREFIX to /usr, create symlinks to allow display managers to find Plasma:

as_root install -dvm 755 /usr/share/xsessions              &&
cd /usr/share/xsessions/                                   &&
[ -e plasma.desktop ]                                      ||
as_root ln -sfv $KF5_PREFIX/share/xsessions/plasma.desktop &&
as_root install -dvm 755 /usr/share/wayland-sessions       &&
cd /usr/share/wayland-sessions/                            &&
[ -e plasma.desktop ]                                      ||
as_root ln -sfv $KF5_PREFIX/share/wayland-sessions/plasma.desktop

Configuring Plasma

Linux PAM Configuration

If you built Plasma with the recommended Linux PAM support, create necessary configuration files by running the following commands as the root user:

cat > /etc/pam.d/kde << "EOF" 
# Begin /etc/pam.d/kde

auth     requisite      pam_nologin.so
auth     required       pam_env.so

auth     required       pam_succeed_if.so uid >= 1000 quiet
auth     include        system-auth

account  include        system-account
password include        system-password
session  include        system-session

# End /etc/pam.d/kde
EOF

cat > /etc/pam.d/kde-np << "EOF" 
# Begin /etc/pam.d/kde-np

auth     requisite      pam_nologin.so
auth     required       pam_env.so

auth     required       pam_succeed_if.so uid >= 1000 quiet
auth     required       pam_permit.so

account  include        system-account
password include        system-password
session  include        system-session

# End /etc/pam.d/kde-np
EOF

cat > /etc/pam.d/kscreensaver << "EOF"
# Begin /etc/pam.d/kscreensaver

auth    include system-auth
account include system-account

# End /etc/pam.d/kscreensaver
EOF

Starting Plasma5

You can start Plasma5 from runlevel 3, using xinit-1.4.1, or from runlevel 5, using a Display Manager, such as lightdm-1.30.0.

To start Plasma 5 using xinit-1.4.1, run the following commands:

cat > ~/.xinitrc << "EOF"
dbus-launch --exit-with-session $KF5_PREFIX/bin/startplasma-x11
EOF

startx

The X session starts on the first unused virtual terminal, normally vt7. You can switch to another vtn simultaneously pressing the keys Ctrl-Alt-Fn (n=1, 2, ...). To switch back to the X session, normally started at vt7, use Ctrl-Alt-F7. The vt where the command startx was executed will display many messages, including X starting messages, applications automatically started with the session, and eventually, some warning and error messages. You may prefer to redirect those messages to a log file, which not only will keep the initial vt uncluttered, but can also be used for debugging purposes. This can be done starting X with:

startx &> ~/x-session-errors

When shutting down or rebooting, the shutdown messages appear on the vt where X was running. If you wish to see those messages, simultaneously press keys Alt-F7 (assuming that X was running on vt7).

If you intend to start Plasma using a display manager such as lightdm-1.30.0, there will be two entries for Plasma, one for use with Xorg, and another for Wayland. Modify the Xorg entry with the following command, as the root user, so that you can differentiate between the two:

sed '/^Name=/s/Plasma/Plasma on Xorg/' -i /usr/share/xsessions/plasma.desktop

Contents

Installed Programs: There are too many plasma programs (50 in /opt/kf5/bin) to list separately here.
Installed Libraries: There are too many plasma libraries (39 in /opt/kf5/lib) to list separately here.
Installed Directories: There are too many plasma directories (over 1000 in /opt/kf5) to list separately here.

Last updated on 2015-09-24 16:44:04 -0500