kde: port kf6-kcoreaddons to Redox + disable Python bindings across KF6

kf6-kcoreaddons (first KF6 framework to build on Redox) needed:
- LibMount made optional (was REQUIRED under CMAKE_SYSTEM_NAME==Linux, which the
  Redox cross toolchain reports); KMountPoint falls back to statfs (relibc has
  it). Same change in kf6-kio.
- BUILD_PYTHON_BINDINGS=OFF (pulled REQUIRED Python3/Shiboken6/PySide6 — dev-only,
  not on Redox). Applied to kf6-{kcoreaddons,knotifications,kwidgetsaddons,
  kguiaddons,kjobwidgets,kxmlgui}.
- kfilesystemtype.cpp: the inner OS #if chain had no #else so Redox got no
  determineFileSystemTypeImpl — added Q_OS_REDOX to the Q_OS_LINUX (statfs) arm
  and guarded <linux/magic.h> (the #ifndef fallbacks define every magic).
- clock-skew engine: CMakeLists compiled the _linux (timerfd) engine on Redox
  but engine.cpp's create() dispatches to the DBus engine when !Q_OS_LINUX —
  compile the _dbus engine on Redox instead so they agree.
This commit is contained in:
2026-08-01 15:07:53 +03:00
parent 5dc606fe10
commit f6704e99eb
10 changed files with 33 additions and 4 deletions
@@ -36,6 +36,7 @@ cmake "${COOKBOOK_SOURCE}" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="${COOKBOOK_SYSROOT}" \
-DBUILD_TESTING=OFF \
-DBUILD_PYTHON_BINDINGS=OFF \
-DBUILD_QCH=OFF \
-DKCOREADDONS_USE_QML=OFF \
-DUSE_DBUS=ON \
@@ -72,7 +72,13 @@ else()
endif()
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
find_package(LibMount REQUIRED)
# LibMount (util-linux) parses the Linux mount table (/proc/mounts,
# /etc/mtab), which does not exist on Redox — the cross toolchain reports
# CMAKE_SYSTEM_NAME=Linux, so this branch runs there too. Make it optional:
# when libmount is absent, kfilesystemtype.cpp falls back to statfs(2) +
# f_type magic (relibc provides statfs on Redox), which is the correct
# filesystem-type path for a scheme-based OS with no mount table.
find_package(LibMount)
set(HAVE_LIB_MOUNT ${LibMount_FOUND})
endif()
@@ -186,7 +186,12 @@ target_sources(KF6CoreAddons PRIVATE
util/kruntimeplatform.h
)
if(CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "Android")
# Redox reports CMAKE_SYSTEM_NAME=Linux but is NOT Q_OS_LINUX in Qt, so
# ksystemclockskewnotifierengine.cpp's create() takes the #elif HAVE_QTDBUS
# path. Compile the matching _dbus.cpp there (not the _linux.cpp timerfd engine),
# so the two agree. Detect Redox via the cross compiler path since the system
# name is Linux.
if((CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "Android") AND NOT CMAKE_CXX_COMPILER MATCHES "redox")
target_sources(KF6CoreAddons PRIVATE util/ksystemclockskewnotifierengine_linux.cpp)
elseif(HAVE_QTDBUS)
target_sources(KF6CoreAddons PRIVATE util/ksystemclockskewnotifierengine_dbus.cpp)
@@ -74,10 +74,19 @@ KFileSystemType::Type determineFileSystemTypeImpl(const QByteArray &path)
return kde_typeFromName(buf.f_fstypename);
}
#elif defined(Q_OS_LINUX)
#elif defined(Q_OS_LINUX) || defined(Q_OS_REDOX)
// Redox provides statfs(2)/f_type via relibc, so it uses the same
// magic-number path as Linux. The inner OS #if chain has no #else, so without
// this a Redox build leaves determineFileSystemTypeImpl undefined. libmount and
// udev are unavailable (HAVE_LIB_MOUNT/HAVE_UDEV are off), which the branch
// already compiles cleanly without.
#include <sys/statfs.h>
#if !defined(Q_OS_REDOX)
#include <linux/magic.h> // A lot of the filesystem superblock MAGIC numbers
#endif
// Redox has no <linux/magic.h>; the #ifndef fallbacks below define every magic
// this file switches on, so the value table is complete without it.
#include <sys/stat.h>
// Add known missig magics
@@ -35,6 +35,7 @@ cmake "${COOKBOOK_SOURCE}" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="${COOKBOOK_SYSROOT}" \
-DBUILD_TESTING=OFF \
-DBUILD_PYTHON_BINDINGS=OFF \
-DBUILD_QCH=OFF \
-DWITH_WAYLAND=OFF \
-DWITH_X11=OFF \
@@ -136,7 +136,10 @@ set_package_properties(ACL PROPERTIES DESCRIPTION "LibACL"
# Used by KMountPoint
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
find_package(LibMount REQUIRED)
# Optional on Redox (no /proc/mounts mount table; the cross toolchain still
# reports CMAKE_SYSTEM_NAME=Linux). Without libmount, KMountPoint falls back
# to statfs(2), which relibc provides. See kf6-kcoreaddons for the rationale.
find_package(LibMount)
set(HAVE_LIB_MOUNT ${LibMount_FOUND})
endif()
@@ -39,6 +39,7 @@ cmake "${COOKBOOK_SOURCE}" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="${COOKBOOK_SYSROOT}" \
-DBUILD_TESTING=OFF \
-DBUILD_PYTHON_BINDINGS=OFF \
-DBUILD_QCH=OFF \
-DUSE_DBUS=ON \
-DWITH_X11=OFF \
@@ -63,6 +63,7 @@ cmake "${COOKBOOK_SOURCE}" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="${COOKBOOK_SYSROOT}" \
-DBUILD_TESTING=OFF \
-DBUILD_PYTHON_BINDINGS=OFF \
-DBUILD_QCH=OFF \
-DUSE_DBUS=ON \
-Wno-dev
@@ -38,6 +38,7 @@ cmake "${COOKBOOK_SOURCE}" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="${COOKBOOK_SYSROOT}" \
-DBUILD_TESTING=OFF \
-DBUILD_PYTHON_BINDINGS=OFF \
-DBUILD_QCH=OFF \
-Wno-dev
@@ -65,6 +65,7 @@ cmake "${COOKBOOK_SOURCE}" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="${COOKBOOK_SYSROOT}" \
-DBUILD_TESTING=OFF \
-DBUILD_PYTHON_BINDINGS=OFF \
-DBUILD_QCH=OFF \
-DBUILD_WITH_QML=OFF \
-DUSE_DBUS=ON \