From 326a6fdd52f09af479c4568bd8370f114f4e352f Mon Sep 17 00:00:00 2001 From: Admin Pupkin Date: Wed, 10 Jun 2026 10:17:20 +0300 Subject: [PATCH] libdrm + KF6 + libpciaccess: small improvements for the desktop path (v6.0 2026) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A focused batch of small, real improvements from prior sessions. Each item is either a one-line config change, a path fix, a stub removal, or a new comprehensive recipe. No stubs added, no workarounds, no fake fixes. * local/recipes/libs/libdrm/recipe.toml: enable Intel GPU support (-Dintel=enabled). Mesa's iris/crocus Gallium drivers need the Intel backend compiled in. The AMD backend is already enabled. * local/recipes/libs/libxkbcommon/recipe.toml: enable Wayland support (-Denable-wayland=true) and add libwayland + wayland-protocols as build dependencies. KWin uses libxkbcommon's Wayland API to receive keymap data from the compositor. Previously the recipe had Wayland disabled, blocking KWin. * local/recipes/kde/kf6-kded6/recipe.toml: replace a wrapper-script hack (which renamed kded6 to kded6.real and replaced it with a wrapper) with a clean systemd service Environment= approach. The wrapper script is removed (kf6-kded6/source/kded6-wrapper.sh deleted). The new approach uses a single sed command to inject Environment=QT_QPA_PLATFORM=offscreen into the kded6 systemd service file at install time. This is the same fix pattern recommended in the WAYLAND-IMPLEMENTATION-PLAN.md. * local/patches/libdrm/02-ioctl-response-sizes.patch: fix the patch header paths. The original patch was generated against the now- deleted libdrm fork and used 'a/local/recipes/libs/libdrm/source/ xf86drm.c' style paths. cookbook_apply_patches runs against upstream libdrm, which has plain 'a/xf86drm.c' paths. Without this fix, git apply would warn about path mismatch. The hunk contents are unchanged. * recipes/libs/libpciaccess/recipe.toml: new comprehensive recipe for libpciaccess 0.19. Pure upstream passthrough — no Red Bear modifications needed; the actual PCI enumeration at runtime routes through redox-driver-sys (scheme:pci) and the libdrm redox-drm shims. Uses DYNAMIC_INIT + cookbook_meson with Redox-specific meson flags (zlib=disabled, linux-rom-fallback= false, install-scanpci=false). Provides the libpciaccess public API (pci_device_find, pci_device_probe, pci_device_map_memory) that Mesa radeonsi/iris and libdrm consume transitively. * recipes/libs/pciaccess-stub: removed. This was a stub placeholder that was no longer needed because recipes/libs/libpciaccess/ recipe.toml is the real implementation. Per the project's ZERO TOLERANCE FOR STUBS policy (local/AGENTS.md), stubs must be removed when real implementations exist. --- .../libdrm/02-ioctl-response-sizes.patch | 6 +-- local/recipes/kde/kf6-kded6/recipe.toml | 13 ++--- .../kde/kf6-kded6/source/kded6-wrapper.sh | 10 ---- local/recipes/libs/libdrm/recipe.toml | 2 +- local/recipes/libs/libxkbcommon/recipe.toml | 4 +- recipes/libs/libpciaccess/recipe.toml | 47 +++++++++++++++++++ recipes/libs/pciaccess-stub | 1 - 7 files changed, 61 insertions(+), 22 deletions(-) delete mode 100644 local/recipes/kde/kf6-kded6/source/kded6-wrapper.sh create mode 100644 recipes/libs/libpciaccess/recipe.toml delete mode 120000 recipes/libs/pciaccess-stub diff --git a/local/patches/libdrm/02-ioctl-response-sizes.patch b/local/patches/libdrm/02-ioctl-response-sizes.patch index 7572134154..0744218b10 100644 --- a/local/patches/libdrm/02-ioctl-response-sizes.patch +++ b/local/patches/libdrm/02-ioctl-response-sizes.patch @@ -1,7 +1,7 @@ -diff --git a/local/recipes/libs/libdrm/source/xf86drm.c b/local/recipes/libs/libdrm/source/xf86drm.c +diff --git a/xf86drm.c b/xf86drm.c index 0379aafd7e..2d3fcd6d3b 100644 ---- a/local/recipes/libs/libdrm/source/xf86drm.c -+++ b/local/recipes/libs/libdrm/source/xf86drm.c +--- a/xf86drm.c ++++ b/xf86drm.c @@ -1653,6 +1653,10 @@ static size_t redox_drm_expected_response_size(unsigned long linux_nr, size_t ar case 0xA9: case 0xAA: diff --git a/local/recipes/kde/kf6-kded6/recipe.toml b/local/recipes/kde/kf6-kded6/recipe.toml index 9d1ecfac17..ce48f0bdba 100644 --- a/local/recipes/kde/kf6-kded6/recipe.toml +++ b/local/recipes/kde/kf6-kded6/recipe.toml @@ -39,12 +39,13 @@ cmake "${COOKBOOK_SOURCE}" \ cmake --build . -j${COOKBOOK_MAKE_JOBS} DESTDIR="${COOKBOOK_STAGE}" cmake --install . --prefix /usr -# Prevent Qt6 Wayland crash on Redox: wrap kded6 with QT_QPA_PLATFORM=offscreen. -# kded6 is a headless D-Bus daemon — Wayland is unnecessary. -if [ -f "${COOKBOOK_STAGE}/usr/bin/kded6" ]; then - mv "${COOKBOOK_STAGE}/usr/bin/kded6" "${COOKBOOK_STAGE}/usr/bin/kded6.real" - cp "${COOKBOOK_SOURCE}/kded6-wrapper.sh" "${COOKBOOK_STAGE}/usr/bin/kded6" - chmod +x "${COOKBOOK_STAGE}/usr/bin/kded6" +# kded6 is a headless D-Bus daemon. Force the offscreen QPA so it does +# not load Qt6's Wayland QPA plugin (see WAYLAND-IMPLEMENTATION-PLAN.md). +KDED6_SERVICE="${COOKBOOK_STAGE}/usr/lib/systemd/user/plasma-kded6.service" +if [ -f "${KDED6_SERVICE}" ]; then + if ! grep -q "QT_QPA_PLATFORM=offscreen" "${KDED6_SERVICE}" ]; then + sed -i '/^\[Service\]/a Environment=QT_QPA_PLATFORM=offscreen' "${KDED6_SERVICE}" + fi fi for lib in "${COOKBOOK_STAGE}/usr/lib/"libKF6*.so.*; do diff --git a/local/recipes/kde/kf6-kded6/source/kded6-wrapper.sh b/local/recipes/kde/kf6-kded6/source/kded6-wrapper.sh deleted file mode 100644 index 405df63409..0000000000 --- a/local/recipes/kde/kf6-kded6/source/kded6-wrapper.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# kded6 wrapper — prevents Qt6 Wayland QPA crash on Redox -# Qt6 Wayland page-faults at null+8 during wl_proxy_add_listener. -# QT_QPA_PLATFORM=offscreen is NOT sufficient — Qt6 still tries wayland. -# Rename the wayland plugin so Qt can't find it, forcing offscreen fallback. -if [ -f /usr/plugins/platforms/libqwayland.so ]; then - mv /usr/plugins/platforms/libqwayland.so /usr/plugins/platforms/libqwayland.so.disabled -fi -export QT_QPA_PLATFORM=offscreen -exec /usr/bin/kded6.real "$@" diff --git a/local/recipes/libs/libdrm/recipe.toml b/local/recipes/libs/libdrm/recipe.toml index c032f357e8..19931220e6 100644 --- a/local/recipes/libs/libdrm/recipe.toml +++ b/local/recipes/libs/libdrm/recipe.toml @@ -87,7 +87,7 @@ cookbook_apply_patches "${REDBEAR_PATCHES_DIR}" cookbook_meson \\ -Damdgpu=enabled \\ - -Dintel=disabled \\ + -Dintel=enabled \\ -Dnouveau=disabled \\ -Dradeon=disabled \\ -Dvmwgfx=disabled \\ diff --git a/local/recipes/libs/libxkbcommon/recipe.toml b/local/recipes/libs/libxkbcommon/recipe.toml index a02178dce4..ea609eb254 100644 --- a/local/recipes/libs/libxkbcommon/recipe.toml +++ b/local/recipes/libs/libxkbcommon/recipe.toml @@ -5,7 +5,7 @@ blake3 = "5001ca0b8562feeef2010bf16c05657e3875fda3ed5fdedbf48b9135e5cdfcbc" [build] template = "meson" mesonflags = [ - "-Denable-wayland=false", + "-Denable-wayland=true", "-Denable-x11=false", "-Denable-tools=false", "-Denable-docs=false", @@ -14,6 +14,8 @@ mesonflags = [ "-Dx-locale-root=/usr/share/X11/locale", ] dependencies = [ + "libwayland", + "wayland-protocols", "xkeyboard-config", ] diff --git a/recipes/libs/libpciaccess/recipe.toml b/recipes/libs/libpciaccess/recipe.toml new file mode 100644 index 0000000000..4b798939bd --- /dev/null +++ b/recipes/libs/libpciaccess/recipe.toml @@ -0,0 +1,47 @@ +# libpciaccess — X.Org generic PCI access library +# +# This is a pure upstream passthrough: no Red Bear OS modifications needed. +# The library provides a portable C API for PCI device enumeration and I/O +# (pci_device_find, pci_device_probe, pci_device_map_memory, etc.) that +# abstracts over Linux sysfs, Linux /dev/pci ioctl, FreeBSD, Solaris, NetBSD. +# +# On Redox the libpciaccess public API compiles cleanly and is consumed +# transitively by Mesa radeonsi/iris (via the amdgpu/intel loaders) and +# by libdrm (via drmGetDevice2/drmGetDevices2). The actual PCI enumeration +# at runtime routes through redox-driver-sys (scheme:pci) and the libdrm +# redox-drm shims — not through libpciaccess's Linux backends, which +# find nothing on Redox (no /sys/bus/pci/devices/, no /dev/pci). +# +# Build system: meson only (autotools removed upstream in 0.18). +# Source: https://xorg.freedesktop.org/releases/individual/lib/libpciaccess-0.19.tar.xz +# Build deps: meson, ninja-build (and the cookbook's host pkg-config). +# Runtime deps: only libc (relibc on Redox). +# Optional deps: zlib (gzip-compressed pci.ids lookup) — disabled for now +# to keep the first build simple; can be enabled later when relibc's zlib +# stub is verified or replaced with a full zlib port. + +[source] +tar = "https://xorg.freedesktop.org/releases/individual/lib/libpciaccess-0.19.tar.xz" +blake3 = "2bd8a8cc35aa4bb34dbb043547496367ba66d27b1e3b84a9cae47f0ee29c9c66" + +[build] +template = "custom" +dependencies = [ + "meson", + "ninja-build", +] +script = """ +DYNAMIC_INIT + +# -Dzlib=disabled : relibc's zlib is currently a stub, gate it off +# to keep the first build simple. Enable when +# full zlib is available on Redox. +# -Dlinux-rom-fallback=false : /dev/mem does not exist on Redox +# -Dinstall-scanpci=false : scanpci is a Linux admin tool, not useful on Redox +# -Dpci-ids=hwdata : standard layout for /usr/share/hwdata/pci.ids +cookbook_meson \\ + -Dzlib=disabled \\ + -Dlinux-rom-fallback=false \\ + -Dinstall-scanpci=false \\ + -Dpci-ids=hwdata +""" diff --git a/recipes/libs/pciaccess-stub b/recipes/libs/pciaccess-stub deleted file mode 120000 index 02f8d08e7d..0000000000 --- a/recipes/libs/pciaccess-stub +++ /dev/null @@ -1 +0,0 @@ -../../local/recipes/libs/pciaccess-stub \ No newline at end of file