32. KDE Plasma 5
KDE Plasma 5是一个使用KDE Frameworks 5和QML构建的桌面环境,它运行在使用Qt5、QtQuick 2和OpenGL(-ES)场景的全硬件加速图形堆栈之上。
在构建KDE Plasma 5之前不需要额外的配置,因为它使用与KDE Frameworks 5相同的配置。
32.1 Building Plasma 5
KDE Plasma 5是基于KDE Frameworks 5和QML之上的软件包集合。它们实现了KDE显示环境(Plasma 5)。
已知此包可以使用LFS 11.3平台进行构建并正常工作。
下面的说明通过使用bash脚本一步构建所有的Plasma 5包。
包信息
-
Download (HTTP): https://download.kde.org/stable/plasma/5.26.5
-
下载MD5校验和: See Below
-
下载大小: 192 MB
-
预计所需的磁盘空间: 1.7 GB (419 MB installed)
-
预计构建时间: 18 SBU (using parallelism=4)
Plasma 5 依赖
必要
GTK+-2.24.33, GTK+-3.24.36, KDE Frameworks-5.103.0, kuserfeedback-1.2.0, libpwquality-1.4.5, libqalculate-4.5.1, libxkbcommon-1.5.0, Mesa-22.3.5 built with Wayland-1.21.0, NetworkManager-1.42.0, pipewire-0.3.66, PulseAudio-16.1, qca-2.3.5, sassc-3.6.2, taglib-1.13, 和 xcb-util-cursor-0.1.4
推荐
fftw-3.3.10, gsettings-desktop-schemas-43.0, libdbusmenu-qt-0.9.3+16.04.20160218, libcanberra-0.30, libinput-1.22.1, libpcap-1.10.3, Linux-PAM-1.5.2, lm-sensors-3-6-0, oxygen-icons5-5.103.0, and pciutils-3.9.0
推荐 (运行时)
AccountsService-22.08.8, smartmontools-7.3, 和 Xwayland-22.1.8
可选
GLU-9.0.2, ibus-1.5.27, qtwebengine-5.15.12, Xorg Synaptics Driver-1.9.2, appstream-qt, KDevPlatform, libgps, libhybris, libraw1394, mockcpp, packagekit-qt, Qalculate, Qapt, SCIM, 和 socat (for pam_kwallet)
注意
qtwebengine-5.15.12 是aura-browser需要的,它仍处于beta开发阶段。对于另外两个包:libksysguard和kdeplasma-addons,它也是可选的。如果稍后安装QtWebEngine,则只需要重新构建这两个包。这允许在系统监视器应用程序中更完整地显示。
用户笔记: https://wiki.linuxfromscratch.org/blfs/wiki/kf5
下载 KDE Plasma5
获取KDE Plasma5包的最简单方法是使用单个wget来一次获取它们:
url=https://download.kde.org/stable/plasma/5.26.5/
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
设置打包顺序
由于内部依赖关系,构建文件的顺序很重要。按以下顺序创建文件列表:
cat > plasma-5.26.5.md5 << "EOF"
e436a039ec6b0016e5f52a71a5086ad8 kdecoration-5.26.5.tar.xz
ec10440342d3b227499b61bbf86c04ab libkscreen-5.26.5.tar.xz
a7a235a4d105eaa37c9c9923f34b7019 libksysguard-5.26.5.tar.xz
65c2bc9680f8830b1fdfc231a2923fe7 breeze-5.26.5.tar.xz
b43a9abaa1dbf083fbac92febf06ee62 breeze-gtk-5.26.5.tar.xz
2a5c3f9ddb0dd1394574c85237c6a99d layer-shell-qt-5.26.5.tar.xz
fbf3d2ff3dcfe2eb6770f18f0784b693 kscreenlocker-5.26.5.tar.xz
44db61e1b0c27d951cfc0dd45fa19947 oxygen-5.26.5.tar.xz
4a04fbf14eee03b81a5f95701758dadc kinfocenter-5.26.5.tar.xz
6b2566e536949698fcb43ecb1cb331c8 kwin-5.26.5.tar.xz
9b5ddbc03683da742ac0c03c821d9084 plasma-workspace-5.26.5.tar.xz
4c118121937c0c92ab9630b28be83aab plasma-disks-5.26.5.tar.xz
3440d7a273988cddb711ddd864ae85d7 bluedevil-5.26.5.tar.xz
75f668ce669e853565c375937ca6db3b kde-gtk-config-5.26.5.tar.xz
6e8673a19904011d79d9b8fd69890443 khotkeys-5.26.5.tar.xz
7425d8cd9889bdb327b8a8b339274aa5 kmenuedit-5.26.5.tar.xz
6f600d487eda8fd2cddf3e13c322ce78 kscreen-5.26.5.tar.xz
def2d41c607309fdb622b270833b6078 kwallet-pam-5.26.5.tar.xz
ce7b641d174973be3b944f9279609eaf kwayland-integration-5.26.5.tar.xz
eb2171403b7fbae6b257404f58fea865 kwrited-5.26.5.tar.xz
fc04856efefea7eba22064e7afdbddf7 milou-5.26.5.tar.xz
adb5371f4383332da2d7bdc643d1ba3d plasma-nm-5.26.5.tar.xz
8a277824eec12d339b9b0cec40e141da plasma-pa-5.26.5.tar.xz
5112039742fa249c6272196fd2ea9b8c plasma-workspace-wallpapers-5.26.5.tar.xz
1319507df888d5d1d1584487c72bb41c polkit-kde-agent-1-5.26.5.tar.xz
1636fa123a48123922c6bd9114601188 powerdevil-5.26.5.tar.xz
9c85a12b5fc4593ee3c9c3602b7c1fd7 plasma-desktop-5.26.5.tar.xz
297ae0e3b025e2d8a9a6b4301aed97b3 kgamma5-5.26.5.tar.xz
b34c0f8e8f00c881fa6636941a646cdf ksshaskpass-5.26.5.tar.xz
#5310bb325acaacddd75cfcc9beb720ae plasma-sdk-5.26.5.tar.xz
579e478775361bbb3499e1ec5b5011a1 sddm-kcm-5.26.5.tar.xz
4c5d0fd055f04e9104de1039fb3d19e4 discover-5.26.5.tar.xz
#4eddbae9f9e4add3637dd9fd99290047 breeze-grub-5.26.5.tar.xz
#ddbea7d8d6c6bc3953039075628de7ee breeze-plymouth-5.26.5.tar.xz
7a85cf42b67ac38e490f0749cd25496e kactivitymanagerd-5.26.5.tar.xz
235d1c02582787ff5dd825fae434e6f9 plasma-integration-5.26.5.tar.xz
a97a00137fcd4e446cbf849983bd1e64 plasma-tests-5.26.5.tar.xz
#d16a86f8aee8e7f0da084535cdccca7f plymouth-kcm-5.26.5.tar.xz
49abaee061653e65afe9ba509c6aef41 xdg-desktop-portal-kde-5.26.5.tar.xz
8ea7332f06db75e41357cfe49d893042 drkonqi-5.26.5.tar.xz
e147fcf2d2cfc030c3a5e12373e8dc29 plasma-vault-5.26.5.tar.xz
a17305d04e3f43cd2c63870e58aa1002 plasma-browser-integration-5.26.5.tar.xz
d7bf771ac16efb7b8c3c4e6a34193002 kde-cli-tools-5.26.5.tar.xz
5c9d258caff107e2d668308fbdc1b88a systemsettings-5.26.5.tar.xz
fb368c5c4ac28061a706c3558e4c4b66 plasma-thunderbolt-5.26.5.tar.xz
#ebe05c7b3b95d0dca235830ab17b8d57 plasma-nano-5.26.5.tar.xz
#cb64c2c61676c499f1807184928083c7 plasma-mobile-5.26.5.tar.xz
0ac0a579b57b76e664d172845ae06a07 plasma-firewall-5.26.5.tar.xz
d5c8bac2d756982328cd541649a7002b plasma-systemmonitor-5.26.5.tar.xz
17608c1fb4b6503193a5769f35c7f9e5 qqc2-breeze-style-5.26.5.tar.xz
146cef26a5a9b3c82d46cabd6842a07c ksystemstats-5.26.5.tar.xz
6943aba014019057384b47339bb8ed0a oxygen-sounds-5.26.5.tar.xz
#7CF5ED434a6d21fd8458f89207986b9a aura-browser-5.26.5.tar.xz
fc695034a7236fb6eab8a324216bc710 kdeplasma-addons-5.26.5.tar.xz
71fce4036d0f6a6fdc9bf5db3d47b9c9 kpipewire-5.26.5.tar.xz
26e7ae5887a56e971d2510262f9e0b55 plank-player-5.26.5.tar.xz
116e7d1a64ee17d5a31aed066709725a plasma-bigscreen-5.26.5.tar.xz
d55d570e84840440f89233c8915e5872 plasma-remotecontrollers-5.26.5.tar.xz
EOF
关于注释掉包
上面的breeze-grub、breeze-plymouth和Plymouth -kcm包都是用于定制对Plymouth的支持,它被设计为在引导期间在初始ram磁盘中运行(参见“关于initramfs”一节)(5.File_systems_and_disk_management.md#51-about-initramfs)。plasma-sdk包是可选的,用于软件开发。等离子体纳米封装用于嵌入式系统,等离子体移动为等离子体提供电话功能。aura-browser包仍处于beta开发阶段,需要qtwebengine-5.15.12。
安装Plasma5
注意
当在脚本中安装多个包时,需要以root用户进行安装。有三种常用选项可用于此操作:
-
以root用户(不推荐)运行整个脚本。
-
使用Sudo-1.9.13p1 包中的sudo命令。
-
使用 su -c “command arguments” (需要引号),它将在每次循环迭代时询问根密码。
处理这种情况的一种方法是创建一个简短的bash函数,它自动选择适当的方法。一旦在环境中设置了该命令,就不需要再次设置。
as_root()
{
if [ $EUID = 0 ]; then $*
elif [ -x /usr/bin/sudo ]; then sudo $*
else su -c \\"$*\\"
fi
}
export -f as_root
首先,启动一个子shell,它会在出错时退出:
bash -e
运行以下命令安装所有软件包:
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.26.5.md5
exit
如果你没有将$KF5_PREFIX设置为/usr, 创建符号链接以允许显示管理器找到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 plasmawayland.desktop ] ||
as_root ln -sfv $KF5_PREFIX/share/wayland-sessions/plasmawayland.desktop
配置 Plasma
Linux PAM 配置
如果您使用推荐的Linux PAM支持构建Plasma,那么以root用户运行以下命令创建必要的配置文件:
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
启动 Plasma5
你可以使用xinit-1.4.2从TTY启动Plasma5。
要使用xinit-1.4.2启动Plasma 5,运行以下命令:
cat > ~/.xinitrc << "EOF"
dbus-launch --exit-with-x11 $KF5_PREFIX/bin/startplasma-x11
EOF
startx
X会话在第一个未使用的虚拟终端上开始,通常是vt7。你可以换到另一个vt
startx &> ~/x-session-errors
在关闭或重新启动时,关机消息出现在运行X的虚拟机上。如果您希望看到这些消息,同时按Alt-F7键(假设X在vt7上运行)。
内容
安装程序: 有太多的plasma程序(在/opt/kf5/bin中有63个),无法在这里单独列出。
安装库: 有太多的plasma库(在/opt/kf5/lib中有40个),无法在这里单独列出。
安装目录: 有太多的plasma目录(在/opt/kf5中超过1000个),无法在这里单独列出。