From f6704e99ebd099b67cc31d135df359e6470f920b Mon Sep 17 00:00:00 2001 From: vasilito Date: Sat, 1 Aug 2026 15:07:53 +0300 Subject: [PATCH] kde: port kf6-kcoreaddons to Redox + disable Python bindings across KF6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 (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. --- local/recipes/kde/kf6-kcoreaddons/recipe.toml | 1 + .../recipes/kde/kf6-kcoreaddons/source/CMakeLists.txt | 8 +++++++- .../kde/kf6-kcoreaddons/source/src/lib/CMakeLists.txt | 7 ++++++- .../source/src/lib/io/kfilesystemtype.cpp | 11 ++++++++++- local/recipes/kde/kf6-kguiaddons/recipe.toml | 1 + local/recipes/kde/kf6-kio/source/CMakeLists.txt | 5 ++++- local/recipes/kde/kf6-kjobwidgets/recipe.toml | 1 + local/recipes/kde/kf6-knotifications/recipe.toml | 1 + local/recipes/kde/kf6-kwidgetsaddons/recipe.toml | 1 + local/recipes/kde/kf6-kxmlgui/recipe.toml | 1 + 10 files changed, 33 insertions(+), 4 deletions(-) diff --git a/local/recipes/kde/kf6-kcoreaddons/recipe.toml b/local/recipes/kde/kf6-kcoreaddons/recipe.toml index 23819f63e4..53ea6e5509 100644 --- a/local/recipes/kde/kf6-kcoreaddons/recipe.toml +++ b/local/recipes/kde/kf6-kcoreaddons/recipe.toml @@ -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 \ diff --git a/local/recipes/kde/kf6-kcoreaddons/source/CMakeLists.txt b/local/recipes/kde/kf6-kcoreaddons/source/CMakeLists.txt index ab8df66171..f5aebbfe18 100644 --- a/local/recipes/kde/kf6-kcoreaddons/source/CMakeLists.txt +++ b/local/recipes/kde/kf6-kcoreaddons/source/CMakeLists.txt @@ -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() diff --git a/local/recipes/kde/kf6-kcoreaddons/source/src/lib/CMakeLists.txt b/local/recipes/kde/kf6-kcoreaddons/source/src/lib/CMakeLists.txt index 85d8da492c..39949d2285 100644 --- a/local/recipes/kde/kf6-kcoreaddons/source/src/lib/CMakeLists.txt +++ b/local/recipes/kde/kf6-kcoreaddons/source/src/lib/CMakeLists.txt @@ -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) diff --git a/local/recipes/kde/kf6-kcoreaddons/source/src/lib/io/kfilesystemtype.cpp b/local/recipes/kde/kf6-kcoreaddons/source/src/lib/io/kfilesystemtype.cpp index 8f406d7027..b9850cb50d 100644 --- a/local/recipes/kde/kf6-kcoreaddons/source/src/lib/io/kfilesystemtype.cpp +++ b/local/recipes/kde/kf6-kcoreaddons/source/src/lib/io/kfilesystemtype.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 +#if !defined(Q_OS_REDOX) #include // A lot of the filesystem superblock MAGIC numbers +#endif +// Redox has no ; the #ifndef fallbacks below define every magic +// this file switches on, so the value table is complete without it. #include // Add known missig magics diff --git a/local/recipes/kde/kf6-kguiaddons/recipe.toml b/local/recipes/kde/kf6-kguiaddons/recipe.toml index fb8fe124d3..dbe343bdeb 100644 --- a/local/recipes/kde/kf6-kguiaddons/recipe.toml +++ b/local/recipes/kde/kf6-kguiaddons/recipe.toml @@ -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 \ diff --git a/local/recipes/kde/kf6-kio/source/CMakeLists.txt b/local/recipes/kde/kf6-kio/source/CMakeLists.txt index bed131f9dc..28af461090 100644 --- a/local/recipes/kde/kf6-kio/source/CMakeLists.txt +++ b/local/recipes/kde/kf6-kio/source/CMakeLists.txt @@ -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() diff --git a/local/recipes/kde/kf6-kjobwidgets/recipe.toml b/local/recipes/kde/kf6-kjobwidgets/recipe.toml index c03b4b4375..d4dac362a1 100644 --- a/local/recipes/kde/kf6-kjobwidgets/recipe.toml +++ b/local/recipes/kde/kf6-kjobwidgets/recipe.toml @@ -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 \ diff --git a/local/recipes/kde/kf6-knotifications/recipe.toml b/local/recipes/kde/kf6-knotifications/recipe.toml index c2e15c119e..c1c3c3bb87 100644 --- a/local/recipes/kde/kf6-knotifications/recipe.toml +++ b/local/recipes/kde/kf6-knotifications/recipe.toml @@ -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 diff --git a/local/recipes/kde/kf6-kwidgetsaddons/recipe.toml b/local/recipes/kde/kf6-kwidgetsaddons/recipe.toml index b4ba53146c..5870ed384a 100644 --- a/local/recipes/kde/kf6-kwidgetsaddons/recipe.toml +++ b/local/recipes/kde/kf6-kwidgetsaddons/recipe.toml @@ -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 diff --git a/local/recipes/kde/kf6-kxmlgui/recipe.toml b/local/recipes/kde/kf6-kxmlgui/recipe.toml index 56ae2dd7c4..79496b4cd6 100644 --- a/local/recipes/kde/kf6-kxmlgui/recipe.toml +++ b/local/recipes/kde/kf6-kxmlgui/recipe.toml @@ -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 \