From be17bbc9bc3fe236342b08cc7bbbee2abe4588bb Mon Sep 17 00:00:00 2001 From: Vasilito Date: Thu, 7 May 2026 04:35:57 +0100 Subject: [PATCH] milestone1 --- config/base.toml | 2 +- config/minimal.toml | 2 +- config/redbear-full.toml | 2 +- config/redbear-mini.toml | 2 +- local/patches/libwayland/redox.patch | 45 +- .../qtbase/P1-qplatformopengl-guard.patch | 47 +- .../patches/relibc/P3-eventfd-cbindgen.patch | 6 +- .../patches/relibc/P3-eventfd-readwrite.patch | 35 + local/patches/relibc/P3-stddef-reorder.patch | 20 + .../kde/kf6-attica/source/CMakeLists.txt | 2 +- .../kde/kf6-kcmutils/source/CMakeLists.txt | 2 + .../kf6-kcolorscheme/source/CMakeLists.txt | 2 + .../kde/kf6-kcompletion/source/CMakeLists.txt | 2 + .../kf6-kconfigwidgets/source/CMakeLists.txt | 2 + .../kf6-kdeclarative/source/CMakeLists.txt | 2 +- .../kde/kf6-kiconthemes/source/CMakeLists.txt | 2 + .../kde/kf6-kitemmodels/source/CMakeLists.txt | 2 +- .../kf6-kitemmodels/source/src/CMakeLists.txt | 2 +- .../kde/kf6-kitemviews/source/CMakeLists.txt | 2 + .../kde/kf6-kjobwidgets/source/CMakeLists.txt | 2 + .../kf6-ktextwidgets/source/CMakeLists.txt | 2 + .../source/src/kswitchlanguagedialog_p.cpp | 6 +- .../kde/kf6-solid/source/CMakeLists.txt | 2 +- local/recipes/qt/qtbase/recipe.toml | 54 +- local/recipes/qt/qtbase/recipe.toml.bak | 746 ++++++++++++++++++ local/recipes/qt/qtbase/redox.patch | 174 ++-- local/recipes/qt/qtdeclarative/recipe.toml | 2 + .../system/redbear-greeter/recipe.toml | 1 + .../wayland/libwayland/recipe.toml.bak | 22 + .../wayland/libwayland/source/meson.build | 4 +- .../libwayland/source/src/connection.c | 10 +- .../libwayland/source/src/event-loop.c | 51 +- .../wayland/libwayland/source/src/meson.build | 2 +- .../libwayland/source/src/wayland-client.c | 3 +- .../libwayland/source/src/wayland-server.c | 19 +- recipes/core/relibc/recipe.toml | 6 + recipes/tools/diffutils/recipe.toml | 3 + 37 files changed, 973 insertions(+), 317 deletions(-) create mode 100644 local/patches/relibc/P3-eventfd-readwrite.patch create mode 100644 local/patches/relibc/P3-stddef-reorder.patch create mode 100644 local/recipes/qt/qtbase/recipe.toml.bak create mode 100644 local/recipes/wayland/libwayland/recipe.toml.bak diff --git a/config/base.toml b/config/base.toml index 3f82fc061..972d858df 100644 --- a/config/base.toml +++ b/config/base.toml @@ -29,7 +29,7 @@ data = """ description = "Base environment setup (tmpdir)" [service] -cmd = "ion" +cmd = "zsh" args = ["-c", "rm -rf /tmp; mkdir -m a=rwxt /tmp"] type = "oneshot" """ diff --git a/config/minimal.toml b/config/minimal.toml index b2fbe7fa9..974aeb793 100644 --- a/config/minimal.toml +++ b/config/minimal.toml @@ -12,7 +12,7 @@ filesystem_size = 196 ca-certificates = {} coreutils = {} extrautils = {} -ion = {} +zsh = {} pkgutils = {} kibi = {} diff --git a/config/redbear-full.toml b/config/redbear-full.toml index 24a2dafa6..948ab1aa9 100644 --- a/config/redbear-full.toml +++ b/config/redbear-full.toml @@ -430,7 +430,7 @@ requires_weak = [ ] [service] -cmd = "ion" +cmd = "zsh" args = ["-c", "echo BOOT_COMPLETE_SERIAL_MARKER"] type = "oneshot" """ diff --git a/config/redbear-mini.toml b/config/redbear-mini.toml index b5601840c..23c704749 100644 --- a/config/redbear-mini.toml +++ b/config/redbear-mini.toml @@ -89,7 +89,7 @@ iommu = {} bash = {} bottom = {} #curl = {} # suppressed: nghttp2 dependency chain fails; curl not needed for boot/recovery -diffutils = {} +#diffutils = {} # suppressed: gnulib #include_next wrappers conflict with relibc header structure (circular stddef→stdint→sys/types→wchar→stdio chain) findutils = {} #git = {} # suppressed: cascading rebuild; git not needed for boot/recovery htop = {} diff --git a/local/patches/libwayland/redox.patch b/local/patches/libwayland/redox.patch index 6dfb02547..7521425f6 100644 --- a/local/patches/libwayland/redox.patch +++ b/local/patches/libwayland/redox.patch @@ -1,4 +1,4 @@ ---- a/src/meson.build +--- a/src/meson.build.orig +++ b/src/meson.build @@ -81,8 +81,7 @@ endif @@ -10,33 +10,9 @@ else wayland_scanner_for_build = wayland_scanner endif ---- a/src/wayland-server.c -+++ b/src/wayland-server.c -@@ -39,7 +39,23 @@ - #include - #include - #include --#include -+#ifndef EFD_CLOEXEC -+#define EFD_CLOEXEC O_CLOEXEC -+#endif -+#ifndef EFD_NONBLOCK -+#define EFD_NONBLOCK O_NONBLOCK -+#endif -+#ifndef EFD_SEMAPHORE -+#define EFD_SEMAPHORE 0x1 -+#endif -+static int eventfd(unsigned int initval, int flags) { -+ int oflag = O_RDWR; -+ if (flags & EFD_CLOEXEC) oflag |= O_CLOEXEC; -+ if (flags & EFD_NONBLOCK) oflag |= O_NONBLOCK; -+ char path[64]; -+ snprintf(path, sizeof(path), "/scheme/event/eventfd/%u/%d", initval, (flags & EFD_SEMAPHORE) ? 1 : 0); -+ return open(path, oflag); -+} - #include - #include - + +--- a/src/wayland-client.c.orig ++++ b/src/wayland-client.c @@ -649,6 +649,11 @@ wl_proxy_add_listener(struct wl_proxy *proxy, void (**implementation)(void), void *data) @@ -65,3 +41,16 @@ return proxy->display; } + +--- a/src/connection.c.orig ++++ b/src/connection.c +@@ -37,6 +37,9 @@ + #include + #include + #include ++#ifndef MSG_NOSIGNAL ++#define MSG_NOSIGNAL 0 ++#endif + #include + #include + diff --git a/local/patches/qtbase/P1-qplatformopengl-guard.patch b/local/patches/qtbase/P1-qplatformopengl-guard.patch index e4645e6f1..6aa3cf1eb 100644 --- a/local/patches/qtbase/P1-qplatformopengl-guard.patch +++ b/local/patches/qtbase/P1-qplatformopengl-guard.patch @@ -1,46 +1 @@ ---- a/src/plugins/platforms/wayland/hardwareintegration/qwaylandclientbufferintegration_p.h -+++ b/src/plugins/platforms/wayland/hardwareintegration/qwaylandclientbufferintegration_p.h -@@ -51,8 +51,10 @@ - virtual bool supportsThreadedOpenGL() const { return false; } - virtual bool supportsWindowDecoration() const { return false; } - -+#if QT_CONFIG(opengl) - virtual QWaylandWindow *createEglWindow(QWindow *window) = 0; - virtual QPlatformOpenGLContext *createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const = 0; -+#endif - virtual bool canCreatePlatformOffscreenSurface() const { return false; } - #if QT_CONFIG(opengl) - virtual QOpenGLContext *createOpenGLContext(EGLContext context, EGLDisplay contextDisplay, QOpenGLContext *shareContext) const = 0; -@@ -67,5 +71,7 @@ - virtual void *nativeResource(NativeResource /*resource*/) { return nullptr; } -+#if QT_CONFIG(opengl) - virtual void *nativeResourceForContext(NativeResource /*resource*/, QPlatformOpenGLContext */*context*/) { return nullptr; } -+#endif - }; - - } ---- a/src/plugins/platforms/wayland/qwaylandintegration.cpp -+++ b/src/plugins/platforms/wayland/qwaylandintegration.cpp -@@ -137,7 +137,11 @@ - return false; - case OffscreenSurface: -+#if QT_CONFIG(opengl) - return mDisplay->clientBufferIntegration() - && mDisplay->clientBufferIntegration()->canCreatePlatformOffscreenSurface(); -+#else -+ return false; -+#endif - default: return QPlatformIntegration::hasCapability(cap); - } - } -@@ -148,7 +152,9 @@ - QPlatformWindow *QWaylandIntegration::createPlatformWindow(QWindow *window) const - { -+#if QT_CONFIG(opengl) - if (window->surfaceType() == QWindow::OpenGLSurface - && mDisplay->clientBufferIntegration()) - return mDisplay->clientBufferIntegration()->createEglWindow(window); -+#endif - - #if QT_CONFIG(vulkan) - +../../../../local/patches/qtbase/P1-qplatformopengl-guard.patch \ No newline at end of file diff --git a/local/patches/relibc/P3-eventfd-cbindgen.patch b/local/patches/relibc/P3-eventfd-cbindgen.patch index 5ac92168c..e55a20bc0 100644 --- a/local/patches/relibc/P3-eventfd-cbindgen.patch +++ b/local/patches/relibc/P3-eventfd-cbindgen.patch @@ -1,19 +1,17 @@ diff --git a/src/header/sys_eventfd/cbindgen.toml b/src/header/sys_eventfd/cbindgen.toml new file mode 100644 -index 00000000..c47f467f +index 00000000..a1b2c3d4 --- /dev/null +++ b/src/header/sys_eventfd/cbindgen.toml -@@ -0,0 +1,13 @@ +@@ -0,0 +1,11 @@ +sys_includes = ["stdint.h"] +after_includes = """ +typedef uint64_t eventfd_t; -+int eventfd(unsigned int initval, int flags); +""" +include_guard = "_SYS_EVENTFD_H" +language = "C" +style = "Tag" +no_includes = true +cpp_compat = true -+ +[enum] +prefix_with_name = true diff --git a/local/patches/relibc/P3-eventfd-readwrite.patch b/local/patches/relibc/P3-eventfd-readwrite.patch new file mode 100644 index 000000000..d54aa16f2 --- /dev/null +++ b/local/patches/relibc/P3-eventfd-readwrite.patch @@ -0,0 +1,35 @@ +--- a/src/header/sys_eventfd/mod.rs ++++ b/src/header/sys_eventfd/mod.rs +@@ -5,6 +5,7 @@ + use crate::c_str::{CStr, CString}; + use crate::error::{Errno, ResultExt}; + use crate::header::fcntl::{O_CLOEXEC, O_NONBLOCK, O_RDWR}; ++use crate::header::errno::EFAULT; + use crate::header::errno::EINVAL; + use crate::platform::{Pal, Sys, types::{c_int, c_uint}}; + +@@ -35,3 +36,24 @@ + } + Sys::open(CStr::borrow(&cpath), oflag, 0).or_minus_one_errno() + } ++ ++#[unsafe(no_mangle)] ++pub extern "C" fn eventfd_read(fd: c_int, value: *mut eventfd_t) -> c_int { ++ if value.is_null() { ++ return Err::(Errno(EFAULT)).or_minus_one_errno(); ++ } ++ let mut buf = [0u8; 8]; ++ match Sys::read(fd, &mut buf) { ++ Ok(8) => { unsafe { *value = u64::from_ne_bytes(buf); } 0 } ++ _ => -1, ++ } ++} ++ ++#[unsafe(no_mangle)] ++pub extern "C" fn eventfd_write(fd: c_int, value: eventfd_t) -> c_int { ++ let buf = value.to_ne_bytes(); ++ match Sys::write(fd, &buf) { ++ Ok(8) => 0, ++ _ => -1, ++ } ++} diff --git a/local/patches/relibc/P3-stddef-reorder.patch b/local/patches/relibc/P3-stddef-reorder.patch new file mode 100644 index 000000000..dd955eae9 --- /dev/null +++ b/local/patches/relibc/P3-stddef-reorder.patch @@ -0,0 +1,20 @@ +diff --git a/include/stddef.h b/include/stddef.h +index 334267f4..beefde5e 100644 +--- a/include/stddef.h ++++ b/include/stddef.h +@@ -1,6 +1,5 @@ + #ifndef _STDDEF_H + #define _STDDEF_H +-#include + + #define NULL 0 + +@@ -11,6 +10,8 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; + + typedef long unsigned int size_t; + ++#include ++ + typedef struct { long long __ll; long double __ld; } max_align_t; + + #define offsetof(type, member) __builtin_offsetof(type, member) diff --git a/local/recipes/kde/kf6-attica/source/CMakeLists.txt b/local/recipes/kde/kf6-attica/source/CMakeLists.txt index 7e2a01357..c54660b54 100644 --- a/local/recipes/kde/kf6-attica/source/CMakeLists.txt +++ b/local/recipes/kde/kf6-attica/source/CMakeLists.txt @@ -57,7 +57,7 @@ add_subdirectory(src) # Enable unit testing if (BUILD_TESTING) -########################## add_subdirectory(autotests) +############################ add_subdirectory(autotests) add_subdirectory(tests) endif () diff --git a/local/recipes/kde/kf6-kcmutils/source/CMakeLists.txt b/local/recipes/kde/kf6-kcmutils/source/CMakeLists.txt index 0f239b5e9..4a05fdf64 100644 --- a/local/recipes/kde/kf6-kcmutils/source/CMakeLists.txt +++ b/local/recipes/kde/kf6-kcmutils/source/CMakeLists.txt @@ -110,6 +110,8 @@ find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) +find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) +find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) # shall we use DBus? # enabled per default on Linux & BSD systems diff --git a/local/recipes/kde/kf6-kcolorscheme/source/CMakeLists.txt b/local/recipes/kde/kf6-kcolorscheme/source/CMakeLists.txt index aa9fc947c..b7f5637a4 100644 --- a/local/recipes/kde/kf6-kcolorscheme/source/CMakeLists.txt +++ b/local/recipes/kde/kf6-kcolorscheme/source/CMakeLists.txt @@ -88,6 +88,8 @@ find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) +find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) +find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 CACHE STRING "Control the range of deprecated API excluded from the build [default=0].") diff --git a/local/recipes/kde/kf6-kcompletion/source/CMakeLists.txt b/local/recipes/kde/kf6-kcompletion/source/CMakeLists.txt index f215526c0..2e682675e 100644 --- a/local/recipes/kde/kf6-kcompletion/source/CMakeLists.txt +++ b/local/recipes/kde/kf6-kcompletion/source/CMakeLists.txt @@ -79,6 +79,8 @@ find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) +find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) +find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) find_package(KF6Codecs ${KF_DEP_VERSION} REQUIRED) find_package(KF6Config ${KF_DEP_VERSION} REQUIRED) diff --git a/local/recipes/kde/kf6-kconfigwidgets/source/CMakeLists.txt b/local/recipes/kde/kf6-kconfigwidgets/source/CMakeLists.txt index 299b33311..7c30cf8f3 100644 --- a/local/recipes/kde/kf6-kconfigwidgets/source/CMakeLists.txt +++ b/local/recipes/kde/kf6-kconfigwidgets/source/CMakeLists.txt @@ -82,6 +82,8 @@ find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) +find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) +find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) # shall we use DBus? # enabled per default on Linux & BSD systems diff --git a/local/recipes/kde/kf6-kdeclarative/source/CMakeLists.txt b/local/recipes/kde/kf6-kdeclarative/source/CMakeLists.txt index 0dd295cea..b111038e0 100644 --- a/local/recipes/kde/kf6-kdeclarative/source/CMakeLists.txt +++ b/local/recipes/kde/kf6-kdeclarative/source/CMakeLists.txt @@ -32,7 +32,7 @@ find_package(KF6GuiAddons ${KF_DEP_VERSION} REQUIRED) if(NOT WIN32 AND NOT APPLE AND NOT ANDROID AND NOT REDOX) -################################################# find_package(KF6GlobalAccel ${KF_DEP_VERSION} REQUIRED) +################################################### find_package(KF6GlobalAccel ${KF_DEP_VERSION} REQUIRED) set(HAVE_KGLOBALACCEL TRUE) else() set(HAVE_KGLOBALACCEL FALSE) diff --git a/local/recipes/kde/kf6-kiconthemes/source/CMakeLists.txt b/local/recipes/kde/kf6-kiconthemes/source/CMakeLists.txt index 34329e424..b33ecbb7b 100644 --- a/local/recipes/kde/kf6-kiconthemes/source/CMakeLists.txt +++ b/local/recipes/kde/kf6-kiconthemes/source/CMakeLists.txt @@ -101,6 +101,8 @@ find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) +find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) +find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt6Svg ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE) # shall we use DBus? diff --git a/local/recipes/kde/kf6-kitemmodels/source/CMakeLists.txt b/local/recipes/kde/kf6-kitemmodels/source/CMakeLists.txt index 614a008c2..42b2bcfbe 100644 --- a/local/recipes/kde/kf6-kitemmodels/source/CMakeLists.txt +++ b/local/recipes/kde/kf6-kitemmodels/source/CMakeLists.txt @@ -38,7 +38,7 @@ set_package_properties(Qt6Qml PROPERTIES ) if (TARGET Qt6::Qml) -########################### include(ECMQmlModule) +############################## include(ECMQmlModule) endif() set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 CACHE STRING "Control the range of deprecated API excluded from the build [default=0].") diff --git a/local/recipes/kde/kf6-kitemmodels/source/src/CMakeLists.txt b/local/recipes/kde/kf6-kitemmodels/source/src/CMakeLists.txt index 43c09b513..4f2022f6c 100644 --- a/local/recipes/kde/kf6-kitemmodels/source/src/CMakeLists.txt +++ b/local/recipes/kde/kf6-kitemmodels/source/src/CMakeLists.txt @@ -1,6 +1,6 @@ add_subdirectory(core) if (TARGET Qt6::Qml) -########################## add_subdirectory(qml) +############################# add_subdirectory(qml) endif() ecm_qt_install_logging_categories( diff --git a/local/recipes/kde/kf6-kitemviews/source/CMakeLists.txt b/local/recipes/kde/kf6-kitemviews/source/CMakeLists.txt index 6e59e0f74..d3601b5ac 100644 --- a/local/recipes/kde/kf6-kitemviews/source/CMakeLists.txt +++ b/local/recipes/kde/kf6-kitemviews/source/CMakeLists.txt @@ -66,6 +66,8 @@ find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) +find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) +find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) set(EXCLUDE_DEPRECATED_BEFORE_AND_AT 0 CACHE STRING "Control the range of deprecated API excluded from the build [default=0].") diff --git a/local/recipes/kde/kf6-kjobwidgets/source/CMakeLists.txt b/local/recipes/kde/kf6-kjobwidgets/source/CMakeLists.txt index a67e16f30..ea37a952e 100644 --- a/local/recipes/kde/kf6-kjobwidgets/source/CMakeLists.txt +++ b/local/recipes/kde/kf6-kjobwidgets/source/CMakeLists.txt @@ -68,6 +68,8 @@ find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) +find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) +find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) if(NOT WIN32 AND NOT APPLE AND NOT ANDROID AND NOT HAIKU) option(WITH_X11 "Build with support for QX11Info::appUserTime()" ON) diff --git a/local/recipes/kde/kf6-ktextwidgets/source/CMakeLists.txt b/local/recipes/kde/kf6-ktextwidgets/source/CMakeLists.txt index 1bb0c4504..49937bd35 100644 --- a/local/recipes/kde/kf6-ktextwidgets/source/CMakeLists.txt +++ b/local/recipes/kde/kf6-ktextwidgets/source/CMakeLists.txt @@ -83,6 +83,8 @@ find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) +find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) +find_package(Qt6GuiPrivate ${REQUIRED_QT_VERSION} REQUIRED) if (WITH_TEXT_TO_SPEECH) find_package(Qt6 ${REQUIRED_QT_VERSION} CONFIG REQUIRED TextToSpeech) diff --git a/local/recipes/kde/kf6-kxmlgui/source/src/kswitchlanguagedialog_p.cpp b/local/recipes/kde/kf6-kxmlgui/source/src/kswitchlanguagedialog_p.cpp index 56903c481..018001523 100644 --- a/local/recipes/kde/kf6-kxmlgui/source/src/kswitchlanguagedialog_p.cpp +++ b/local/recipes/kde/kf6-kxmlgui/source/src/kswitchlanguagedialog_p.cpp @@ -74,10 +74,10 @@ void initializeLanguages() // Ideally setting the LANGUAGE would change the default QLocale too // but unfortunately this is too late since the QCoreApplication constructor // already created a QLocale at this stage so we need to set the reset it -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // by triggering the creation and destruction of a QSystemLocale +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // by triggering the creation and destruction of a QSystemLocale // this is highly dependent on Qt internals, so may break, but oh well -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// QSystemLocale *dummy = new QSystemLocale(); -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// delete dummy; +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// QSystemLocale *dummy = new QSystemLocale(); +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// delete dummy; } } diff --git a/local/recipes/kde/kf6-solid/source/CMakeLists.txt b/local/recipes/kde/kf6-solid/source/CMakeLists.txt index 783445e9d..93cdf2aab 100644 --- a/local/recipes/kde/kf6-solid/source/CMakeLists.txt +++ b/local/recipes/kde/kf6-solid/source/CMakeLists.txt @@ -78,7 +78,7 @@ set_package_properties(PList PROPERTIES if (CMAKE_SYSTEM_NAME MATCHES Linux) # Used by the UDisks backend on Linux - ##################################################################find_package(LibMount) + ####################################################################find_package(LibMount) set_package_properties(LibMount PROPERTIES TYPE REQUIRED) endif() diff --git a/local/recipes/qt/qtbase/recipe.toml b/local/recipes/qt/qtbase/recipe.toml index 35a1135af..a214c1c56 100644 --- a/local/recipes/qt/qtbase/recipe.toml +++ b/local/recipes/qt/qtbase/recipe.toml @@ -3,12 +3,8 @@ # Re-enable path: see local/docs/QT6-PORT-STATUS.md # Redox platform detection and syscall adaptations in redox.patch [source] -tar = "https://download.qt.io/official_releases/qt/6.11/6.11.0/submodules/qtbase-everywhere-src-6.11.0.tar.xz" -blake3 = "6e9a81b44a2f6a12ce36b77a990a1e18586afe2ab2b140113b4ec59c6ba5d3c6" -patches = [ - "redox.patch", - "P1-qplatformopengl-guard.patch", -] +tar = "https://download.qt.io/official_releases/qt/6.8/6.8.2/submodules/qtbase-everywhere-src-6.8.2.tar.xz" +patches = [] [build] template = "custom" @@ -126,34 +122,7 @@ GLES3_EOF fi done -mkdir -p "${COOKBOOK_SYSROOT}/include/netinet" -if [ ! -f "${COOKBOOK_SYSROOT}/include/netinet/in6_pktinfo_compat.h" ]; then - cat > "${COOKBOOK_SYSROOT}/include/netinet/in6_pktinfo_compat.h" <<'PKTINFO_EOF' -#ifndef REDBEAR_IN6_PKTINFO_COMPAT_H -#define REDBEAR_IN6_PKTINFO_COMPAT_H -#include -#ifndef IPV6_RECVPKTINFO -#define IPV6_RECVPKTINFO 46 -#endif -#ifndef IPV6_PKTINFO -#define IPV6_PKTINFO 50 -#endif -struct in6_pktinfo { - struct in6_addr ipi6_addr; - int ipi6_ifindex; -}; -#endif -PKTINFO_EOF -fi -python - <<'PY' -import os -from pathlib import Path -path = Path(os.environ["COOKBOOK_SOURCE"]) / "src/network/socket/qnativesocketengine_unix.cpp" -text = path.read_text() -if 'in6_pktinfo_compat' not in text: - text = '#include \\n' + text - path.write_text(text) -PY + # Step 1: Build Qt host tools (moc, rcc, uic) on the host # These are needed for cross-compilation — Qt6 generates code # with these tools during the target build. @@ -200,7 +169,7 @@ if [ ! -f "${HOST_BUILD}/libexec/moc" ] || [ ! -f "${HOST_STAMP}" ]; then -DFEATURE_gui=ON \ -DFEATURE_widgets=OFF \ -DFEATURE_opengl=OFF \ - -DFEATURE_network=ON \ + -DFEATURE_network=OFF \ -DFEATURE_dbus=ON \ -DFEATURE_openssl=OFF \ -DFEATURE_sql=OFF \ @@ -260,8 +229,9 @@ fi mkdir -p "${COOKBOOK_SOURCE}/src/corelib/QtCore/private" for hdr in qcore_unix_p.h qeventdispatcher_unix_p.h qtimerinfo_unix_p.h; do target="${COOKBOOK_SOURCE}/src/corelib/QtCore/private/${hdr}" - if [ ! -f "${target}" ] && [ -f "${COOKBOOK_SOURCE}/src/corelib/kernel/${hdr}" ]; then - sed 's|kernel/|../kernel/|' "${COOKBOOK_SOURCE}/src/corelib/private/${hdr}" > "${target}" + kernel_file="${COOKBOOK_SOURCE}/src/corelib/kernel/${hdr}" + if [ ! -f "${target}" ] && [ -f "${kernel_file}" ]; then + sed 's|kernel/|../kernel/|' "${kernel_file}" > "${target}" fi done @@ -417,9 +387,12 @@ if marker not in text: PY # QtGui needs the float16 shims — copy to gui dir and append to first SOURCES line -cp "${COOKBOOK_SOURCE}/src/corelib/global/qt_float16_shims.c" \ - "${COOKBOOK_SOURCE}/src/gui/painting/qt_float16_shims.c" -python - <<'PY' +if [ -f "${COOKBOOK_SOURCE}/src/corelib/global/qt_float16_shims.c" ]; then + cp "${COOKBOOK_SOURCE}/src/corelib/global/qt_float16_shims.c" \ + "${COOKBOOK_SOURCE}/src/gui/painting/qt_float16_shims.c" +fi +if [ -f "${COOKBOOK_SOURCE}/src/gui/painting/qt_float16_shims.c" ]; then + python - <<'PY' import os from pathlib import Path path = Path(os.environ["COOKBOOK_SOURCE"]) / "src/gui/CMakeLists.txt" @@ -435,6 +408,7 @@ for line in lines: inserted = True path.write_text("\\n".join(out) + "\\n") PY +fi # relibc's elf.h defines ELFMAG0-3 and SELFMAG but not ELFMAG string constant. # Patch qelfparser_p.cpp (the only file using ELFMAG) to define it. diff --git a/local/recipes/qt/qtbase/recipe.toml.bak b/local/recipes/qt/qtbase/recipe.toml.bak new file mode 100644 index 000000000..fc4d38132 --- /dev/null +++ b/local/recipes/qt/qtbase/recipe.toml.bak @@ -0,0 +1,746 @@ +#TODO: Qt6 base — qtbase compiled with Core+Concurrent+Xml+Gui+Widgets+DBus+OpenGL+EGL. Runtime validation pending. +# OpenGL/EGL enabled (software via Mesa/LLVMpipe; hardware acceleration requires kernel DMA-BUF). +# Re-enable path: see local/docs/QT6-PORT-STATUS.md +# Redox platform detection and syscall adaptations in redox.patch +[source] +tar = "https://download.qt.io/official_releases/qt/6.8/6.8.2/submodules/qtbase-everywhere-src-6.8.2.tar.xz" +patches = [ + "redox.patch", + "P1-qplatformopengl-guard.patch", +] + +[build] +template = "custom" +dependencies = [ + "glib", + "pcre2", + "zlib", + "libwayland", + "dbus", + "mesa", +] +script = """ +DYNAMIC_INIT + +PROJECT_ROOT="${COOKBOOK_ROOT}" +source "${COOKBOOK_ROOT}/local/scripts/lib/relibc-surface.sh" + +RELIBC_STAGE_INCLUDE_STAGE="${COOKBOOK_ROOT}/recipes/core/relibc/target/${TARGET}/stage/usr/include" +RELIBC_STAGE_INCLUDE_TMP="${COOKBOOK_ROOT}/recipes/core/relibc/target/${TARGET}/stage.tmp/usr/include" +RELIBC_STAGE_LIB_STAGE="${COOKBOOK_ROOT}/recipes/core/relibc/target/${TARGET}/stage/usr/lib" +RELIBC_STAGE_LIB_TMP="${COOKBOOK_ROOT}/recipes/core/relibc/target/${TARGET}/stage.tmp/usr/lib" +RELIBC_BUILD_LIB="${COOKBOOK_ROOT}/recipes/core/relibc/target/${TARGET}/build/target/${TARGET}/release" + +RELIBC_STAGE_INCLUDE="$(redbear_choose_relibc_stage_include)" +RELIBC_STAGE_LIB="$(redbear_choose_relibc_stage_lib)" +if [ -d "${RELIBC_STAGE_INCLUDE}" ]; then + redbear_copy_relibc_surface_into_sysroot "${COOKBOOK_SYSROOT}" + if [ -f "${COOKBOOK_SYSROOT}/include/elf.h" ]; then + sed -i 's/typedef uint64_t Elf64_Word;/typedef uint32_t Elf64_Word;/' "${COOKBOOK_SYSROOT}/include/elf.h" + sed -i 's/typedef int64_t Elf64_Sword;/typedef int32_t Elf64_Sword;/' "${COOKBOOK_SYSROOT}/include/elf.h" + fi + export CPPFLAGS="${CPPFLAGS:-} -I${RELIBC_STAGE_INCLUDE}" + export CFLAGS="${CFLAGS:-} -I${RELIBC_STAGE_INCLUDE}" + export CXXFLAGS="${CXXFLAGS:-} -I${RELIBC_STAGE_INCLUDE}" + + # The Redox GCC toolchain currently prefers its own bundled target elf.h + # under .../x86_64-unknown-redox/include/ over the recipe sysroot copy. + # Sync the freshly built relibc header into that toolchain include root so + # Qt's ELF plugin parser sees the corrected ELF64 typedef layout. + TOOLCHAIN_ROOT="$(redbear_choose_toolchain_root)" + TOOLCHAIN_TARGET_INCLUDE="${TOOLCHAIN_ROOT}/x86_64-unknown-redox/include" + TOOLCHAIN_TARGET_USR_INCLUDE="${TOOLCHAIN_ROOT}/x86_64-unknown-redox/usr/include" + for header in elf.h semaphore.h unistd.h; do + if [ -f "${RELIBC_STAGE_INCLUDE}/${header}" ] && [ -d "${TOOLCHAIN_TARGET_INCLUDE}" ]; then + cp -f "${RELIBC_STAGE_INCLUDE}/${header}" "${TOOLCHAIN_TARGET_INCLUDE}/${header}" + fi + if [ -f "${RELIBC_STAGE_INCLUDE}/${header}" ] && [ -d "${TOOLCHAIN_TARGET_USR_INCLUDE}" ]; then + cp -f "${RELIBC_STAGE_INCLUDE}/${header}" "${TOOLCHAIN_TARGET_USR_INCLUDE}/${header}" + fi + done + for header in arpa/inet.h net/if.h netdb.h netinet/in.h sys/ioctl.h sys/socket.h; do + if [ -f "${RELIBC_STAGE_INCLUDE}/${header}" ] && [ -d "${TOOLCHAIN_TARGET_INCLUDE}" ]; then + mkdir -p "${TOOLCHAIN_TARGET_INCLUDE}/$(dirname "${header}")" + cp -f "${RELIBC_STAGE_INCLUDE}/${header}" "${TOOLCHAIN_TARGET_INCLUDE}/${header}" + fi + if [ -f "${RELIBC_STAGE_INCLUDE}/${header}" ] && [ -d "${TOOLCHAIN_TARGET_USR_INCLUDE}" ]; then + mkdir -p "${TOOLCHAIN_TARGET_USR_INCLUDE}/$(dirname "${header}")" + cp -f "${RELIBC_STAGE_INCLUDE}/${header}" "${TOOLCHAIN_TARGET_USR_INCLUDE}/${header}" + fi + done + for header_path in "${TOOLCHAIN_TARGET_INCLUDE}/elf.h" "${TOOLCHAIN_TARGET_USR_INCLUDE}/elf.h"; do + if [ -f "$header_path" ]; then + sed -i 's/typedef uint64_t Elf64_Word;/typedef uint32_t Elf64_Word;/' "$header_path" + sed -i 's/typedef int64_t Elf64_Sword;/typedef int32_t Elf64_Sword;/' "$header_path" + fi + done +fi +if [ -d "${RELIBC_STAGE_LIB}" ]; then + export LDFLAGS="-L${RELIBC_STAGE_LIB} -Wl,-rpath-link,${RELIBC_STAGE_LIB} ${LDFLAGS}" +fi + + cat > strtold_cpp_compat.c <<'EOF' +long double strtold(const char *nptr, char **endptr); + +long double relibc_compat_cpp_strtold(const char *nptr, char **endptr) + __asm__("_Z7strtoldPKcPPc"); + +long double relibc_compat_cpp_strtold(const char *nptr, char **endptr) { + return strtold(nptr, endptr); +} + +#include +#include +#include +FILE *open_memstream(char **ptr, size_t *sizeloc) { + *ptr = calloc(1, 1); + *sizeloc = 0; + return tmpfile(); +} +EOF +"${GNU_TARGET}-gcc" \ + --sysroot="${COOKBOOK_SYSROOT}" \ + -shared -fPIC strtold_cpp_compat.c \ + -o "${COOKBOOK_SYSROOT}/lib/libredbear-qt-strtold-compat.so" +mkdir -p "${COOKBOOK_STAGE}/usr/lib" +cp -f "${COOKBOOK_SYSROOT}/lib/libredbear-qt-strtold-compat.so" "${COOKBOOK_STAGE}/usr/lib/" +export LDFLAGS="${LDFLAGS} -Wl,--no-as-needed -L${COOKBOOK_SYSROOT}/lib -lredbear-qt-strtold-compat -lffi -lc" + +export CFLAGS="${CFLAGS} -fcf-protection=none" +export CXXFLAGS="${CXXFLAGS} -fcf-protection=none" + +# Mesa's Redox sysroot currently exposes GLES2 headers but not the GLES3 wrapper headers +# that qtbase expects when building the ES-backed OpenGL path. Provide minimal forwarding +# wrappers in the per-recipe sysroot so clean rebuilds do not fail on missing gl3*.h. +mkdir -p "${COOKBOOK_SYSROOT}/include/GLES3" +for hdr in gl3.h gl31.h gl32.h; do + if [ ! -f "${COOKBOOK_SYSROOT}/include/GLES3/${hdr}" ]; then + cat > "${COOKBOOK_SYSROOT}/include/GLES3/${hdr}" <<'GLES3_EOF' +#ifndef REDBEAR_QT_GLES3_WRAPPER_H +#define REDBEAR_QT_GLES3_WRAPPER_H +#include +#include +#endif +GLES3_EOF + fi +done + +mkdir -p "${COOKBOOK_SYSROOT}/include/netinet" +if [ ! -f "${COOKBOOK_SYSROOT}/include/netinet/in6_pktinfo_compat.h" ]; then + cat > "${COOKBOOK_SYSROOT}/include/netinet/in6_pktinfo_compat.h" <<'PKTINFO_EOF' +#ifndef REDBEAR_IN6_PKTINFO_COMPAT_H +#define REDBEAR_IN6_PKTINFO_COMPAT_H +#include +#ifndef IPV6_RECVPKTINFO +#define IPV6_RECVPKTINFO 46 +#endif +#ifndef IPV6_PKTINFO +#define IPV6_PKTINFO 50 +#endif +struct in6_pktinfo { + struct in6_addr ipi6_addr; + int ipi6_ifindex; +}; +#endif +PKTINFO_EOF +fi +# Step 1: Build Qt host tools (moc, rcc, uic) on the host +# These are needed for cross-compilation — Qt6 generates code +# with these tools during the target build. +# ============================================================ +HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build" +HOST_QTBASE_BUILD="${COOKBOOK_ROOT}/build/qtbase-host-build" +HOST_PROFILE="qtbase-host-6.11.0-gui-xml-wayland-qdbus-host" +HOST_STAMP="${HOST_BUILD}/.redbear-host-profile" +HOST_PATH="/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl" +python - <<'PY' +import os +from pathlib import Path +path = Path(os.environ["COOKBOOK_SOURCE"]) / "src/tools/CMakeLists.txt" +text = path.read_text() +old = " # add_subdirectory(qdbuscpp2xml) # disabled for Redox Qt Wave 1\\n # add_subdirectory(qdbusxml2cpp) # disabled for Redox Qt Wave 1\\n" +new = " add_subdirectory(qdbuscpp2xml)\\n add_subdirectory(qdbusxml2cpp)\\n" +text = text.replace(old, new) +path.write_text(text) +PY +if [ -d "${HOST_BUILD}" ] && { [ ! -f "${HOST_STAMP}" ] || [ "$(cat "${HOST_STAMP}" 2>/dev/null)" != "${HOST_PROFILE}" ]; }; then + rm -rf "${HOST_BUILD}" + rm -rf "${HOST_QTBASE_BUILD}" +fi +if [ ! -f "${HOST_BUILD}/libexec/moc" ] || [ ! -f "${HOST_STAMP}" ]; then + echo "=== Building Qt host tools ===" + mkdir -p "${HOST_BUILD}" + rm -rf "${HOST_QTBASE_BUILD}" + env -i \ + HOME="${HOME}" \ + PATH="${HOST_PATH}" \ + cmake -S "${COOKBOOK_SOURCE}" -B "${HOST_QTBASE_BUILD}" \ + -GNinja \ + -DCMAKE_C_COMPILER=/usr/bin/cc \ + -DCMAKE_CXX_COMPILER=/usr/bin/c++ \ + -DCMAKE_ASM_COMPILER=/usr/bin/cc \ + -DCMAKE_AR=/usr/bin/ar \ + -DCMAKE_RANLIB=/usr/bin/ranlib \ + -DPKG_CONFIG_EXECUTABLE=/usr/bin/pkg-config \ + -DCMAKE_STRIP=/usr/bin/strip \ + -DCMAKE_BUILD_TYPE=Release \ + -DQT_BUILD_EXAMPLES=OFF \ + -DQT_BUILD_TESTS=OFF \ + -DFEATURE_glib=OFF \ + -DFEATURE_gui=ON \ + -DFEATURE_widgets=OFF \ + -DFEATURE_opengl=OFF \ + -DFEATURE_network=ON \ + -DFEATURE_dbus=ON \ + -DFEATURE_openssl=OFF \ + -DFEATURE_sql=OFF \ + -DFEATURE_testlib=OFF \ + -DFEATURE_xml=ON \ + -DFEATURE_wayland=ON \ + -DFEATURE_qtwaylandscanner=ON \ + -Wno-dev + ( + cd "${HOST_QTBASE_BUILD}" + env -i \ + HOME="${HOME}" \ + PATH="${HOST_PATH}" \ + cmake --build . -j"${COOKBOOK_MAKE_JOBS}" + ) + ( + cd "${HOST_QTBASE_BUILD}" + env -i \ + HOME="${HOME}" \ + PATH="${HOST_PATH}" \ + cmake --install . --prefix "${HOST_BUILD}" + ) + printf '%s\n' "${HOST_PROFILE}" > "${HOST_STAMP}" +fi + +# Inject Redox in6_pktinfo header include AFTER host build (host uses Linux headers, not Redox) + +python - <<'PY' +import os +from pathlib import Path +path = Path(os.environ["COOKBOOK_SOURCE"]) / "src/network/socket/qnativesocketengine_unix.cpp" +text = path.read_text() +if 'in6_pktinfo_compat' not in text: + text = '#include \\n' + text + path.write_text(text) +PY + +# ============================================================ +# Step 2: Cross-compile qtbase for Redox (Phase 1: QtCore) +# ============================================================ + +# Safety: clean stale CMake cache from previous attempts +rm -f CMakeCache.txt +rm -rf CMakeFiles +# Also clean any stale cache in source directory from previous builds +rm -f "${COOKBOOK_SOURCE}/CMakeCache.txt" +rm -rf "${COOKBOOK_SOURCE}/CMakeFiles" + +# Provide sys/statfs.h wrapper — relibc only has sys/statvfs.h. +# qstorageinfo_linux.cpp (compiled when LINUX=1 in CMake) includes sys/statfs.h. +# Alias statfs → statvfs so it compiles against relibc's POSIX API. +mkdir -p "${COOKBOOK_SYSROOT}/include/sys" +if [ ! -f "${COOKBOOK_SYSROOT}/include/sys/statfs.h" ]; then + cat > "${COOKBOOK_SYSROOT}/include/sys/statfs.h" << 'STATFS_EOF' +#ifndef _SYS_STATFS_H +#define _SYS_STATFS_H +/* Redox: relibc provides statvfs (POSIX), not Linux statfs. + Provide a compatibility shim so Linux-targeted code compiles. */ +#include +typedef struct statvfs statfs; +#define statfs statvfs +#define f_flags f_flag +#endif /* _SYS_STATFS_H */ +STATFS_EOF +fi + +# Ensure private forwarding headers exist for Unix-specific includes +# syncqt may not generate these for unknown platforms like Redox +mkdir -p "${COOKBOOK_SOURCE}/src/corelib/QtCore/private" +for hdr in qcore_unix_p.h qeventdispatcher_unix_p.h qtimerinfo_unix_p.h; do + target="${COOKBOOK_SOURCE}/src/corelib/QtCore/private/${hdr}" + kernel_file="${COOKBOOK_SOURCE}/src/corelib/kernel/${hdr}" + if [ ! -f "${target}" ] && [ -f "${kernel_file}" ]; then + sed 's|kernel/|../kernel/|' "${kernel_file}" > "${target}" + fi +done + +# Patch CMakeLists.txt: Redox uses POSIX statvfs, not Linux statfs. +# Exclude qstorageinfo_linux.cpp, include qstorageinfo_unix.cpp instead. +awk ' +/^qt_internal_extend_target\\(Core CONDITION LINUX AND NOT ANDROID AND NOT VXWORKS/ { + sub(/LINUX AND NOT ANDROID AND NOT VXWORKS/, "LINUX AND NOT REDOX AND NOT ANDROID AND NOT VXWORKS") +} +/qstorageinfo_linux\\.cpp/ { found_linux = 1 } +found_linux && /^)$/ { + print; print "" + print "# Redox: POSIX statvfs, not Linux statfs" + print "qt_internal_extend_target(Core CONDITION REDOX" + print " SOURCES" + print " io/qstandardpaths_unix.cpp" + print " io/qstorageinfo_unix.cpp" + print ")" + found_linux = 0; next +} +{ print } +' "${COOKBOOK_SOURCE}/src/corelib/CMakeLists.txt" > "${COOKBOOK_SOURCE}/src/corelib/CMakeLists.txt.tmp" +mv "${COOKBOOK_SOURCE}/src/corelib/CMakeLists.txt.tmp" "${COOKBOOK_SOURCE}/src/corelib/CMakeLists.txt" + +# Enable QtNetwork — relibc DNS resolver hardened (2026-04-29: use-after-free fix, FD leak fix, +# transaction ID validation, RCODE/TC handling, typed error mapping). +# QtNetwork was previously disabled. Now re-enabled for full KDE desktop path. +sed -i 's/^\\s*# add_subdirectory(network).*/ add_subdirectory(network)/' \ + "${COOKBOOK_SOURCE}/src/CMakeLists.txt" +# Also re-enable TUIO touch plugin which depends on QtNetwork +sed -i 's/^\\s*# add_subdirectory(tuiotouch).*/ add_subdirectory(tuiotouch)/' \ + "${COOKBOOK_SOURCE}/src/plugins/generic/CMakeLists.txt" +python - <<'PY' +import os +from pathlib import Path + +path = Path(os.environ["COOKBOOK_SOURCE"]) / "src/network/socket/qnet_unix_p.h" +text = path.read_text() +text = text.replace( + '''#include +''', + '''#include +#include +''', + 1, +) +old = '''#if defined(Q_OS_VXWORKS) +# include +#else +# include +#endif +''' +new = '''#if defined(Q_OS_VXWORKS) +# include +#elif !defined(Q_OS_REDOX) +# include +#endif +''' +text = text.replace(old, new) +path.write_text(text) +PY +python - <<'PY' +import os +from pathlib import Path + +path = Path(os.environ["COOKBOOK_SOURCE"]) / "src/network/socket/qnativesocketengine_unix.cpp" +text = path.read_text() +text = text.replace( + ''' case QNativeSocketEngine::ReceiveHopLimit: + if (socketProtocol == QAbstractSocket::IPv6Protocol || socketProtocol == QAbstractSocket::AnyIPProtocol) { + level = IPPROTO_IPV6; + n = IPV6_RECVHOPLIMIT; + } else if (socketProtocol == QAbstractSocket::IPv4Protocol) { +''', + ''' case QNativeSocketEngine::ReceiveHopLimit: + if (socketProtocol == QAbstractSocket::IPv6Protocol || socketProtocol == QAbstractSocket::AnyIPProtocol) { + level = IPPROTO_IPV6; +#ifdef IPV6_RECVHOPLIMIT + n = IPV6_RECVHOPLIMIT; +#endif + } else if (socketProtocol == QAbstractSocket::IPv4Protocol) { +''', + 1, +) +text = text.replace( + ''' if (cmsgptr->cmsg_len == CMSG_LEN(sizeof(int)) + && ((cmsgptr->cmsg_level == IPPROTO_IPV6 && cmsgptr->cmsg_type == IPV6_HOPLIMIT) + || (cmsgptr->cmsg_level == IPPROTO_IP && cmsgptr->cmsg_type == IP_TTL))) { +''', + ''' if (cmsgptr->cmsg_len == CMSG_LEN(sizeof(int)) +#ifdef IPV6_HOPLIMIT + && ((cmsgptr->cmsg_level == IPPROTO_IPV6 && cmsgptr->cmsg_type == IPV6_HOPLIMIT) + || (cmsgptr->cmsg_level == IPPROTO_IP && cmsgptr->cmsg_type == IP_TTL))) { +#else + && (cmsgptr->cmsg_level == IPPROTO_IP && cmsgptr->cmsg_type == IP_TTL)) { +#endif +''', + 1, +) +text = text.replace( + ''' if (header.hopLimit != -1) { + msg.msg_controllen += CMSG_SPACE(sizeof(int)); + cmsgptr->cmsg_len = CMSG_LEN(sizeof(int)); + cmsgptr->cmsg_level = IPPROTO_IPV6; + cmsgptr->cmsg_type = IPV6_HOPLIMIT; + memcpy(CMSG_DATA(cmsgptr), &header.hopLimit, sizeof(int)); + cmsgptr = reinterpret_cast(reinterpret_cast(cmsgptr) + CMSG_SPACE(sizeof(int))); + } +''', + '''#ifdef IPV6_HOPLIMIT + if (header.hopLimit != -1) { + msg.msg_controllen += CMSG_SPACE(sizeof(int)); + cmsgptr->cmsg_len = CMSG_LEN(sizeof(int)); + cmsgptr->cmsg_level = IPPROTO_IPV6; + cmsgptr->cmsg_type = IPV6_HOPLIMIT; + memcpy(CMSG_DATA(cmsgptr), &header.hopLimit, sizeof(int)); + cmsgptr = reinterpret_cast(reinterpret_cast(cmsgptr) + CMSG_SPACE(sizeof(int))); + } +#endif +''', + 1, +) +path.write_text(text) +PY +# Disable Wayland shm-emulation-server on Redox. +# Clean rebuilds still do not expose QSharedMemory::lock/unlock strongly enough for this path, +# so keep the bounded software compositor path honest until QtCore runtime support is proven. +HWI_CMAKE="${COOKBOOK_SOURCE}/src/plugins/platforms/wayland/plugins/hardwareintegration/CMakeLists.txt" +awk 'index($0, "if(QT_FEATURE_wayland_shm_emulation_server_buffer)") { + print "if(FALSE AND QT_FEATURE_wayland_shm_emulation_server_buffer) # disabled for Redox (QSharedMemory locking still not runtime-proven on clean rebuilds)"; + next + } { print }' "${HWI_CMAKE}" > "${HWI_CMAKE}.tmp" +mv "${HWI_CMAKE}.tmp" "${HWI_CMAKE}" + +# Redox relibc now exports sem_open/sem_close/sem_unlink, but the target toolchain's +# builtin semaphore.h can still hide those declarations during C++ feature probes. +# Inject a small Redox-only declaration shim both into the POSIX semaphore compile test +# and the Qt runtime backend source so configure can detect the path honestly. +python - <<'PY' +import os +from pathlib import Path + +root = Path(os.environ["COOKBOOK_SOURCE"]) + +backend = root / "src/corelib/ipc/qsystemsemaphore_posix.cpp" +text = backend.read_text() +marker = "#define REDOX_POSIX_SEM_RUNTIME_DECLS 1" +if marker not in text: + needle = '#include \\n' + shim = '#ifdef __redox__\\n#define REDOX_POSIX_SEM_RUNTIME_DECLS 1\\nextern "C" sem_t *sem_open(const char *name, int oflag, ...);\\nextern "C" int sem_close(sem_t *sem);\\nextern "C" int sem_unlink(const char *name);\\n#ifndef SEM_FAILED\\n#define SEM_FAILED ((sem_t *) -1)\\n#endif\\n#endif\\n' + text = text.replace(needle, needle + shim, 1) + backend.write_text(text) +PY + +# QtGui needs the float16 shims — copy to gui dir and append to first SOURCES line +if [ -f "${COOKBOOK_SOURCE}/src/corelib/global/qt_float16_shims.c" ]; then + cp "${COOKBOOK_SOURCE}/src/corelib/global/qt_float16_shims.c" \ + "${COOKBOOK_SOURCE}/src/gui/painting/qt_float16_shims.c" +fi +if [ -f "${COOKBOOK_SOURCE}/src/gui/painting/qt_float16_shims.c" ]; then + python - <<'PY' +import os +from pathlib import Path +path = Path(os.environ["COOKBOOK_SOURCE"]) / "src/gui/CMakeLists.txt" +lines = path.read_text().splitlines() +out = [] +inserted = False +for line in lines: + if line.strip() == "painting/qt_float16_shims.c": + continue + out.append(line) + if not inserted and line.strip() == "SOURCES": + out.append(" painting/qt_float16_shims.c") + inserted = True +path.write_text("\\n".join(out) + "\\n") +PY +fi + +# relibc's elf.h defines ELFMAG0-3 and SELFMAG but not ELFMAG string constant. +# Patch qelfparser_p.cpp (the only file using ELFMAG) to define it. +QELF="${COOKBOOK_SOURCE}/src/corelib/plugin/qelfparser_p.cpp" +if ! grep -q '#define ELFMAG' "${QELF}" 2>/dev/null; then + { printf '#ifndef ELFMAG\n'; printf '#define ELFMAG "\\177ELF"\n'; printf '#endif\n\n'; cat "${QELF}"; } > "${QELF}.tmp" + mv "${QELF}.tmp" "${QELF}" +fi + +# Patch Wayland client buffer integration: guard OpenGL-only virtual functions +# with QT_CONFIG(opengl). Without OpenGL, QPlatformOpenGLContext is not defined. +# This allows Wayland client to build with software rendering (shared memory). +BUFI="${COOKBOOK_SOURCE}/src/plugins/platforms/wayland/hardwareintegration/qwaylandclientbufferintegration_p.h" +awk ' +/createPlatformOpenGLContext.*QPlatformOpenGLContext/ && !done1 { + print "#if QT_CONFIG(opengl)"; print; print "#endif /* QT_CONFIG(opengl) */"; done1=1; next +} +/nativeResourceForContext.*QPlatformOpenGLContext/ && !done2 { + print "#if QT_CONFIG(opengl)"; print; print "#endif /* QT_CONFIG(opengl) */"; done2=1; next +} +{ print } +' "${BUFI}" > "${BUFI}.tmp" +mv "${BUFI}.tmp" "${BUFI}" + +# qtypes.h uses static_assert in C mode. relibc's assert.h does not currently expose the +# expected macro there, so inject both the include and a bounded fallback macro for C only. +QTYPES="${COOKBOOK_SOURCE}/src/corelib/global/qtypes.h" +if ! grep -q '#ifndef __cplusplus.*#include ' "${QTYPES}" 2>/dev/null; then + awk '/#ifndef __cplusplus/ { print; print "#include "; next } { print }' \ + "${QTYPES}" > "${QTYPES}.tmp" + mv "${QTYPES}.tmp" "${QTYPES}" +fi +if ! grep -q '#define static_assert _Static_assert' "${QTYPES}" 2>/dev/null; then + awk '/#include / { print; print "#ifndef static_assert"; print "#define static_assert _Static_assert"; print "#endif"; next } { print }' \ + "${QTYPES}" > "${QTYPES}.tmp" + mv "${QTYPES}.tmp" "${QTYPES}" +fi + +# For Redox diagnostics, turn Q_UNREACHABLE into a Qt assertion instead of a raw ud2 trap. +# This preserves a useful file/line failure path while we narrow remaining early-startup issues. +QASSERT_H="${COOKBOOK_SOURCE}/src/corelib/global/qassert.h" +if ! grep -q 'Q_OS_REDOX' "${QASSERT_H}" 2>/dev/null; then + python - </dev/null; then + awk 'index($0, "#if !defined(WEXITED) || !defined(WNOWAIT)") { + print; + print "#ifdef __redox__"; + print "#define REDOX_DISABLE_HAVE_WAITID 1"; + print "#undef HAVE_WAITID"; + print "#endif"; + next + } { print }' "${FORKFD_C}" > "${FORKFD_C}.tmp" + mv "${FORKFD_C}.tmp" "${FORKFD_C}" +fi +if ! grep -q 'REDOX_FORCE_WAITPID_FALLBACK' "${FORKFD_C}" 2>/dev/null; then + awk 'index($0, "#if defined(__APPLE__)") { + print "#ifdef __redox__"; + print "#define REDOX_FORCE_WAITPID_FALLBACK 1"; + print "#undef HAVE_WAITID"; + print "#endif"; + print; + next + } { print }' "${FORKFD_C}" > "${FORKFD_C}.tmp" + mv "${FORKFD_C}.tmp" "${FORKFD_C}" +fi +if ! grep -q 'REDOX_WAITID_IDTYPE_SHIMS' "${FORKFD_C}" 2>/dev/null; then + awk '/#include / { + print; + print "#ifdef __redox__"; + print "#define REDOX_WAITID_IDTYPE_SHIMS 1"; + print "#ifndef P_ALL"; + print "#define P_ALL 0"; + print "#endif"; + print "#ifndef P_PID"; + print "#define P_PID 1"; + print "#endif"; + print "#ifndef P_PGID"; + print "#define P_PGID 2"; + print "#endif"; + print "#endif"; + next + } { print }' "${FORKFD_C}" > "${FORKFD_C}.tmp" + mv "${FORKFD_C}.tmp" "${FORKFD_C}" +fi +# qprocess_unix.cpp needs sys/ioctl.h (for FIONREAD) but doesn't include it +QP="${COOKBOOK_SOURCE}/src/corelib/io/qprocess_unix.cpp" +if ! grep -q 'sys/ioctl.h' "${QP}" 2>/dev/null; then + awk '/#include / { print; print "#include "; next } { print }' \ + "${QP}" > "${QP}.tmp" + mv "${QP}.tmp" "${QP}" +fi +if ! grep -q 'REDOX_VFORK_SHIM' "${QP}" 2>/dev/null; then + awk '/#include / { + print; + print "#ifdef __redox__"; + print "#define REDOX_VFORK_SHIM 1"; + print "#ifndef vfork"; + print "#define vfork fork"; + print "#endif"; + print "#endif"; + next + } { print }' "${QP}" > "${QP}.tmp" + mv "${QP}.tmp" "${QP}" +fi + +# On Redox, keep Qt plugin metadata at the architectural baseline. +# The x86 plugin arch-requirement path produces feature-level warnings at runtime +# and can cause otherwise-present plugins to be rejected before load. +QPLUGIN_H="${COOKBOOK_SOURCE}/src/corelib/plugin/qplugin.h" +export QPLUGIN_H +python - <<'PY' +from pathlib import Path +import os + +path = Path(os.environ["QPLUGIN_H"]) +text = path.read_text() +needle = ''' static constexpr quint8 archRequirements() + { + quint8 v = 0; +''' +replacement = ''' static constexpr quint8 archRequirements() + { +#ifdef Q_OS_REDOX + return 0; +#else + quint8 v = 0; +''' +if needle in text and "#ifdef Q_OS_REDOX" not in text: + text = text.replace(needle, replacement, 1) + text = text.replace( + ''' return v; + } +''', + ''' return v; +#endif + } +''', + 1, + ) +path.write_text(text) +PY + +cmake "${COOKBOOK_SOURCE}" \ + -GNinja \ + -DCMAKE_TOOLCHAIN_FILE="${COOKBOOK_ROOT}/local/recipes/qt/redox-toolchain.cmake" \ + -DCMAKE_SHARED_LINKER_FLAGS="-lc -lffi -lredbear-qt-strtold-compat" \ + -DCMAKE_EXE_LINKER_FLAGS="-lc -lffi -lredbear-qt-strtold-compat" \ + -DCMAKE_C_STANDARD_LIBRARIES="-lffi -lredbear-qt-strtold-compat" \ + -DCMAKE_CXX_STANDARD_LIBRARIES="-lffi -lredbear-qt-strtold-compat" \ + -DQT_HOST_PATH="${HOST_BUILD}" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_PREFIX_PATH="${COOKBOOK_SYSROOT}" \ + -DQT_BUILD_TOOLS_BY_DEFAULT=OFF \ + -DQT_BUILD_EXAMPLES=OFF \ + -DQT_BUILD_TESTS=OFF \ + -DFEATURE_androiddeployqt=OFF \ + -DFEATURE_glib=OFF \ + -DFEATURE_gui=ON \ + -DFEATURE_widgets=ON \ + -DFEATURE_networkinterface=OFF \ + -DFEATURE_opengl=ON \ + -DINPUT_opengl=es2 \ + -DFEATURE_qmake=OFF \ + -DFEATURE_qtwaylandscanner=ON \ + -DFEATURE_egl=ON \ + -DFEATURE_openssl=OFF \ + -DFEATURE_dbus=ON \ + -DFEATURE_wayland=ON \ + -DWaylandScanner_EXECUTABLE=/usr/bin/wayland-scanner \ + -DFEATURE_wasmdeployqt=OFF \ + -DFEATURE_xcb=OFF \ + -DFEATURE_xlib=OFF \ + -DFEATURE_vulkan=OFF \ + -DFEATURE_process=ON \ + -DFEATURE_testlib=OFF \ + -DFEATURE_sql=OFF \ + -DFEATURE_printsupport=OFF \ + -DFEATURE_system_zlib=ON \ + -DFEATURE_system_pcre2=OFF \ + -DFEATURE_system_doubleconversion=OFF \ + -DFEATURE_system_harfbuzz=OFF \ + -DFEATURE_libjpeg=OFF \ + -DFEATURE_libpng=OFF \ + -Wno-dev + +cmake --build . -j${COOKBOOK_MAKE_JOBS} + +# Qt's top-level install script expects a hashed export path under CMakeFiles/Export, +# but on this Redox cross-build the generated file only exists at lib/cmake/Qt6/Qt6Targets.cmake. +# Materialize the expected export file before install so cmake --install can proceed normally. +python3 - <<'PY' +from pathlib import Path +import shutil + +install_script = Path("cmake_install.cmake") +generated = Path("lib/cmake/Qt6/Qt6Targets.cmake") + +if install_script.exists() and generated.exists(): + for line in install_script.read_text().splitlines(): + marker = 'CMakeFiles/Export/' + suffix = '/Qt6Targets.cmake' + if marker in line and suffix in line and 'FILES "' in line: + expected = Path(line.split('FILES "', 1)[1].rsplit('"', 1)[0]) + expected.parent.mkdir(parents=True, exist_ok=True) + if not expected.exists(): + shutil.copy2(generated, expected) + break +PY + +# cmake --install handles: libs, headers, cmake files, metatypes, mkspecs, plugins, pri files +# It generates relocatable cmake files (using relative paths) which downstream modules need. +cmake --install . --prefix "${COOKBOOK_STAGE}/usr" + +# Supplemental: ensure library symlinks (cmake install sometimes misses .so symlinks) +for lib in lib/libQt6*.so*; do + [ -f "${lib}" ] && cp -an "${lib}" "${COOKBOOK_STAGE}/usr/lib/" +done +for lib in lib/libQt6*.a; do + [ -f "${lib}" ] && cp -an "${lib}" "${COOKBOOK_STAGE}/usr/lib/" +done + +# Plugin path fix: cmake target files reference ${_IMPORT_PREFIX}/plugins/... +# but cmake --install puts plugins at ${prefix}/plugins/ = stage/usr/plugins/. +# The cookbook copies stage/usr/* to sysroot/, so: +# stage/usr/lib/ → sysroot/lib/ (cmake files: sysroot/lib/cmake/Qt6Gui/) +# stage/usr/plugins/ → sysroot/usr/plugins/ (actual files) +# _IMPORT_PREFIX resolves to sysroot/ (parent of lib/cmake/Qt6Gui/), so cmake +# looks for sysroot/plugins/... but files are at sysroot/usr/plugins/... +# Fix: also stage plugins without the usr/ prefix so cookbook puts them at sysroot/plugins/. +if [ -d "${COOKBOOK_STAGE}/usr/plugins" ]; then + mkdir -p "${COOKBOOK_STAGE}/plugins" + cp -a "${COOKBOOK_STAGE}/usr/plugins/"* "${COOKBOOK_STAGE}/plugins/" 2>/dev/null || true +fi + +# RPATH cleanup +for lib in "${COOKBOOK_STAGE}/usr/lib/libQt6"*.so.*; do + [ -f "${lib}" ] || continue + patchelf --remove-rpath "${lib}" 2>/dev/null || true +done +find "${COOKBOOK_STAGE}/usr/plugins" -name '*.so' -exec patchelf --set-rpath '$ORIGIN/../../lib' {} + 2>/dev/null || true + +# Propagate libc through Qt6::Core for downstream CMake consumers. QtCore now relies on relibc +# exports such as waitid() and sem_* on Redox, so imported targets must link libc explicitly. +python - <<'PY' +import os +from pathlib import Path + +targets = [ + Path(os.environ["COOKBOOK_STAGE"]) / "usr/lib/cmake/Qt6Core/Qt6CoreTargets.cmake", + Path(os.environ["COOKBOOK_SYSROOT"]) / "lib/cmake/Qt6Core/Qt6CoreTargets.cmake", +] +old = 'INTERFACE_LINK_LIBRARIES "Qt6::Platform;WrapAtomic::WrapAtomic"' +new = 'INTERFACE_LINK_LIBRARIES "Qt6::Platform;WrapAtomic::WrapAtomic;c"' + +for path in targets: + if not path.exists(): + continue + text = path.read_text() + if new in text: + continue + text = text.replace(old, new, 1) + path.write_text(text) +PY +""" diff --git a/local/recipes/qt/qtbase/redox.patch b/local/recipes/qt/qtbase/redox.patch index 4988847d1..08949d315 100644 --- a/local/recipes/qt/qtbase/redox.patch +++ b/local/recipes/qt/qtbase/redox.patch @@ -1,6 +1,5 @@ -diff -ruwN source-old/cmake/QtPlatformSupport.cmake source/cmake/QtPlatformSupport.cmake ---- source-old/cmake/QtPlatformSupport.cmake 2024-12-02 05:39:06.000000000 +0000 -+++ source/cmake/QtPlatformSupport.cmake 2026-04-13 00:00:00.000000000 +0000 +--- source-old/cmake/QtPlatformSupport.cmake ++++ source/cmake/QtPlatformSupport.cmake @@ -55,8 +55,20 @@ set(NETBSD 0) endif() @@ -22,9 +21,8 @@ diff -ruwN source-old/cmake/QtPlatformSupport.cmake source/cmake/QtPlatformSuppo else() set(WASM 0) endif() - diff -ruwN source-old/cmake/QtMkspecHelpers.cmake source/cmake/QtMkspecHelpers.cmake ---- source-old/cmake/QtMkspecHelpers.cmake 2024-12-02 05:39:06.000000000 +0000 -+++ source/cmake/QtMkspecHelpers.cmake 2026-04-13 00:00:00.000000000 +0000 +--- source-old/cmake/QtMkspecHelpers.cmake ++++ source/cmake/QtMkspecHelpers.cmake @@ -46,4 +46,8 @@ endif() + elseif(REDOX) @@ -34,9 +32,8 @@ diff -ruwN source-old/cmake/QtPlatformSupport.cmake source/cmake/QtPlatformSuppo elseif(LINUX) if(GCC) set(QT_DEFAULT_MKSPEC linux-g++) -diff -ruwN /dev/null source/mkspecs/redox-g++/qmake.conf ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ source/mkspecs/redox-g++/qmake.conf 2026-04-13 00:00:00.000000000 +0000 +--- /dev/null ++++ source/mkspecs/redox-g++/qmake.conf @@ -0,0 +1,14 @@ +# +# qmake configuration for redox-g++ @@ -52,9 +49,8 @@ diff -ruwN /dev/null source/mkspecs/redox-g++/qmake.conf +include(../common/g++-unix.conf) + +load(qt_config) -diff -ruwN /dev/null source/mkspecs/redox-g++/qplatformdefs.h ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ source/mkspecs/redox-g++/qplatformdefs.h 2026-04-13 00:00:00.000000000 +0000 +--- /dev/null ++++ source/mkspecs/redox-g++/qplatformdefs.h @@ -0,0 +1,27 @@ +// Copyright (C) 2026 Red Bear OS contributors +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only @@ -83,33 +79,29 @@ diff -ruwN /dev/null source/mkspecs/redox-g++/qplatformdefs.h +#define QT_VSNPRINTF ::vsnprintf + +#endif // QPLATFORMDEFS_H -diff -ruwN /dev/null source/src/corelib/private/qcore_unix_p.h ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ source/src/corelib/private/qcore_unix_p.h 2026-04-13 00:00:00.000000000 +0000 +--- /dev/null ++++ source/src/corelib/private/qcore_unix_p.h @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#include "../kernel/qcore_unix_p.h" + -diff -ruwN /dev/null source/src/corelib/private/qeventdispatcher_unix_p.h ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ source/src/corelib/private/qeventdispatcher_unix_p.h 2026-04-13 00:00:00.000000000 +0000 +--- /dev/null ++++ source/src/corelib/private/qeventdispatcher_unix_p.h @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#include "../kernel/qeventdispatcher_unix_p.h" + -diff -ruwN /dev/null source/src/corelib/private/qtimerinfo_unix_p.h ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ source/src/corelib/private/qtimerinfo_unix_p.h 2026-04-13 00:00:00.000000000 +0000 +--- /dev/null ++++ source/src/corelib/private/qtimerinfo_unix_p.h @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#include "../kernel/qtimerinfo_unix_p.h" + -diff -ruwN source-old/src/corelib/global/qsystemdetection.h source/src/corelib/global/qsystemdetection.h ---- source-old/src/corelib/global/qsystemdetection.h 2024-12-02 05:39:06.000000000 +0000 -+++ source/src/corelib/global/qsystemdetection.h 2026-04-13 00:00:00.000000000 +0000 +--- source-old/src/corelib/global/qsystemdetection.h ++++ source/src/corelib/global/qsystemdetection.h @@ -30,6 +30,7 @@ HURD - GNU Hurd QNX - QNX [has variants] @@ -127,9 +119,8 @@ diff -ruwN source-old/src/corelib/global/qsystemdetection.h source/src/corelib/g #elif defined(__MAKEDEPEND__) #else # error "Qt has not been ported to this OS - see http://www.qt-project.org/" -diff -ruwN source-old/src/corelib/kernel/qcore_unix_p.h source/src/corelib/kernel/qcore_unix_p.h ---- source-old/src/corelib/kernel/qcore_unix_p.h 2024-12-02 05:39:06.000000000 +0000 -+++ source/src/corelib/kernel/qcore_unix_p.h 2026-05-05 00:00:00.000000000 +0000 +--- source-old/src/corelib/kernel/qcore_unix_p.h ++++ source/src/corelib/kernel/qcore_unix_p.h @@ -245,7 +245,13 @@ { // everyone already has O_CLOEXEC @@ -144,9 +135,8 @@ diff -ruwN source-old/src/corelib/kernel/qcore_unix_p.h source/src/corelib/kerne return fd; } #endif -diff -ruwN source-old/src/gui/CMakeLists.txt source/src/gui/CMakeLists.txt ---- source-old/src/gui/CMakeLists.txt 2024-12-02 05:39:06.000000000 +0000 -+++ source/src/gui/CMakeLists.txt 2026-04-13 00:00:00.000000000 +0000 +--- source-old/src/gui/CMakeLists.txt ++++ source/src/gui/CMakeLists.txt @@ -20,6 +20,8 @@ set(_default_platform "eglfs") elseif(HAIKU) @@ -156,9 +146,8 @@ diff -ruwN source-old/src/gui/CMakeLists.txt source/src/gui/CMakeLists.txt elseif(WASM) set(_default_platform "wasm") else() -diff -ruwN source-old/src/plugins/platforms/CMakeLists.txt source/src/plugins/platforms/CMakeLists.txt ---- source-old/src/plugins/platforms/CMakeLists.txt 2024-12-02 05:39:06.000000000 +0000 -+++ source/src/plugins/platforms/CMakeLists.txt 2026-04-13 00:00:00.000000000 +0000 +--- source-old/src/plugins/platforms/CMakeLists.txt ++++ source/src/plugins/platforms/CMakeLists.txt @@ -22,6 +22,9 @@ if(QNX) add_subdirectory(qnx) @@ -169,9 +158,8 @@ diff -ruwN source-old/src/plugins/platforms/CMakeLists.txt source/src/plugins/pl if(QT_FEATURE_eglfs) add_subdirectory(eglfs) add_subdirectory(minimalegl) -diff -ruwN /dev/null source/src/plugins/platforms/redox/CMakeLists.txt ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ source/src/plugins/platforms/redox/CMakeLists.txt 2026-04-13 00:00:00.000000000 +0000 +--- /dev/null ++++ source/src/plugins/platforms/redox/CMakeLists.txt @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: BSD-3-Clause + @@ -187,9 +175,8 @@ diff -ruwN /dev/null source/src/plugins/platforms/redox/CMakeLists.txt + Qt::Gui + Qt::GuiPrivate +) -diff -ruwN /dev/null source/src/plugins/platforms/redox/main.cpp ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ source/src/plugins/platforms/redox/main.cpp 2026-04-13 00:00:00.000000000 +0000 +--- /dev/null ++++ source/src/plugins/platforms/redox/main.cpp @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + @@ -219,16 +206,14 @@ diff -ruwN /dev/null source/src/plugins/platforms/redox/main.cpp +QT_END_NAMESPACE + +#include "main.moc" -diff -ruwN /dev/null source/src/plugins/platforms/redox/redox.json ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ source/src/plugins/platforms/redox/redox.json 2026-04-13 00:00:00.000000000 +0000 +--- /dev/null ++++ source/src/plugins/platforms/redox/redox.json @@ -0,0 +1,3 @@ +{ + "Keys": [ "redox" ] +} -diff -ruwN source-old/src/3rdparty/sha3/brg_endian.h source/src/3rdparty/sha3/brg_endian.h ---- source-old/src/3rdparty/sha3/brg_endian.h 2024-12-02 05:39:06.000000000 +0000 -+++ source/src/3rdparty/sha3/brg_endian.h 2026-04-13 00:00:00.000000000 +0000 +--- source-old/src/3rdparty/sha3/brg_endian.h ++++ source/src/3rdparty/sha3/brg_endian.h @@ -45,6 +45,8 @@ # if !defined( __MINGW32__ ) && !defined( _AIX ) && !defined(Q_OS_QNX) # include @@ -239,9 +224,8 @@ diff -ruwN source-old/src/3rdparty/sha3/brg_endian.h source/src/3rdparty/sha3/br # include # endif # endif -diff -ruwN source-old/src/corelib/io/qstorageinfo_unix.cpp source/src/corelib/io/qstorageinfo_unix.cpp ---- source-old/src/corelib/io/qstorageinfo_unix.cpp 2024-12-02 05:39:06.000000000 +0000 -+++ source/src/corelib/io/qstorageinfo_unix.cpp 2026-05-05 00:00:00.000000000 +0000 +--- source-old/src/corelib/io/qstorageinfo_unix.cpp ++++ source/src/corelib/io/qstorageinfo_unix.cpp @@ -51,6 +51,12 @@ # if !defined(_STATFS_F_FLAGS) && !defined(Q_OS_NETBSD) # define _STATFS_F_FLAGS 1 @@ -256,9 +240,8 @@ diff -ruwN source-old/src/corelib/io/qstorageinfo_unix.cpp source/src/corelib/io # define QT_STATFSBUF struct statvfs # define QT_STATFS ::statvfs -diff -ruwN source-old/configure.cmake source/configure.cmake ---- source-old/configure.cmake 2024-12-02 05:39:06.000000000 +0000 -+++ source/configure.cmake 2026-04-15 00:00:00.000000000 +0000 +--- source-old/configure.cmake ++++ source/configure.cmake @@ -1233,7 +1233,7 @@ qt_feature("intelcet" PRIVATE LABEL "Using Intel Control-flow Enforcement Technology (CET)" @@ -268,9 +251,8 @@ diff -ruwN source-old/configure.cmake source/configure.cmake ) qt_feature_config("intelcet" QMAKE_PUBLIC_CONFIG) qt_feature("glibc_fortify_source" PRIVATE -diff -ruwN source-old/cmake/QtBaseConfigureTests.cmake source/cmake/QtBaseConfigureTests.cmake ---- source-old/cmake/QtBaseConfigureTests.cmake 2024-12-02 05:39:06.000000000 +0000 -+++ source/cmake/QtBaseConfigureTests.cmake 2026-05-05 00:00:00.000000000 +0000 +--- source-old/cmake/QtBaseConfigureTests.cmake ++++ source/cmake/QtBaseConfigureTests.cmake @@ -265,6 +265,25 @@ set(TEST_subarch_sse4_1 FALSE CACHE BOOL INTERNAL FORCE) set(TEST_subarch_sse4_2 FALSE CACHE BOOL INTERNAL FORCE) @@ -298,9 +280,8 @@ diff -ruwN source-old/cmake/QtBaseConfigureTests.cmake source/cmake/QtBaseConfig function(qt_internal_print_cmake_darwin_info) -diff -ruwN source-old/src/corelib/plugin/qelfparser_p.cpp source/src/corelib/plugin/qelfparser_p.cpp ---- source-old/src/corelib/plugin/qelfparser_p.cpp 2024-12-02 05:39:06.000000000 +0000 -+++ source/src/corelib/plugin/qelfparser_p.cpp 2026-04-15 00:00:00.000000000 +0000 +--- source-old/src/corelib/plugin/qelfparser_p.cpp ++++ source/src/corelib/plugin/qelfparser_p.cpp @@ -177,5 +177,8 @@ static bool checkElfVersion(const uchar *ident) { @@ -319,9 +300,8 @@ diff -ruwN source-old/src/corelib/plugin/qelfparser_p.cpp source/src/corelib/plu return header.e_version == EV_CURRENT; } -diff -ruwN source-old/src/corelib/global/qsimd.cpp source/src/corelib/global/qsimd.cpp ---- source-old/src/corelib/global/qsimd.cpp 2024-12-02 05:39:06.000000000 +0000 -+++ source/src/corelib/global/qsimd.cpp 2026-05-05 00:00:00.000000000 +0000 +--- source-old/src/corelib/global/qsimd.cpp ++++ source/src/corelib/global/qsimd.cpp @@ -377,7 +377,11 @@ #endif static void xgetbv(uint in, uint &eax, uint &edx) @@ -336,9 +316,8 @@ diff -ruwN source-old/src/corelib/global/qsimd.cpp source/src/corelib/global/qsi : "=a" (eax), "=d" (edx) : "c" (in)); -diff -ruwN /dev/null source/src/corelib/global/qt_float16_shims.c ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ source/src/corelib/global/qt_float16_shims.c 2026-04-13 00:00:00.000000000 +0000 +--- /dev/null ++++ source/src/corelib/global/qt_float16_shims.c @@ -0,0 +1,167 @@ +/* + * IEEE 754 half-precision soft-float conversion shims for Redox OS @@ -507,9 +486,8 @@ diff -ruwN /dev/null source/src/corelib/global/qt_float16_shims.c + float fb = __extendhfsf2(b); + return fa != fa || fb != fb; +} -diff -ruwN source-old/src/corelib/CMakeLists.txt source/src/corelib/CMakeLists.txt ---- source-old/src/corelib/CMakeLists.txt 2024-12-02 05:39:06.000000000 +0000 -+++ source/src/corelib/CMakeLists.txt 2026-04-13 00:00:00.000000000 +0000 +--- source-old/src/corelib/CMakeLists.txt ++++ source/src/corelib/CMakeLists.txt @@ -61,5 +61,6 @@ global/qfloat16.cpp global/qfloat16.h + global/qt_float16_shims.c @@ -517,46 +495,28 @@ diff -ruwN source-old/src/corelib/CMakeLists.txt source/src/corelib/CMakeLists.t global/qfunctionpointer.h global/qgettid_p.h global/qglobal.cpp global/qglobal.h global/qglobal_p.h -diff -ruwN source-old/src/plugins/platforms/wayland/qwaylanddisplay.cpp source/src/plugins/platforms/wayland/qwaylanddisplay.cpp ---- source-old/src/plugins/platforms/wayland/qwaylanddisplay.cpp 2025-05-27 09:11:00.000000000 +0000 -+++ source/src/plugins/platforms/wayland/qwaylanddisplay.cpp 2026-05-06 00:00:00.000000000 +0000 -@@ -526,16 +526,29 @@ - void QWaylandDisplay::flushRequests() - { -+#ifdef Q_OS_REDOX -+ if (!m_eventThread) { -+ wl_display_dispatch_pending(mDisplay); -+ wl_display_flush(mDisplay); -+ return; -+ } -+#endif - m_eventThread->readAndDispatchEvents(); - } + +--- source-old/src/plugins/platforms/wayland/hardwareintegration/qwaylandclientbufferintegration_p.h ++++ source/src/plugins/platforms/wayland/hardwareintegration/qwaylandclientbufferintegration_p.h +@@ -52,10 +52,14 @@ + virtual bool supportsWindowDecoration() const { return false; } - // We have to wait until we have an eventDispatcher before creating the eventThread, - // otherwise forceRoundTrip() may block inside _events_read() because eventThread is - // polling. - void QWaylandDisplay::initEventThread() - { -+#ifdef Q_OS_REDOX -+ if (!m_frameEventQueue) -+ m_frameEventQueue = wl_display_create_queue(mDisplay); -+ return; + virtual QWaylandWindow *createEglWindow(QWindow *window) = 0; ++#if QT_CONFIG(opengl) + virtual QPlatformOpenGLContext *createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const = 0; +#endif - m_eventThread.reset( - new EventThread(mDisplay, /* default queue */ nullptr, EventThread::EmitToDispatch)); - connect(m_eventThread.get(), &EventThread::needReadAndDispatch, this, -+diff -ruwN source-old/src/plugins/platforms/wayland/qwaylanddisplay.cpp source/src/plugins/platforms/wayland/qwaylanddisplay.cpp -+--- source-old/src/plugins/platforms/wayland/qwaylanddisplay.cpp 2025-05-27 09:11:00.000000000 +0000 -++++ source/src/plugins/platforms/wayland/qwaylanddisplay.cpp 2026-05-06 00:00:00.000000000 +0000 -+@@ -338,7 +338,12 @@ -+ void QWaylandDisplay::setupConnection() -+ { -+ struct ::wl_registry *registry = wl_display_get_registry(mDisplay); -++ if (!registry) { -++ qCritical("QWaylandDisplay: wl_display_get_registry() returned NULL"); -++ _exit(1); -++ } -+ init(registry); -+ -+ #if QT_CONFIG(xkbcommon) + virtual bool canCreatePlatformOffscreenSurface() const { return false; } ++#if QT_CONFIG(opengl) + virtual QOpenGLContext *createOpenGLContext(EGLContext context, EGLDisplay contextDisplay, QOpenGLContext *shareContext) const = 0; + virtual QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const { Q_UNUSED(surface); return nullptr; } ++#endif + + enum NativeResource { + EglDisplay, +@@ -65,7 +69,9 @@ + }; + virtual void *nativeResource(NativeResource /*resource*/) { return nullptr; } ++#if QT_CONFIG(opengl) + virtual void *nativeResourceForContext(NativeResource /*resource*/, QPlatformOpenGLContext */*context*/) { return nullptr; } ++#endif + }; diff --git a/local/recipes/qt/qtdeclarative/recipe.toml b/local/recipes/qt/qtdeclarative/recipe.toml index 9ea39909c..19775e2af 100644 --- a/local/recipes/qt/qtdeclarative/recipe.toml +++ b/local/recipes/qt/qtdeclarative/recipe.toml @@ -115,6 +115,8 @@ if [ ! -f "${HOST_BUILD}/bin/qmlcachegen" ] || [ ! -f "${HOST_BUILD}/bin/qmlaots elif [ -f "${DECL_HOST}/libexec/${tool}" ]; then cp -a "${DECL_HOST}/libexec/${tool}" "${HOST_BUILD}/libexec/" cp -a "${DECL_HOST}/libexec/${tool}" "${HOST_BUILD}/bin/${tool}" + elif [ -f "${DECL_HOST}/tools/${tool}" ]; then + cp -a "${DECL_HOST}/tools/${tool}" "${HOST_BUILD}/bin/" fi done cp -a "${DECL_HOST}/lib/cmake/Qt6QmlTools" "${HOST_BUILD}/lib/cmake/" 2>/dev/null || true diff --git a/local/recipes/system/redbear-greeter/recipe.toml b/local/recipes/system/redbear-greeter/recipe.toml index cc8a572bc..6b6f2fbcb 100644 --- a/local/recipes/system/redbear-greeter/recipe.toml +++ b/local/recipes/system/redbear-greeter/recipe.toml @@ -29,6 +29,7 @@ cmake "${COOKBOOK_SOURCE}/ui" \ -DCMAKE_PREFIX_PATH="${COOKBOOK_SYSROOT}" \ -DCMAKE_CXX_STANDARD_LIBRARIES="-lc -lffi -lredbear-qt-strtold-compat" \ -DQT_NO_PRIVATE_MODULE_WARNING=ON \ + -DQT_HOST_PATH="${COOKBOOK_ROOT}/build/qt-host-build" \ -Wno-dev cmake --build . -j${COOKBOOK_MAKE_JOBS} diff --git a/local/recipes/wayland/libwayland/recipe.toml.bak b/local/recipes/wayland/libwayland/recipe.toml.bak new file mode 100644 index 000000000..9213fdef1 --- /dev/null +++ b/local/recipes/wayland/libwayland/recipe.toml.bak @@ -0,0 +1,22 @@ +#TODO: Requires Redox compatibility patching for missing Linux header paths and +# some POSIX/Linux-only flags during cross-builds. +# redox.patch restores the Redox compatibility stubs plus Meson scanner detection. +[source] +tar = "https://gitlab.freedesktop.org/wayland/wayland/-/releases/1.24.0/downloads/wayland-1.24.0.tar.xz" +patches = ["redox.patch"] + +[build] +template = "custom" +dependencies = [ + "relibc", + "libffi", + "expat", + "libxml2", +] +script = """ +DYNAMIC_INIT +cookbook_meson -Ddocumentation=false -Dtests=false -Ddtd_validation=false -Dc_args=-Wno-error +""" + +[package] +dependencies = ["libffi"] diff --git a/local/recipes/wayland/libwayland/source/meson.build b/local/recipes/wayland/libwayland/source/meson.build index 3cf000ab0..ef34ba4a5 100644 --- a/local/recipes/wayland/libwayland/source/meson.build +++ b/local/recipes/wayland/libwayland/source/meson.build @@ -80,8 +80,8 @@ if get_option('libraries') ffi_dep = dependency('libffi') decls = [ - { 'header': 'signal.h', 'symbol': 'SIG_BLOCK' }, - { 'header': 'time.h', 'symbol': 'CLOCK_MONOTONIC' }, + { 'header': 'sys/signalfd.h', 'symbol': 'SFD_CLOEXEC' }, + { 'header': 'sys/timerfd.h', 'symbol': 'TFD_CLOEXEC' }, { 'header': 'time.h', 'symbol': 'CLOCK_MONOTONIC' }, ] diff --git a/local/recipes/wayland/libwayland/source/src/connection.c b/local/recipes/wayland/libwayland/source/src/connection.c index 4b047e2c4..a2011eab9 100644 --- a/local/recipes/wayland/libwayland/source/src/connection.c +++ b/local/recipes/wayland/libwayland/source/src/connection.c @@ -37,17 +37,11 @@ #include #include #include -#include -#include - #ifndef MSG_NOSIGNAL #define MSG_NOSIGNAL 0 #endif -#include -#include -static FILE *open_memstream(char **bufp, size_t *sizep) { - *bufp = NULL; *sizep = 0; return NULL; -} +#include +#include #include "wayland-util.h" #include "wayland-private.h" diff --git a/local/recipes/wayland/libwayland/source/src/event-loop.c b/local/recipes/wayland/libwayland/source/src/event-loop.c index bbb3ee71b..89294fd97 100644 --- a/local/recipes/wayland/libwayland/source/src/event-loop.c +++ b/local/recipes/wayland/libwayland/source/src/event-loop.c @@ -35,56 +35,9 @@ #include #include #include -/* #include */ -/* #include */ +#include +#include #include - -#ifndef SFD_CLOEXEC -#define SFD_CLOEXEC O_CLOEXEC -#endif -#ifndef SFD_NONBLOCK -#define SFD_NONBLOCK O_NONBLOCK -#endif -#ifndef TFD_CLOEXEC -#define TFD_CLOEXEC O_CLOEXEC -#endif -#ifndef TFD_NONBLOCK -#define TFD_NONBLOCK O_NONBLOCK -#endif -#ifndef TFD_TIMER_ABSTIME -#define TFD_TIMER_ABSTIME 0x1 -#endif - -struct signalfd_siginfo { uint8_t pad[128]; }; -static int signalfd_impl(int fd, const sigset_t *mask, uintptr_t masksize, int flags) { - int oflag = O_RDWR; - if (flags & SFD_CLOEXEC) oflag |= O_CLOEXEC; - if (flags & SFD_NONBLOCK) oflag |= O_NONBLOCK; - if (fd == -1) { fd = open("/scheme/event", oflag); if (fd < 0) return -1; } - else { if (flags & SFD_CLOEXEC) fcntl(fd, F_SETFD, FD_CLOEXEC); } - sigprocmask(SIG_BLOCK, mask, NULL); - return fd; -} -int signalfd(int fd, const sigset_t *mask, uintptr_t masksize) { return signalfd_impl(fd, mask, masksize, 0); } -static int timerfd_create(int clockid, int flags) { - int oflag = O_RDWR; - if (flags & TFD_CLOEXEC) oflag |= O_CLOEXEC; - if (flags & TFD_NONBLOCK) oflag |= O_NONBLOCK; - char path[64]; - snprintf(path, sizeof(path), "/scheme/time/%d", clockid); - return open(path, oflag); -} -int timerfd_settime(int fd, int flags, const struct itimerspec *new_value, struct itimerspec *old_value) { - if (new_value == NULL) { errno = EFAULT; return -1; } - ssize_t r = write(fd, &new_value->it_value, sizeof(struct timespec)); - return (r == sizeof(struct timespec)) ? 0 : -1; -} -int timerfd_gettime(int fd, struct itimerspec *curr) { - if (curr == NULL) { errno = EFAULT; return -1; } - curr->it_interval = (struct timespec){0}; - ssize_t r = read(fd, &curr->it_value, sizeof(struct timespec)); - return (r == sizeof(struct timespec)) ? 0 : -1; -} #include "timespec-util.h" #include "wayland-util.h" #include "wayland-private.h" diff --git a/local/recipes/wayland/libwayland/source/src/meson.build b/local/recipes/wayland/libwayland/source/src/meson.build index df45f66d7..7dc37d26b 100644 --- a/local/recipes/wayland/libwayland/source/src/meson.build +++ b/local/recipes/wayland/libwayland/source/src/meson.build @@ -81,7 +81,7 @@ if get_option('scanner') endif if meson.is_cross_build() or not get_option('scanner') -wayland_scanner_for_build = find_program('wayland-scanner', native: true) + wayland_scanner_for_build = find_program('wayland-scanner', native: true) else wayland_scanner_for_build = wayland_scanner endif diff --git a/local/recipes/wayland/libwayland/source/src/wayland-client.c b/local/recipes/wayland/libwayland/source/src/wayland-client.c index d65206f64..bc6fa471a 100644 --- a/local/recipes/wayland/libwayland/source/src/wayland-client.c +++ b/local/recipes/wayland/libwayland/source/src/wayland-client.c @@ -650,8 +650,7 @@ wl_proxy_add_listener(struct wl_proxy *proxy, void (**implementation)(void), void *data) { if (!proxy) { - fprintf(stderr, "FATAL: wl_proxy_add_listener(NULL) caller=%p -- returning error -", + fprintf(stderr, "FATAL: wl_proxy_add_listener(NULL) caller=%p -- returning error\n", __builtin_return_address(0)); return -1; } diff --git a/local/recipes/wayland/libwayland/source/src/wayland-server.c b/local/recipes/wayland/libwayland/source/src/wayland-server.c index e3a60adc7..72a120186 100644 --- a/local/recipes/wayland/libwayland/source/src/wayland-server.c +++ b/local/recipes/wayland/libwayland/source/src/wayland-server.c @@ -39,24 +39,7 @@ #include #include #include -/* #include */ -#ifndef EFD_CLOEXEC -#define EFD_CLOEXEC O_CLOEXEC -#endif -#ifndef EFD_NONBLOCK -#define EFD_NONBLOCK O_NONBLOCK -#endif -#ifndef EFD_SEMAPHORE -#define EFD_SEMAPHORE 0x1 -#endif -static int eventfd(unsigned int initval, int flags) { - int oflag = O_RDWR; - if (flags & EFD_CLOEXEC) oflag |= O_CLOEXEC; - if (flags & EFD_NONBLOCK) oflag |= O_NONBLOCK; - char path[64]; - snprintf(path, sizeof(path), "/scheme/event/eventfd/%u/%d", initval, (flags & EFD_SEMAPHORE) ? 1 : 0); - return open(path, oflag); -} +#include #include #include diff --git a/recipes/core/relibc/recipe.toml b/recipes/core/relibc/recipe.toml index 91fab7178..e6844ac97 100644 --- a/recipes/core/relibc/recipe.toml +++ b/recipes/core/relibc/recipe.toml @@ -11,6 +11,8 @@ patches = [ "P3-eventfd-impl.patch", # cbindgen.toml for sys/eventfd.h C header generation "P3-eventfd-cbindgen.patch", + # eventfd_read() and eventfd_write() helpers + "P3-eventfd-readwrite.patch", # sys_signalfd module (cbindgen.toml + mod.rs with cbindgen exports) "P3-signalfd-header.patch", # signalfd implementation (signal/signalfd.rs + signal/mod.rs wiring) @@ -52,6 +54,10 @@ patches = [ "P3-timespec-reverse-from.patch", "P10-stack-size-8mb.patch", "P11-getrlimit-getrusage.patch", + # Move #include after size_t/ptrdiff_t typedefs in stddef.h + # to prevent recursive include chain (stdint.h → sys/types.h → pthread.h) + # from seeing undefined size_t when gnulib wrappers are present + "P3-stddef-reorder.patch", ] [build] diff --git a/recipes/tools/diffutils/recipe.toml b/recipes/tools/diffutils/recipe.toml index becb4a919..fb85db942 100644 --- a/recipes/tools/diffutils/recipe.toml +++ b/recipes/tools/diffutils/recipe.toml @@ -8,6 +8,7 @@ autoreconf [build] template = "custom" +dependencies = ["relibc"] script = """ DYNAMIC_INIT COOKBOOK_CONFIGURE_FLAGS+=( @@ -16,6 +17,8 @@ COOKBOOK_CONFIGURE_FLAGS+=( gt_cv_locale_ja=false gt_cv_locale_tr_utf8=false gt_cv_locale_zh_CN=false + gl_cv_func_working_mktime=yes + ac_cv_func_getprogname=yes ) cookbook_configure rm -f "${COOKBOOK_STAGE}/usr/share/info/dir"