Verified Commit 7abeca20 authored by Hartmut Goebel's avatar Hartmut Goebel
Browse files

TEMP Add some Readme-files for packaging Plasma for Guix.

This is just to pass my knowledge and processing to somebody who wants to
work in Plasma for Guix.
parent 79196540
This branch contains my work for bringing the KDE Plasma dekstop to Guix.
Hartmut Goebel, Juni 2019
* 10-TODO-….txt contain the status of my efforts (which might be outdated) and
a lot of snippets useful for building packages and making tests pass.
Please at least skim through these files as they contain lots hof hints and
some gems :-)
The most central of this is the "Status Unit-tests" in
10-TODO-plasma.txt. This documents the status of building the packages
required for plasma. I'm encouraging you to use this list to avoid getting
lost :-)
* Proposed approach
1. Make the packages listed in "Status Unit-tests" in
10-TODO-plasma.txt. build and (most) tests pass. This list hopefully
contains all package required for a minimal Plasma desktop service.
I suggest using the plasma versions currently package on this branch to
avoid introducing more issues.
2. Build a system (see gnu/system/examples/plasma.tmpl and
gnu/services/desktop.scm) which starts runs a small (or even minimal)
Plasma desktop.
3. Define two (maybe more) desktop-services:
- plasma-minimal
- plasma
(- plasma-all-bells-and-wistels)
* Notes about my Commit messages
I'm using pre- and postfixes in my commit messages:
- TEMP: This is an intermediate commit to preserve some state. This might be
dropped, merged, fixed, etc. later.
- REWORD: Message needs rewording (e.g. is not written well or unfinished)
- FIXUP: This is a fixup for another commit, which should be `fixup`d using
`git rebase -i` soon.
- SQUASH: same, but to be `sqash`ed.
- WIP: work in progress, commited to preserve acceptable state
- TODO: This is unfinished work
Further reading:
* https://lists.gnu.org/archive/html/guix-devel/2017-11/msg00161.html
* https://lists.gnu.org/archive/html/guix-devel/2017-10/msg00185.html
===================
KDE-Frameworks
===================
Update Instructions
==========================
To update all KDE Frameworks packages process as follows:
- sh ./kde-update # (adjust!) or run "guix download" manually
- sh ./kde-build.sh # (adjust!)
- ./kde-filter-buildlog.py # run one-by-one?
Status Unit-tests 5.49.0
===================================
extra-cmake-modules ✔
;; Tier 1
attica ✔ (1 test requiring network access disabled)
bluez-qt tests hang
breeze-icons ✔
kapidox ✔ (no test-suite)
karchive ✔
kcodecs ✔
kconfig ✔
kcoreaddons 1 blacklisted
kdbusaddons ✔
kdnssd ✔
kguiaddons ✔
ki18n ✔
kidletime ✔
kirigami ✔
kitemmodels ✔
kitemviews ✔
kplotting ✔
ksyntaxhighlighting ✔
kwayland tests require weston to run, weston requires wayland flags in mesa
kwidgetsaddons ✔
kwindowsystem 2 blacklisted
modemmanager-qt ✔
networkmanager-qt ✔
oxygen-icons ✔
prison ✔
qqc2-desktop-style ✔
solid ✔
sonnet ✔
threadweaver ✔
;; Tier 2
kactivities ✔
kauth ✔
kcompletion ✔
kcrash ✔
kdoctools ✔
kfilemetadata 1 blacklisted (weil Container getxattr nicht unterstützt)
kimageformats 1 blacklisted (did also fail at the KDE CI farm)
kjobwidgets ✔
knotifications ✔
kpackage ✔
kpty 1/1 tests fail.
kunitconversion 1 tests disabled, FIXME: re-enable if fixed upstream
;; Tier 3
baloo ✔ (but one test fails on i686 and aarch64)
kactivities-stats ✔
kbookmarks ✔
kcmutils ✔
kconfigwidgets ✔
kdeclarative ✔
kded ✔
kdesignerplugin ✔
kdesu ✔
kdewebkit ✔
kemoticons ✔
kglobalaccel ✔
kiconthemes ✔
kinit ✔
kio 41/50 tests fail.
knewstuff ✔
knotifyconfig ✔
kparts ✔
kpeople 1/3 tests fail.
krunner 2 blacklisted
kservice 6/10 tests fail - findet service-defs nicht check-after-install???
ktexteditor 5/66 tests fail:
ktextwidgets ✔
kwallet ✔
kxmlgui 1/5 tests fail.
kxmlrpcclient ✔
plasma-framework 9/15 tests fail. (service types not found)
;; Tier 4
kde-frameworkintegration ✔
kdelibs4support 1 blacklisted, 2 disabled
khtml ✔
kjs ✔
kjsembed ✔
kmediaplayer ✔
kross ✔
Find dependencies KDE uses for building
==================================================
https://cgit.kde.org/sysadmin/ci-tooling.git/tree/system-images/suse-qt511/Dockerfile
How does the test-environemnt KDE uses look like?
=================================================
Build-Specs are in
<https://cgit.kde.org/sysadmin/ci-tooling.git/tree/build-specs>
Environment is build using
<https://cgit.kde.org/sysadmin/ci-tooling.git/tree/helpers/run-tests.py>:
- in-source-build? (default: False)
- XDG_RUNTIME_DIR='/tmp/runtime-kdeci/' + mkdir $XDG_RUNTIME_DIR
- force-inject-asan? (default: False)
Address Sanitizer library used for -fsanitize=address instrumented programs
-> LD_PRELOAD=...
- 'QT_LOGGING_RULES' = "*.debug=true" ;; make Qt noisy about debug output to make debugging tests easier
- 'QT_LOGGING_TO_CONSOLE' = '1' ;; force Qt to print to stderr
- 'QT_FORCE_STDERR_LOGGING' = '1'
- 'CTEST_OUTPUT_ON_FAILURE' = '1'
- setup-x-environment? (default: True)
-> Xvfb :90 -ac -screen 0 1600x1200x24+32
-> DISPLAY=:90
-> sleep(5) ; Give Xvfb a few moments to get on it's feet
-> openbox
- launch-dbus-session? (default: True)
-> export $(dbus-launch)
- Wenn usingInstall+'share/mime' existiert
-> update-mime-database DIRNAME
- kdeinit5 && sleep(5)
- ctest -T test
Snippets for Tests
===========================
These are commonly used snippets to make the tests pass in guix
(add-before 'build 'setup-build
(lambda* (#:key inputs #:allow-other-keys)
;; FIXME build phase doesn't find parts.desktop
(setenv "XDG_DATA_DIRS"
(string-append (assoc-ref inputs "kparts") "/share"))
`(#:configure-flags
`(,(string-append "-DKDE_INSTALL_DATADIR="
(assoc-ref %outputs "out") "/share"))
(add-before 'configure 'patch-cmakelists
(lambda _
(substitute* "processcore/CMakeLists.txt"
(("KAUTH_HELPER_INSTALL_DIR") "KDE_INSTALL_LIBEXECDIR"))))
;; (assoc-ref %standard-phases 'check))
(add-before 'check 'check-setup
(lambda* (#:key inputs #:allow-other-keys)
(setenv "HOME" (getcwd))
(setenv "TMPDIR" "/tmp")
(setenv "CTEST_OUTPUT_ON_FAILURE" "1") ; enable debug output
;; make Qt render "offscreen", required for tests
(setenv "QT_QPA_PLATFORM" "offscreen")
(setenv "QT_PLUGIN_PATH"
(string-append out "/lib/plugins:"
(getenv "QT_PLUGIN_PATH")))
(setenv "QT_DEBUG_PLUGINS" "1") ; important helper!
(setenv "QML_IMPORT_TRACE" "1") ;; Trace QML import issues
(setenv "XDG_RUNTIME_DIR" "/tmp")
(setenv "XDG_DATA_DIRS"
(string-append
(assoc-ref inputs "shared-mime-info") "/share:"
(assoc-ref inputs "kjobwidgets") "/share:"
(getenv "XDG_DATA_DIRS")))
(setenv "TZDIR" ; KDateTimeTestsome needs TZDIR
(string-append (assoc-ref inputs "tzdata")
"/share/zoneinfo"))
#t))
(add-before 'check 'start-xorg-server
(lambda* (#:key inputs #:allow-other-keys)
;; The test suite requires a running X server.
(system (string-append (assoc-ref inputs "xorg-server")
"/bin/Xvfb :1 &"))
(setenv "DISPLAY" ":1")
#t))
(replace 'check
(lambda _
(setenv "DBUS_FATAL_WARNINGS" "0")
(setenv "CTEST_OUTPUT_ON_FAILURE" "1") ; enable debug output
(use-modules (ice-9 rdelim))
(use-modules (ice-9 popen))
(use-modules (ice-9 match))
(let ((port (open-input-pipe "dbus-launch")))
(do ((line (read-line port) (read-line port)))
((eof-object? line))
(match (string-split line (char-set #\=))
((varname value)
(setenv varname value))
(_ #t))) ;; skip any no-matching line
(close-pipe port))
(invoke
"strace" "-o" "trace.txt" "-f" "-e" "trace=file"
"dbus-launch"
"ctest" ".")))
;; GuixSD's polkit service stores actions under
;; /etc/polkit-1/actions.
(substitute* "src/polkitbackend/polkitbackendinteractiveauthority.c"
(("PACKAGE_DATA_DIR \"/polkit-1/actions\"")
"PACKAGE_SYSCONF_DIR \"/polkit-1/actions\""))
export $(dbus-launch)
/usr/bin/strace -o /tmp/trace.txt -f -e trace=file \
ctest --output-on-failure -R runnercontexttest .
Patches from NixOS
===================
2018-02-13
kinit/kinit-libpath.patch -- PRÜFEN
+ // Try to load the library relative to the active profiles.
+ QByteArrayList profiles = qgetenv("GUIX_KF5INIT_LIB_PATH").split(':');
+ for (const QByteArray &profile: profiles) {
+ if (!profile.isEmpty()) {
+ l.setFileName(QFile::decodeName(profile) + QStringLiteral("/") + libpath);
+ if (l.load()) break;
+ }
+ }
extra-cmake-modules -- no need, we just replace "lib64" by "lib"
kauth -- implemented since dc2ef09ad79803f2cc4828ef18927ca0e75e24fa
kcmutils -- done
kconfigwidgets -- done
kdelibs4support -- comment added
kdoctools -- NixOS doesn't search for package DocBookXML. Can't see any reason
why we should adopt this
kfilemetadata -- NixOS installs .cmake files into the @dev@ package, we don't
do so. Thus we do not need 'cmake-install-paths.patch'.
kiconthemes -- NixOS changes the defaut icon theme, we keep what KF5 wants.
kinit/kdeinit-extra_libs.patch -- done
kinit/kinit-libpath.patch -- PRÜFEN
kinit/start_kdeinit-path.patch -- don't need
-> prüfen: CMAKE_INSTALL_FULL_LIBEXECDIR_KF5 "/start_kdeinit"
/gnu/store/... muss in executable start_kdeinit_wrapper sein
kio/kio-debug-module-loader.patch -- implemented since
bb4fcf7ba6c361f45215c0200515b7270d93dbdc
kio/samba-search-path.patch -- done
kpackage -- done
kservice -- done
kwindowsystem -- NixOS has a patch to find plugins at some special place. We
don't need this, since we use Qt-mechanism ($QT_PLUGIN_PATH).
kdelibs4support
---------------------
FAIL! : KStandarddirsTest::testResourceDirs() 'dir.endsWith("xdg/") || dir.endsWith("share/config/") || dir.endsWith(".kde-unit-test/xdg/config/")' returned FALSE. (/tmp/guix-build-kdelibs4support-5.39.0.drv-0/build/.kde-unit-test/xdg/config/./)
Loc: [/tmp/guix-build-kdelibs4support-5.39.0.drv-0/kdelibs4support-5.39.0/autotests/kstandarddirstest.cpp(113)]
FAIL! : KStandarddirsTest::testFindAllResources() 'dbusInterfaceFiles.count() > 20' returned FALSE. ()
Loc: [/tmp/guix-build-kdelibs4support-5.39.0.drv-0/kdelibs4support-5.39.0/autotests/kstandarddirstest.cpp(183)]
FAIL! : KStandarddirsTest::testFindResourceDir() '!configDir.isEmpty()' returned FALSE. ()
Loc: [/tmp/guix-build-kdelibs4support-5.39.0.drv-0/kdelibs4support-5.39.0/autotests/kstandarddirstest.cpp(289)]
Notes
===================
KAUTH_POLICY_FILES_INSTALL_DIR kauth
/gnu/store/…-kauth-5.27.0/lib64/cmake/KF5Auth/KF5AuthConfig.cmake
KDE4_AUTH_POLICY_FILES_INSTALL_DIR kdeliibs4support
/gnu/store/…-kdelibs4support-5.27.0/lib64/cmake/KDELibs4/KDELibsDependencies.cmake
set(KAUTH_POLICY_FILES_INSTALL_DIR "/gnu/store/4zv2cq8gh6jkvwl2d7mbq9llvx9ljdm1-kauth-5.27.0/share/polkit-1/actions")
src/ConfigureChecks.cmake: set(KAUTH_POLICY_FILES_INSTALL_DIR ${POLKITQT_POLICY_FILES_INSTALL_DIR} CACHE STRING
set(KAUTH_POLICY_FILES_INSTALL_DIR "@KAUTH_POLICY_FILES_INSTALL_DIR@")
muss was werden wie:
include("${CMAKE_CURRENT_LIST_DIR}/KF5AuthTargets.cmake")
===================
KDE Applications
===================
See 10-KDE-Frameworks.txt für snippets and more information.
ark ;; some tests fail
filelight ;; builds, but "unable to load filelight part"
kcalc
kcharselect
kdf
kfloppy
ktimer
kgpg ;; not build, still requires kde 4 and KdepimLibs
kwalletmanager
sweeper ;; not build, still requires kde4
printer-applet: seems to be no longer maintained
kremote-control: still requires KDE4
https://community.kde.org/KDE_Utils additionally lists
"ksecretservice" (KDE secrets management infrastructure, aiming to replace KDE
wallet) which seems to not be finished yet.
=====================
KDE Plasma
=====================
When Plasma is running on GuixSD, enlist GuixSD at
https://community.kde.org/Plasma/Packages
See 10-KDE-Frameworks.txt für snippets and more information.
TODO
============================
Patch startkde (and startplasma?:
XDG_DATA_DIRS=/gnu/store/...:/run/current-system/profile/share/
Packages added after 5.12.2
===================================
drkonqi-5.14.4.tar.xz
kde-gtk-config-5.14.4.tar.xz
kinfocenter-5.14.4.tar.xz
plasma-browser-integration-5.14.4.tar.xz
plasma-vault-5.14.4.tar.xz
plymouth-kcm-5.14.4.tar.xz
xdg-desktop-portal-kde-5.14.4.tar.xz
Desktop-Service
----------------------
Not sure what this notes are for, I assume this is a list of rin-time packages
required to run plasma (kinit)
xrdb
xprop
xmessage
qttools
kinit
kconfig
#plasma-desktop kapplymousetheme -> fehlt
qtdeclarative
xset
xsetroot
Snippets for Commit messages or comments
========================================
Use this template to provide document what you tried to make tests pass, but
did not suffice.
Setting QT_PLUGIN_PATH,
starting a X11-server, openbox and kdeinit5
or running ctest via dbus-launch
are not sufficient to make the
two failing test-cases pass.
Snippets for Tests
===========================
See 10-KDE-Frameworks.txt
https://community.kde.org/KWin/Wayland
https://community.kde.org/Get_Involved/Quality/Tutorial
KDE test-environment [2] per default [1] does this:
- starts `Xvfb :90 -ac -screen 0 1600x1200x24+32`
- starts `openbox`
- runs `dbus-launch` and sets all the environement variables
- runs `update-mime-database …/share/mime`
- runs `kdeinit5` in the background
- runs `ctest -T Test --output-on-failure … --timeout {timeLimit} {additionalCTestArguments}"`
[1] https://cgit.kde.org/sysadmin/ci-tooling.git/tree/helpers/helperslib/BuildSpecs.py#n54
[2] https://cgit.kde.org/sysadmin/ci-tooling.git/tree/helpers/run-tests.py
* settings for individual packages (one about a dozen) are at
https://cgit.kde.org/sysadmin/ci-tooling.git/tree/build-specs
Interactively running tests within a guix build-environment
--------------------------------------------------------------
# guix environment …
cd ../build
make install
export CTEST_OUTPUT_ON_FAILURE=1
Xvfb :98 -screen 0 640x480x24 &
$GUIX_ENVIRONMENT/bin/strace -f -o ../trace.log \
bin/testBuiltInEffectLoader
ctest -R testBuiltInEffectLoader
ctest --force-new-ctest-process -R testBuiltInEffectLoader
Status Unit-tests 5.49.0
===================================
overall stauts (first column):
✔: finished
`build`-status:
(b) builds successfully
(d) all config dependencies are added
(+) all dependencies are added
`test*-status:
w-blist: tests blacklisted
w-fail: some tests still fail
+: pass or given up at a reasonable acceptance level
log: logfile checked
lic: lizenz checked
desc: homepage, synopsis, description finished
lint: guix lint passed
discover
/var/log/guix/drvs/mp/l34qr78jc1052j0zy4n88snyqklhcx-discover-5.10.1.drv.bz2
warnings during generation of metainfo for org.kde.discovernotifier:
Package type "Plasma/Applet" not found
build tests log
bluedevil ✔ + + +
discover later bd - - deferred
breeze-gtk ✔ + + +
kactivitymanagerd ✔ + + -
kdecoration ✔ + + +
kgamma5 ✔ + + +
--kholidays-- . + w-fail . frameworks.scm
kscreenlocker ✔ + + +
ksshaskpass ✔ + + +
ksysguard ✔ + + +
kwallet-pam ✔ + + +
kwayland-integration ✔ + + +
breeze ✔ + + +
kwin . . w-fail . TODO 35/77 tests fail
kwrited ✔ + + +
--libkscreen-- . . w-blist . build by somebody else
milou ✔ + + +
oxygen ✔ + + +
plasma-nm ✔ + + +
plasma-pa ✔ + + +
plasma-sdk . . . .
--> see below
plasma-tests . . . .
plasma-workspace-wallpapers ✔ + + +
polkit-kde-agent-1 ✔ + + +
sddm-kcm ✔ + + +
user-manager ✔ + + +
---
plasma-workspace . . w-fail .
---
kde-cli-tools . X w-fail . plasma-workspace
kscreen . . . . plasma-workspace
systemsettings . . . . plasma-workspace
kdeplasma-addons . . . .
khotkeys . . . .
kmenuedit . . . .
plasma-integration . . w-fail .
powerdevil . . . .
---
plasma-desktop . . w-blist .
breeze-grub . . . .
breeze-plymouth dep. missing - -
plasma-workspace requirements
============================================
requirements used by other Gnu/Linux distributions
fedora nix debian
-------- ----------- -----------
docbook-dtds kconfig coreadons
docbook-ste-xsl libdbusmenu kconfig
kdewebkit libkscreen kdewebkit
kdoctools libXcursor kdoctools
kfilemetadata pam kinit
kinit qtgraphicaleffects kio
libkscreen qtquickcontrols knotifyconfig
libxml2-utils qtquickcontrols2 libgp
wayland libraw1394-dev,
pam Libudev-dev (systemd)
-libxi
libxkbcommon
libxkbfile
lm-sensors
pam
libdbusmenu-qt
qttools5
wayland
xapian-core
xcb-proto
Find dependencies
==================================================
Several places where to find required packages:
https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/x11/desktop-managers/plasma5.nix
https://github.com/NixOS/nixpkgs/tree/master/pkgs/desktops/plasma-5
https://apps.fedoraproject.org/packages/
https://cgit.kde.org/sysadmin/ci-tooling.git/tree/system-images/suse-qt511/Dockerfile
Check if the tests for a packages actually passes at KDE
============================================================
For some package versions text fail even at KDE jenkins. THus it is worth
spending checking prior to spending time on fixing:
https://build.kde.org/ # jenkins
-> search project
-> go to last passing build
-> "show unformated"
Random Snippets
========================
build:/gnu/store/8vsh99baxxsh2qbf0c0g77hiyzk7nvj0-qemu-image
Run Plasma in a Test-System (QEMU)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hint: I had had some helper scripts to run within the VM to simplify testing,
but these got lsot somewhen.
# build the VM
./pre-inst-env guix system vm-image --image-size=7G --fallback \
--share=$PWD=/exchange \
gnu/system/examples/plasma.tmpl
# copy generated system-image and make it writeable (so you can change
# things within the system without rebuilding the system-image, e.g.
# build packages)
cp … /var/tmp/plasma-image
chmod +w /var/tmp/plasma-image
# garbace-collect generated system-image
guix gc -d …
# run the system
qemu-system-x86_64 -m 2048 -smp 2 -enable-kvm -cpu host \
-net nic,model=virtio -net user,hostfwd=tcp::10022-:22 \
-virtfs local,path="$PWD",security_model=none,mount_tag="TAG_PWD" \
-virtfs local,path=/gnu/store,security_model=none,mount_tag="TAG_STORE" \
-drive file=/var/tmp/plasma-image &
Find desktop-file defining a property
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
find /gnu/store/* -name \*.desktop 2>/dev/null | \
xargs grep -rl PropertyDef::X-KDE-DBus-ModuleName
Build packages within the VM
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# log into the VM (port 10022 is forwarded to port 22, see above)
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 10022 \
root@localhost
# make your development environment available within the VM (this needs to
# keep the same absolute path to avois re-configure
mkdir -p /exchange /path/of/your/develop/env/on/the/host