Difference between revisions of "Guidelines and HOWTOs/Build from source/Test plasma"

(add a command line block)
(Redirected page to Get Involved/development#Plasma)
(One intermediate revision by the same user not shown)
Line 1: Line 1:
= Prepare the testing environment =
#REDIRECT [[Get Involved/development#Plasma]]
Save the following script as /opt/kde/runPlasma5.sh
<syntaxhighlight lang="bash">
if [ -d /etc/X11/xinit/xinitrc.d ]; then
  for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
  unset f
DISTRO=`source /etc/os-release 2>/dev/null; echo $ID_LIKE`
export KF5=/opt/kde/install
export QTDIR=/opt/qt5      # Change if you have your own qt build
export PATH=$KF5/bin:$QTDIR/bin:$PATH
export QT_PLUGIN_PATH=$KF5/lib/plugins:$KF5/lib64/plugins:$QTDIR/plugins:$QT_PLUGIN_PATH
#On some distros, this is $KF5/lib64/qml:$QTDIR/qml or something similar. After the installation, choose the directory/directories which contains the "qt/qml" folder.
export QML2_IMPORT_PATH=$KF5/lib/qml:$QTDIR/qml
#Fixes for Debian's "look at me, I'm so important" setups
if [ $DISTRO == "debian" ]  
    export QT_PLUGIN_PATH=$KF5/lib/`uname -m`-linux-gnu/plugins:$QTDIR/plugins
    export QML2_IMPORT_PATH=$KF5/lib/`uname -m`-linux-gnu/qml:$QTDIR/qml
export XDG_DATA_DIRS=$KF5/share:/usr/share
export XDG_CONFIG_DIRS=$KF5/etc/xdg:/etc/xdg
# Uncomment to change default home paths
#export XDG_DATA_HOME=$HOME/.kde5/local
#export XDG_CONFIG_HOME=$HOME/.kde5/config
#export XDG_CACHE_HOME=$HOME/.kde5/cache
exec startkde
For what works on Debian Sid alongside with packaged KF5 nicely see:
[https://wiki.debian.org/KdeBuildingFromSource Using (parts of) self-built KF 5, Plasma 5 and/or KDE Applications on Debian]
= Configure dbus =
Because we installed Plasma 5 to a custom path, we need to make dbus aware of these new locations.
Create a file /etc/dbus-1/session-local.conf with the following contents:
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
Create another file /etc/dbus-1/system-local.conf with the following contents:
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
Because dbus will load all these new paths each time you login, you should rename these files (to eg system-local.conf.bk and session-local.conf.bk) before starting your default Plasma 4 or other distro sessions.
= Running Plasma =
Finally, there are several ways of running Plasma 5. Choose the one which suits you best.
== Using a login manager==
The recommended login manager is SDDM. But this method should work with any login manager.
<syntaxhighlight lang="bash">
sudo cp /opt/kde/runPlasma5.sh /usr/share/xsessions
sudo chmod +x /usr/share/xsessions/runPlasma5.sh
sudo cp /opt/kde/install/share/xsessions/plasma.desktop  /usr/share/xsessions/plasmaGit.desktop
Edit /usr/share/xsessions/plasmaGit.desktop and change the paths as:
Name=Plasma Git
After this logout of your current session, select Plasma Git in the options and login. You should now have the last Plasma 5 running.
== Using ~/.config/plasma-workspace/env ==
This is what I found works on Debian Sid nicely. Put the script which sets up the environment into ~/.config/plasma-workspace/env, chmod +x it and be done. Aside from the "Using a login manager" approach probably – I didn´t test it –, this is the only thing that worked on Debian. Additionally to that it does not need any changes to system wide configuration files. This directory replaced  ~/.kde/env from KDE SC 4 and older times.
Specifically none of the put it into some user wide or system wide shell profile files worked. Also putting it at start of /usr/bin/startkde worked, as environment still got reset to the default.
== From the command line ==
- Edit your xinitrc file :
<syntaxhighlight lang="bash">
mv ~/.xinitrc ~/.xinitrc.bk                # Backup any existing xinitrc file
ln -s /opt/kde/runPlasma5.sh ~/.xinitrc
Log out of your current session, login to a tty (eg tty2 by pressing <code>Ctrl+Alt+F2</code>) and run <code>startx</code>. This should read your ~/.xinitrc and log you into a Plasma 5 desktop.
- Instead of editing your xinitrc, you can simply override it by running <code>startx /opt/kde/runPlasma5.sh</code>.
== KAuth/Polkit applications ==
Due to system security DBus activation on the system bus which can switch users as well as all polkit policy files are only read from /etc/
If you have a working system, generally this step is optional and only needed when working on those components
If installing to a non-default prefix you will need to:
<syntaxhighlight lang="bash">
sudo ln -s /opt/kde5/etc/dbus-1/system.d/*  /etc/dbus-1/system.d/.
sudo ln -s /opt/kde5/etc/polkit-1/rules.d*  /etc/polkit-1/rules.d.

Latest revision as of 15:40, 22 June 2019

This page was last edited on 22 June 2019, at 15:40. Content is available under Creative Commons License SA 4.0 unless otherwise noted.