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.2 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.22.28, KDE Frameworks-5.43.0, libpwquality-1.4.0, libxkbcommon-0.8.0, Mesa-17.3.4 built with Wayland-1.14.0, NetworkManager-1.10.4, PulseAudio-11.1, Python-2.7.14, qca-2.1.3, taglib-1.11.1, and xcb-util-cursor-0.1.3

Recommended

Optional

GLU-9.0.0, IBus-1.5.17, Xorg Synaptics Driver-1.9.0, 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.12.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.12.1.md5 << "EOF"
a1abf188ffb59a4b6e23d058aa45f0d1  kde-cli-tools-5.12.1.tar.xz
2eae0ba02fe25a10f43de9366c1aea00  kdecoration-5.12.1.tar.xz
cee80062a266ff50b120c3fccc2da4af  libkscreen-5.12.1.tar.xz
72ab3939b76c432b977c31df305304f2  libksysguard-5.12.1.tar.xz
2d265b041feb7f94fdc80cc40cca7fa8  breeze-5.12.1.tar.xz
99aebe5eae6e42ee6eb0a61cf8f04284  breeze-gtk-5.12.1.tar.xz
e8e5600b985e0305bcb1240da214395b  kscreenlocker-5.12.1.tar.xz
402dfcdfc23cb1c2b4a7f3347dfac5c2  oxygen-5.12.1.tar.xz
1cb5e69233857722ee27e1fe35a550c9  kinfocenter-5.12.1.tar.xz
7dc785af0e5b034197775470785b61b9  ksysguard-5.12.1.tar.xz
5983d1f2b35d66252fc9b2c47c7d2ddb  kwin-5.12.1.tar.xz
c175ab510f420b7293792c14edf98ce6  systemsettings-5.12.1.tar.xz
8d97e635b03bd046e2dda4c96317fea5  plasma-workspace-5.12.1.tar.xz
6d717f754da760ab33a8c12ac1c37112  bluedevil-5.12.1.tar.xz
dd0e8721048cd88b55f8dd45a5a72198  kde-gtk-config-5.12.1.tar.xz
e6241737195d592ee4c2087ad4a4147f  khotkeys-5.12.1.tar.xz
c416fd50038aa35043560213b9920156  kmenuedit-5.12.1.tar.xz
742a0c2a5067f92a3a5f2a8299680972  kscreen-5.12.1.tar.xz
cfa6fa62948d37fc3fe9351084c0bb6a  kwallet-pam-5.12.1.tar.xz
3c8d15dfa606ec65d347bc59ead1c9ad  kwayland-integration-5.12.1.tar.xz
7ab4c14801ea6b85b454361f1ac864f3  kwrited-5.12.1.tar.xz
11b5a0cf1c1997fd4b29af4f54d3723c  milou-5.12.1.tar.xz
0d63f11eae7adc6b5e7c32baa6ec4293  plasma-nm-5.12.1.tar.xz
518ddf777698a65b3b10f246060aea9a  plasma-pa-5.12.1.tar.xz
20eaf7b6afbf93aa878d37816dd31676  plasma-workspace-wallpapers-5.12.1.tar.xz
1b315a99664053b850d1ecda6da3ab63  polkit-kde-agent-1-5.12.1.tar.xz
36e62e1a2fc85c22916de3a9d8eb8a89  powerdevil-5.12.1.tar.xz
f8dd9aabaac4e80bae15d4580fe689ff  plasma-desktop-5.12.1.tar.xz
4f0179f85332dd001a860cb0da9aeb72  kdeplasma-addons-5.12.1.tar.xz
1faca1598163b827c700489cad58a7f9  kgamma5-5.12.1.tar.xz
28a187eb76929858e2f4c41a6540ea78  ksshaskpass-5.12.1.tar.xz
#7943b64ceee1573343e89717ce22366b  plasma-sdk-5.12.1.tar.xz
28a1ad02d32a6c0fbdfc9dc1822d5ded  sddm-kcm-5.12.1.tar.xz
276bc0870e905dc1458664584eedb55d  user-manager-5.12.1.tar.xz
21046d3e4a2a877ef3bdcf46feacc425  discover-5.12.1.tar.xz
#d354ce8e994921a2357db05b60d7911b  breeze-grub-5.12.1.tar.xz
#1ed17b5866e148568d5057b1b2a28566  breeze-plymouth-5.12.1.tar.xz
08a7ebca2a8a4f5191f0aed74675d9f6  kactivitymanagerd-5.12.1.tar.xz
f3a688a841d27ab2707bd479dbdfa93c  plasma-integration-5.12.1.tar.xz
e43d587afe912e3f29a708dd91dd940f  plasma-tests-5.12.1.tar.xz
466e30427fa30adba80847ca422223f2  plymouth-kcm-5.12.1.tar.xz
6d60b5684501b81777563f7f1fc7e0f4  xdg-desktop-portal-kde-5.12.1.tar.xz
8f784bb3f4140e0cc044d9fbecd72aac  drkonqi-5.12.1.tar.xz
170eb8041db38303c0daaf1399cf0153  plasma-vault-5.12.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.

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.22 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.12.1.md5

exit

cd $KF5_PREFIX/share/plasma/plasmoids

for j in $(find -name \*.js); do
  as_root ln -sfv ../code/$(basename $j) $(dirname $j)/../ui/
done

Command Explanations

ln -sfv ../code/$(basename $j) $(dirname $j)/../ui/: Create symbolic links so qml files can find needed javascript modules.

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 a TTY, using xinit-1.3.4.

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

cat > ~/.xinitrc << "EOF"
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

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