Files
RedBear-OS/local/recipes/kde/kwin/recipe.toml
T
vasilito 200149647b docs: kirigami+kwin recipe honesty — Qt6Quick language aligned with repos
qtdeclarative exports Qt6Quick metadata; downstream QML proof insufficient.
Replaced stale 'cross-compilation not yet available' wording.
2026-04-29 11:30:29 +01:00

129 lines
4.1 KiB
TOML

#TODO: KWin Wayland compositor — DRM backend → scheme:drm, libinput → via evdevd, session → seatd
# Real build requires Qt6Quick/QML runtime proof (qtdeclarative exports Qt6Quick metadata,
# but downstream QML-dependent build and runtime paths are insufficient).
# Stub provides cmake configs for downstream dependency resolution only.
# When Qt6Quick/QML downstream proof is sufficient, this recipe should be replaced
# with a real build using the inspect/ overlay approach.
[source]
tar = "https://invent.kde.org/plasma/kwin/-/archive/v6.3.4/kwin-v6.3.4.tar.gz"
blake3 = "2aa1e234a75b0aa94f0da3a74d93e2a8e49b30a3afb12dc24b2ecd3abaa94e7f"
[build]
template = "custom"
dependencies = [
"qtbase",
"kf6-extra-cmake-modules",
"kf6-kcoreaddons",
"kf6-kconfig",
"kf6-kwindowsystem",
"kf6-kglobalaccel",
]
script = """
DYNAMIC_INIT
STAGE="${COOKBOOK_STAGE}/usr"
mkdir -p "${STAGE}/lib/cmake/KWin"
mkdir -p "${STAGE}/lib/cmake/KWinEffects"
mkdir -p "${STAGE}/include/kwin"
mkdir -p "${STAGE}/lib"
mkdir -p "${STAGE}/bin"
# KWin cmake config — INTERFACE target for dependency resolution
cat > "${STAGE}/lib/cmake/KWin/KWinConfig.cmake" << 'EOFCFG'
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
if(_IMPORT_PREFIX STREQUAL "/")
set(_IMPORT_PREFIX "")
endif()
add_library(KWin::kwin INTERFACE IMPORTED)
set_target_properties(KWin::kwin PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/kwin"
)
set(KWin_FOUND TRUE)
set(KWin_VERSION "6.3.4")
set(KWin_LIBRARIES KWin::kwin)
EOFCFG
cat > "${STAGE}/lib/cmake/KWin/KWinConfigVersion.cmake" << 'EOFVER'
set(PACKAGE_VERSION "6.3.4")
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()
EOFVER
cat > "${STAGE}/lib/cmake/KWin/KWinTargets.cmake" << 'EOFTGT'
add_library(KWin::kwin INTERFACE IMPORTED)
EOFTGT
# KWinEffects cmake config
cat > "${STAGE}/lib/cmake/KWinEffects/KWinEffectsConfig.cmake" << 'EOFECFG'
add_library(KWin::Effects INTERFACE IMPORTED)
set(KWinEffects_FOUND TRUE)
set(KWinEffects_VERSION "6.3.4")
EOFECFG
cat > "${STAGE}/lib/cmake/KWinEffects/KWinEffectsConfigVersion.cmake" << 'EOFEVER'
set(PACKAGE_VERSION "6.3.4")
set(PACKAGE_VERSION_COMPATIBLE TRUE)
EOFEVER
# Dummy library for link resolution
echo "/* kwin stub */" > "${STAGE}/lib/libkwin.a"
# kwin_wayland — thin wrapper around redbear-compositor when available
cat > "${STAGE}/bin/kwin_wayland" << 'EOFBIN'
#!/bin/sh
if command -v redbear-compositor >/dev/null 2>&1; then
exec redbear-compositor "$@"
fi
echo "KWin: Wayland compositor not yet available on Redox"
exit 0
EOFBIN
chmod +x "${STAGE}/bin/kwin_wayland"
# kwin_wayland_wrapper — launches the real compositor when available, or falls back to stub
cat > "${STAGE}/bin/kwin_wayland_wrapper" << 'EOFBIN'
#!/bin/sh
RUNTIME_DIR="${XDG_RUNTIME_DIR:-/tmp/run/redbear-greeter}"
DISPLAY="${WAYLAND_DISPLAY:-wayland-0}"
mkdir -p "$RUNTIME_DIR"
if command -v redbear-compositor >/dev/null 2>&1; then
echo "kwin_wayland_wrapper: launching redbear-compositor" >&2
export WAYLAND_DISPLAY="${DISPLAY}"
export XDG_RUNTIME_DIR="${RUNTIME_DIR}"
exec redbear-compositor
fi
echo "kwin_wayland_wrapper: redbear-compositor not found, using stub" >&2
if [ ! -e "$RUNTIME_DIR/$DISPLAY" ]; then
touch "$RUNTIME_DIR/$DISPLAY"
fi
while true; do sleep 3600; done
EOFBIN
chmod +x "${STAGE}/bin/kwin_wayland_wrapper"
# Minimal kwin header stubs for downstream compilation
cat > "${STAGE}/include/kwin/kwinevents.h" << 'EOFHDR'
#pragma once
/* KWin stub header for downstream dependency resolution */
EOFHDR
echo "=== KWin stub installation complete ==="
echo "Note: Real KWin requires Qt6Quick/QML + Wayland compositor runtime."
echo "Dummy cmake configs and library installed for dependency resolution."
"""
[package]
dependencies = [
"kf6-kwindowsystem",
]