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-8.4 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.5, KDE Frameworks-5.55.0, libpwquality-1.4.0, libxkbcommon-0.8.3, Mesa-18.3.3 built with Wayland-1.16.0, NetworkManager-1.14.4, PulseAudio-12.2, qca-2.1.3, sassc-3.5.0, taglib-1.11.1, and xcb-util-cursor-0.1.3

Recommended

Optional

GLU-9.0.0, ibus-1.5.19, 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.15.0/
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.15.0.md5 << "EOF"
1195f11a0f135da965f7c84a0b535ad6  kdecoration-5.15.0.tar.xz
0d4896be04000503bedcf5c7d51e896a  libkscreen-5.15.0.tar.xz
784f3f907050c36265d0c289aa15779f  libksysguard-5.15.0.tar.xz
41d68903361098906f7feb05aeef96da  breeze-5.15.0.tar.xz
9a0d85a3a6b97e0f0920604e73c8f4f8  breeze-gtk-5.15.0.tar.xz
0ed614d82dff50dd7b1df7165113f600  kscreenlocker-5.15.0.tar.xz
86528bd2bd6f8a66108fc2ceba3cc1af  oxygen-5.15.0.tar.xz
fdd8a90fc4b917602547adf44553990d  kinfocenter-5.15.0.tar.xz
8c0b0aaf98727d52c00bfe3ca5152775  ksysguard-5.15.0.tar.xz
52f86eb52dda1ccd547a8a66893d439e  kwin-5.15.0.tar.xz
5424d6b8af2025c44acdaea10615a539  plasma-workspace-5.15.0.tar.xz
8649b958165f1a87f07373be0f97fbf3  bluedevil-5.15.0.tar.xz
2914de589f74b154fe29e3103be34ef6  kde-gtk-config-5.15.0.tar.xz
79d22683db231b7623cf2ebe384994b6  khotkeys-5.15.0.tar.xz
821abe928b627a33ae43ffeace3990e5  kmenuedit-5.15.0.tar.xz
60dae1dde512a5b8c8f54adb48e83ec4  kscreen-5.15.0.tar.xz
2c41b3ae8862a4243169e45348b1cd63  kwallet-pam-5.15.0.tar.xz
ef01bd635719a4bf3c6845dbc08e7bc3  kwayland-integration-5.15.0.tar.xz
6d461e4deeeae854e7efdff26c0fbc2e  kwrited-5.15.0.tar.xz
7fd8557369f2d3a59e1d84c78a265afc  milou-5.15.0.tar.xz
d3c9475c2b51cdb1f2efedfb5ab6cf88  plasma-nm-5.15.0.tar.xz
6eab227685df4ccd68ada3a4b633711f  plasma-pa-5.15.0.tar.xz
93a379e907d3b03205771e1b5c20ea7d  plasma-workspace-wallpapers-5.15.0.tar.xz
ed5c4fc72e5d72c8da607bd5fe60693f  polkit-kde-agent-1-5.15.0.tar.xz
12d65231a8265ee56d2ef1915aef7894  powerdevil-5.15.0.tar.xz
939ec9bc31bb3c89a73163950bdcedda  plasma-desktop-5.15.0.tar.xz
d7b299906680e0b564ff24f5c0d70f27  kdeplasma-addons-5.15.0.tar.xz
92751cff053861a46f58d5ca8837cb65  kgamma5-5.15.0.tar.xz
f6a267d3e76056a70abc262963f10ed5  ksshaskpass-5.15.0.tar.xz
#f910c1c8e687ddade3c161e9b6b9b598  plasma-sdk-5.15.0.tar.xz
19e3f3cb0c8341039f9855e79b9f395c  sddm-kcm-5.15.0.tar.xz
9755f8d9e1c84fcf105b464b513bb269  user-manager-5.15.0.tar.xz
d7135447c459e8c0bdb5d1fb1d703c01  discover-5.15.0.tar.xz
#745357574864bd167cff7b294486e145  breeze-grub-5.15.0.tar.xz
#a31d2ba0c628cf40d5102c14930a353c  breeze-plymouth-5.15.0.tar.xz
885978ef5cae1c843673be511998fe22  kactivitymanagerd-5.15.0.tar.xz
3fe2706c6c26f26d9aa38fb658763c9f  plasma-integration-5.15.0.tar.xz
e8d58c1860a29905fcfb0933de163231  plasma-tests-5.15.0.tar.xz
710233d7a0cb25b66caba2d496f706ba  plymouth-kcm-5.15.0.tar.xz
78c04d7c16031002fb373a53ba75514a  xdg-desktop-portal-kde-5.15.0.tar.xz
b1c8325c6a26a2b3f48b4adb6ce0a533  drkonqi-5.15.0.tar.xz
3241eed0c5938ecb07c7b6462179fb9b  plasma-vault-5.15.0.tar.xz
90c0b196206104b28def99c770db4ac1  plasma-browser-integration-5.15.0.tar.xz
7033a941eef914415feea7051bf1e42f  kde-cli-tools-5.15.0.tar.xz
580f675f1f03e5d2f4aec5cd6eebfe5f  systemsettings-5.15.0.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.

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

       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.15.0.md5

exit

install -dvm 755 /usr/share/xsessions &&
cd /usr/share/xsessions/              &&
[ -e plasma.desktop ]                 ||
as_root ln -sfv $KF5_PREFIX/share/xsessions/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.0, or from runlevel 5, using a Display Manager, such as lightdm-1.28.0.

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

cat > ~/.xinitrc << "EOF"
ck-launch-session dbus-launch --exit-with-session $KF5_PREFIX/bin/startkde
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
[Note]

Note

You may wish to drop consolekit and/or dbus-launch, e.g., just using startkde in ~/.xinitrc. However some capabilities such as mounting or umounting file systems from a file manager will not be possible, or the reboot option may be absent or inoperative, among other problems.

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