Advance Wayland and KDE package bring-up

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-04-14 10:51:06 +01:00
parent 51f3c21121
commit cf12defd28
15214 changed files with 20594243 additions and 269 deletions
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kdecoration
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kf6-extra-cmake-modules
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kf6-karchive
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kf6-kauth
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kf6-kbookmarks
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kf6-kcmutils
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kf6-kcodecs
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kf6-kcolorscheme
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kf6-kcompletion
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kf6-kconfig
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kf6-kconfigwidgets
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kf6-kcoreaddons
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kf6-kcrash
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kf6-kdbusaddons
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kf6-kdeclarative
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kf6-kglobalaccel
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kf6-kguiaddons
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kf6-ki18n
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kf6-kiconthemes
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kf6-kidletime
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kf6-kio
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kf6-kitemmodels
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kf6-kitemviews
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kf6-kjobwidgets
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kf6-knotifications
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kf6-kpackage
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kf6-kservice
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kf6-ktextwidgets
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kf6-kwayland
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kf6-kwidgetsaddons
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kf6-kwindowsystem
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kf6-kxmlgui
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kf6-solid
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kf6-sonnet
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kirigami
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/kwin
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/plasma-framework
+1
View File
@@ -0,0 +1 @@
../../local/recipes/kde/plasma-wayland-protocols
+1
View File
@@ -0,0 +1 @@
../../local/recipes/libs/lcms2-stub
+1
View File
@@ -0,0 +1 @@
../../local/recipes/libs/libdisplay-info-stub
+1
View File
@@ -0,0 +1 @@
../../local/recipes/libs/libepoxy-stub
+1
View File
@@ -0,0 +1 @@
../../local/recipes/libs/libudev-stub
+1
View File
@@ -0,0 +1 @@
../../local/recipes/libs/libxcvt-stub
+4 -1
View File
@@ -32,12 +32,15 @@ fi
cookbook_meson \
-Ddri-drivers-path=/usr/lib/dri \
-Degl=enabled \
-Dgbm=enabled \
-Dglx=disabled \
-Dgallium-drivers=swrast \
-Dllvm=enabled \
-Dosmesa=true \
-Dplatforms=redox \
-Dshader-cache=disabled \
-Dvulkan-drivers=swrast
-Dvulkan-drivers=swrast \
-Dshared-glapi=enabled
# Hack to add LLVM libs, the list can be seen from meson log and check for matches $("${LLVM_CONFIG}" --libs)
LLVMLIBS="-lLLVMBitReader -lLLVMCore -lLLVMExecutionEngine -lLLVMInstCombine -lLLVMMCDisassembler"
+6 -7
View File
@@ -39,27 +39,26 @@ recipes/wip/
| Task | Location |
|------|----------|
| Fix Wayland build | `wayland/libwayland/redox.patch` — stubs 7 POSIX APIs |
| Fix Wayland build | `wayland/libwayland/redox.patch` — still carries POSIX compatibility workarounds |
| Add Wayland compositor | `wayland/<name>/recipe.toml` — use `dependencies = ["libwayland"]` |
| Fix cosmic-comp | `wayland/cosmic-comp/` — missing libinput causes no keyboard |
| Work on smallvil | `wayland/smallvil/` — Smithay-based, already running |
| Port a KDE app | Copy existing recipe pattern, add `#TODO` header |
| Add Qt port | Create `wip/qt/qtbase/recipe.toml` (not yet started) |
| Add Qt port | Prefer the newer `local/recipes/qt/` / `local/recipes/kde/` work over this older note |
## WAYLAND STATUS
- **libwayland**: Builds with redox.patch stubbing 7 POSIX APIs
- **libwayland**: Builds with `redox.patch`; several POSIX-dependent code paths are still commented out there
- **cosmic-comp**: Partially working, no keyboard input (missing libinput)
- **smallvil**: Basic compositor running, poor performance
- **wlroots/sway/hyprland**: Not compiled or tested
- **xwayland**: Partially patched
- **Blockers**: POSIX gaps (M1), evdevd input (M2), DRM/KMS (M3)
- **Blockers**: downstream Wayland patch reduction, libinput/runtime input validation, DRM/KMS hardware/runtime validation
## KDE STATUS
- 9 app recipes exist but all blocked on Qt6 + KDE Frameworks
- No qtbase recipe yet (Phase KDE-A prerequisite)
- See `docs/05-KDE-PLASMA-ON-REDOX.md` for full 3-phase plan
- Older WIP KDE app notes here are stale relative to `local/recipes/kde/` and `config/redbear-kde.toml`
- See `docs/05-KDE-PLASMA-ON-REDOX.md` top-level status note plus `local/docs/QT6-PORT-STATUS.md` for current state
## CONVENTIONS
@@ -0,0 +1,54 @@
#TODO: Consider generating from kernel headers or evdevd types instead of manual defines
[source]
tar = "https://www.freedesktop.org/software/libevdev/libevdev-1.13.2.tar.xz"
[build]
template = "custom"
script = """
DYNAMIC_INIT
mkdir -p "${COOKBOOK_STAGE}/usr/include/linux"
# Copy input headers from libevdev's bundled copy
cp "${COOKBOOK_SOURCE}/include/linux/linux/input.h" "${COOKBOOK_STAGE}/usr/include/linux/"
cp "${COOKBOOK_SOURCE}/include/linux/linux/input-event-codes.h" "${COOKBOOK_STAGE}/usr/include/linux/"
# Create linux/types.h with __u* / __s* type aliases (input.h requires it)
cat > "${COOKBOOK_STAGE}/usr/include/linux/types.h" << 'EOF'
#ifndef _LINUX_TYPES_H
#define _LINUX_TYPES_H
#include <stdint.h>
#include <sys/types.h>
typedef uint8_t __u8;
typedef uint16_t __u16;
typedef uint32_t __u32;
typedef uint64_t __u64;
typedef int8_t __s8;
typedef int16_t __s16;
typedef int32_t __s32;
typedef int64_t __s64;
#endif
EOF
# Patch input.h: replace #include <linux/types.h> with our linux/types.h
# Also remove #include <sys/ioctl.h> (relibc has ioctl via sys/ioctl.h)
# And add _CNT macros
sed -i 's|#include <linux/types.h>|#include <linux/types.h>\\n#include <sys/ioctl.h>|' "${COOKBOOK_STAGE}/usr/include/linux/input.h" 2>/dev/null || true
# Append _CNT array-size macros
cat >> "${COOKBOOK_STAGE}/usr/include/linux/input.h" << 'EOF'
#define EV_CNT (EV_MAX + 1)
#define INPUT_PROP_CNT (INPUT_PROP_MAX + 1)
#define KEY_CNT (KEY_MAX + 1)
#define SYN_CNT (SYN_MAX + 1)
#define REL_CNT (REL_MAX + 1)
#define ABS_CNT (ABS_MAX + 1)
#define MSC_CNT (MSC_MAX + 1)
#define SW_CNT (SW_MAX + 1)
#define LED_CNT (LED_MAX + 1)
#define REP_CNT (REP_MAX + 1)
#define SND_CNT (SND_MAX + 1)
#define FF_CNT (FF_MAX + 1)
EOF
"""
+11 -3
View File
@@ -1,7 +1,15 @@
#TODO: promote
#TODO: promote once evdevd-backed runtime validation is complete
[source]
tar = "https://www.freedesktop.org/software/libevdev/libevdev-1.12.1.tar.xz"
blake3 = "d4be83e6f6cb4972cf5052f5a046eb820aa529427202f043a9d95b945e73edcd"
tar = "https://www.freedesktop.org/software/libevdev/libevdev-1.13.2.tar.xz"
patches = ["redox.patch"]
[build]
template = "meson"
mesonflags = [
"-Ddocumentation=disabled",
"-Dtests=disabled",
"-Dtools=disabled",
]
dependencies = [
"linux-input-headers",
]
+146
View File
@@ -0,0 +1,146 @@
diff -ruwN source-old/meson.build source/meson.build
--- source-old/meson.build 2025-04-26 00:00:00.000000000 +0000
+++ source/meson.build 2026-04-13 00:00:00.000000000 +0000
@@ -33,8 +33,13 @@
pkgconfig = import('pkgconfig')
dep_lm = cc.find_library('m')
dep_rt = cc.find_library('rt')
-input_h = dir_root / 'include' / 'linux' / host_machine.system() / 'input.h'
-input_event_codes_h = dir_root / 'include' / 'linux' / host_machine.system() / 'input-event-codes.h'
+linux_input_system = host_machine.system()
+if linux_input_system == 'redox'
+ linux_input_system = 'linux'
+endif
+
+input_h = dir_root / 'include' / 'linux' / linux_input_system / 'input.h'
+input_event_codes_h = dir_root / 'include' / 'linux' / linux_input_system / 'input-event-codes.h'
# event-names.h
make_event_names = find_program('libevdev/make-event-names.py')
diff -ruwN source-old/include/linux/input.h source/include/linux/input.h
--- source-old/include/linux/input.h 2025-04-26 00:00:00.000000000 +0000
+++ source/include/linux/input.h 2026-04-13 00:00:00.000000000 +0000
@@ -1,5 +1,5 @@
-#ifdef __linux__
+#if defined(__linux__) || defined(__redox__)
#include "linux/input.h"
#elif __FreeBSD__
#include "freebsd/input.h"
#endif
diff -ruwN source-old/include/linux/uinput.h source/include/linux/uinput.h
--- source-old/include/linux/uinput.h 2025-04-26 00:00:00.000000000 +0000
+++ source/include/linux/uinput.h 2026-04-13 00:00:00.000000000 +0000
@@ -1,5 +1,5 @@
-#ifdef __linux__
+#if defined(__linux__) || defined(__redox__)
#include "linux/uinput.h"
#elif __FreeBSD__
#include "freebsd/uinput.h"
#endif
diff -ruwN source-old/libevdev/libevdev-uinput.c source/libevdev/libevdev-uinput.c
--- source-old/libevdev/libevdev-uinput.c 2025-04-26 00:00:00.000000000 +0000
+++ source/libevdev/libevdev-uinput.c 2026-04-13 00:00:00.000000000 +0000
@@ -4,23 +4,88 @@
*/
#include "config.h"
-#include <dirent.h>
#include <errno.h>
+#include <time.h>
+
+#include "libevdev-int.h"
+#include "libevdev-uinput-int.h"
+#include "libevdev-uinput.h"
+
+#ifdef __redox__
+
+#include <stdlib.h>
+#include <unistd.h>
+
+LIBEVDEV_EXPORT int
+libevdev_uinput_get_fd(const struct libevdev_uinput *uinput_dev)
+{
+ return uinput_dev->fd;
+}
+
+LIBEVDEV_EXPORT int
+libevdev_uinput_create_from_device(const struct libevdev *dev,
+ int fd,
+ struct libevdev_uinput **uinput_dev)
+{
+ (void)dev;
+ (void)fd;
+ (void)uinput_dev;
+
+ return -ENOSYS;
+}
+
+LIBEVDEV_EXPORT void
+libevdev_uinput_destroy(struct libevdev_uinput *uinput_dev)
+{
+ if (!uinput_dev)
+ return;
+
+ if (uinput_dev->fd >= 0 && uinput_dev->fd_is_managed)
+ close(uinput_dev->fd);
+
+ free(uinput_dev->syspath);
+ free(uinput_dev->devnode);
+ free(uinput_dev->name);
+ free(uinput_dev);
+}
+
+LIBEVDEV_EXPORT const char*
+libevdev_uinput_get_syspath(struct libevdev_uinput *uinput_dev)
+{
+ return uinput_dev->syspath;
+}
+
+LIBEVDEV_EXPORT const char*
+libevdev_uinput_get_devnode(struct libevdev_uinput *uinput_dev)
+{
+ return uinput_dev->devnode;
+}
+
+LIBEVDEV_EXPORT int
+libevdev_uinput_write_event(const struct libevdev_uinput *uinput_dev,
+ unsigned int type,
+ unsigned int code,
+ int value)
+{
+ (void)uinput_dev;
+ (void)type;
+ (void)code;
+ (void)value;
+
+ return -ENOSYS;
+}
+
+#else
+
+#include <dirent.h>
#include <fcntl.h>
#include <linux/uinput.h>
#include <poll.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
-#include <time.h>
#include <unistd.h>
-
-#include "libevdev-int.h"
-#include "libevdev-uinput-int.h"
-#include "libevdev-uinput.h"
-#include "libevdev-util.h"
-#include "libevdev.h"
#ifndef UINPUT_IOCTL_BASE
#define UINPUT_IOCTL_BASE 'U'
#endif
@@ -489,3 +554,5 @@
return rc < 0 ? -errno : 0;
}
+
+#endif
+5 -3
View File
@@ -1,7 +1,8 @@
#TODO not compiled or tested
# build instructions: https://wayland.freedesktop.org/libinput/doc/latest/building.html#building
#TODO: needs libevdev working; udev integration is disabled so the compositor owns device discovery
[source]
tar = "https://gitlab.freedesktop.org/libinput/libinput/-/archive/1.30.2/libinput-1.30.2.tar.bz2"
patches = ["redox.patch"]
[build]
template = "meson"
mesonflags = [
@@ -9,8 +10,9 @@ mesonflags = [
"-Dmtdev=false",
"-Ddebug-gui=false",
"-Dtests=false",
"-Dudev=false",
"-Ddocumentation=false",
]
dependencies = [
"eudev",
"libevdev",
]
+577
View File
@@ -0,0 +1,577 @@
diff -ruN -x '*.orig' -x '*.rej' source-old/include/linux/input.h source/include/linux/input.h
--- source-old/include/linux/input.h 2026-02-24 04:13:42.000000000 +0000
+++ source/include/linux/input.h 2026-04-13 23:39:02.335147621 +0100
@@ -2,4 +2,6 @@
#include "linux/input.h"
#elif __FreeBSD__
#include "freebsd/input.h"
+#else
+#include "linux/input.h"
#endif
diff -ruN -x '*.orig' -x '*.rej' source-old/libudev.h source/libudev.h
--- source-old/libudev.h 1970-01-01 00:00:00.000000000 +0000
+++ source/libudev.h 2026-04-13 23:39:02.335248158 +0100
@@ -0,0 +1,65 @@
+#ifndef LIBINPUT_LIBUDEV_SHIM_H
+#define LIBINPUT_LIBUDEV_SHIM_H
+
+#include <sys/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct udev;
+struct udev_device;
+struct udev_enumerate;
+struct udev_list_entry;
+struct udev_monitor;
+
+struct udev *udev_new(void);
+struct udev *udev_ref(struct udev *udev);
+struct udev *udev_unref(struct udev *udev);
+
+struct udev *udev_device_get_udev(struct udev_device *udev_device);
+struct udev_device *udev_device_new_from_devnum(struct udev *udev, char type, dev_t devnum);
+struct udev_device *udev_device_new_from_syspath(struct udev *udev, const char *syspath);
+struct udev_device *udev_device_ref(struct udev_device *udev_device);
+struct udev_device *udev_device_unref(struct udev_device *udev_device);
+const char *udev_device_get_action(struct udev_device *udev_device);
+const char *udev_device_get_devnode(struct udev_device *udev_device);
+int udev_device_get_is_initialized(struct udev_device *udev_device);
+struct udev_device *udev_device_get_parent(struct udev_device *udev_device);
+struct udev_device *udev_device_get_parent_with_subsystem_devtype(struct udev_device *udev_device,
+ const char *subsystem,
+ const char *devtype);
+struct udev_list_entry *udev_device_get_properties_list_entry(struct udev_device *udev_device);
+const char *udev_device_get_property_value(struct udev_device *udev_device, const char *key);
+const char *udev_device_get_sysname(struct udev_device *udev_device);
+const char *udev_device_get_syspath(struct udev_device *udev_device);
+
+struct udev_enumerate *udev_enumerate_new(struct udev *udev);
+struct udev_enumerate *udev_enumerate_unref(struct udev_enumerate *udev_enumerate);
+int udev_enumerate_add_match_subsystem(struct udev_enumerate *udev_enumerate,
+ const char *subsystem);
+struct udev_list_entry *udev_enumerate_get_list_entry(struct udev_enumerate *udev_enumerate);
+int udev_enumerate_scan_devices(struct udev_enumerate *udev_enumerate);
+
+const char *udev_list_entry_get_name(struct udev_list_entry *list_entry);
+struct udev_list_entry *udev_list_entry_get_next(struct udev_list_entry *list_entry);
+const char *udev_list_entry_get_value(struct udev_list_entry *list_entry);
+
+#define udev_list_entry_foreach(list_entry, first_entry) \
+ for ((list_entry) = (first_entry); (list_entry) != NULL; \
+ (list_entry) = udev_list_entry_get_next(list_entry))
+
+struct udev_monitor *udev_monitor_new_from_netlink(struct udev *udev, const char *name);
+struct udev_monitor *udev_monitor_unref(struct udev_monitor *udev_monitor);
+int udev_monitor_enable_receiving(struct udev_monitor *udev_monitor);
+int udev_monitor_filter_add_match_subsystem_devtype(struct udev_monitor *udev_monitor,
+ const char *subsystem,
+ const char *devtype);
+int udev_monitor_get_fd(struct udev_monitor *udev_monitor);
+struct udev_device *udev_monitor_receive_device(struct udev_monitor *udev_monitor);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff -ruN -x '*.orig' -x '*.rej' source-old/meson.build source/meson.build
--- source-old/meson.build 2026-02-24 04:13:42.000000000 +0000
+++ source/meson.build 2026-04-13 23:39:02.335340571 +0100
@@ -116,7 +116,7 @@
config_h.set('HAVE_VERSIONSORT', '1')
endif
-if cc.get_define('SYS_pidfd_open', prefix: '#include <sys/syscall.h>') != ''
+if cc.has_header('sys/syscall.h') and cc.get_define('SYS_pidfd_open', prefix: '#include <sys/syscall.h>') != ''
config_h.set('HAVE_PIDFD_OPEN', '1')
endif
@@ -162,7 +162,13 @@
# Dependencies
pkgconfig = import('pkgconfig')
-dep_udev = dependency('libudev')
+have_udev = get_option('udev')
+if have_udev
+ config_h.set('HAVE_UDEV', 1)
+ dep_udev = dependency('libudev')
+else
+ dep_udev = declare_dependency()
+endif
dep_libevdev = dependency('libevdev', version: '>= 1.10.0')
dep_lm = cc.find_library('m', required : false)
@@ -228,6 +234,7 @@
############ udev bits ############
+if have_udev
executable('libinput-device-group',
'udev/libinput-device-group.c',
dependencies : [dep_udev, dep_libwacom],
@@ -272,13 +279,15 @@
output : '90-libinput-fuzz-override-litest.rules',
configuration : litest_udev_rules_config)
+endif
+
############ Check for leftover udev rules ########
# This test should be defined first so we don't waste time testing anything
# else if we're about to fail anyway. ninja test will execute tests in the
# order of them defined in meson.build
-if get_option('tests')
+if have_udev and get_option('tests')
test('leftover-rules',
find_program('test/check-leftover-udev-rules.sh'),
is_parallel : false,
@@ -351,6 +360,9 @@
'src/util-strings.c',
'src/util-prop-parsers.c',
]
+if not have_udev
+ src_libinput_util += ['src/libudev-stub.c']
+endif
libinput_util = static_library('libinput-util',
src_libinput_util,
dependencies : [dep_udev, dep_libevdev, dep_libwacom],
@@ -491,6 +503,10 @@
dep_libinput = declare_dependency(
link_with : lib_libinput,
dependencies : deps_libinput)
+pkgconfig_requires_private = []
+if have_udev
+ pkgconfig_requires_private += dep_udev
+endif
meson.override_dependency('libinput', dep_libinput)
@@ -500,7 +516,7 @@
description : 'Input device library',
version : meson.project_version(),
libraries : lib_libinput,
- requires_private : dep_udev,
+ requires_private : pkgconfig_requires_private,
variables : [
'plugindir=${libdir}/libinput/plugins'
]
@@ -537,6 +553,7 @@
dep_libinput_util_libinput = declare_dependency(link_with : libinput_util_libinput)
############ tools ############
+if host_machine.system() != 'redox'
libinput_tool_path = dir_libexec
config_h.set_quoted('LIBINPUT_TOOL_PATH', libinput_tool_path)
tools_shared_sources = [ 'tools/shared.c' ]
@@ -838,6 +855,7 @@
install_tag : 'tests',
install : true,
)
+endif
# This is the test suite runner, we allow disabling that one because of
# dependencies
diff -ruN -x '*.orig' -x '*.rej' source-old/meson_options.txt source/meson_options.txt
--- source-old/meson_options.txt 2026-02-24 04:13:42.000000000 +0000
+++ source/meson_options.txt 2026-04-13 23:39:02.335794827 +0100
@@ -2,6 +2,10 @@
type: 'string',
value: '',
description: 'udev base directory [default=$prefix/lib/udev]')
+option('udev',
+ type: 'boolean',
+ value: true,
+ description: 'Enable libudev integration (default=true)')
option('epoll-dir',
type: 'string',
value: '',
diff -ruN -x '*.orig' -x '*.rej' source-old/src/libinput.h source/src/libinput.h
--- source-old/src/libinput.h 2026-02-24 04:13:42.000000000 +0000
+++ source/src/libinput.h 2026-04-13 23:39:02.336213628 +0100
@@ -29,11 +29,13 @@
extern "C" {
#endif
-#include <libudev.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdlib.h>
+struct udev;
+struct udev_device;
+
#define LIBINPUT_ATTRIBUTE_PRINTF(_format, _args) \
__attribute__ ((format (printf, _format, _args)))
#define LIBINPUT_ATTRIBUTE_DEPRECATED __attribute__ ((deprecated))
diff -ruN -x '*.orig' -x '*.rej' source-old/src/libudev-stub.c source/src/libudev-stub.c
--- source-old/src/libudev-stub.c 1970-01-01 00:00:00.000000000 +0000
+++ source/src/libudev-stub.c 2026-04-13 23:39:02.336745169 +0100
@@ -0,0 +1,227 @@
+#include <stddef.h>
+
+#include <libudev.h>
+
+struct udev *
+udev_new(void)
+{
+ return NULL;
+}
+
+struct udev *
+udev_ref(struct udev *udev)
+{
+ return udev;
+}
+
+struct udev *
+udev_unref(struct udev *udev)
+{
+ return udev;
+}
+
+struct udev *
+udev_device_get_udev(struct udev_device *udev_device)
+{
+ (void)udev_device;
+ return NULL;
+}
+
+struct udev_device *
+udev_device_new_from_devnum(struct udev *udev, char type, dev_t devnum)
+{
+ (void)udev;
+ (void)type;
+ (void)devnum;
+ return NULL;
+}
+
+struct udev_device *
+udev_device_new_from_syspath(struct udev *udev, const char *syspath)
+{
+ (void)udev;
+ (void)syspath;
+ return NULL;
+}
+
+struct udev_device *
+udev_device_ref(struct udev_device *udev_device)
+{
+ return udev_device;
+}
+
+struct udev_device *
+udev_device_unref(struct udev_device *udev_device)
+{
+ return udev_device;
+}
+
+const char *
+udev_device_get_action(struct udev_device *udev_device)
+{
+ (void)udev_device;
+ return NULL;
+}
+
+const char *
+udev_device_get_devnode(struct udev_device *udev_device)
+{
+ (void)udev_device;
+ return NULL;
+}
+
+int
+udev_device_get_is_initialized(struct udev_device *udev_device)
+{
+ (void)udev_device;
+ return 0;
+}
+
+struct udev_device *
+udev_device_get_parent(struct udev_device *udev_device)
+{
+ (void)udev_device;
+ return NULL;
+}
+
+struct udev_device *
+udev_device_get_parent_with_subsystem_devtype(struct udev_device *udev_device,
+ const char *subsystem,
+ const char *devtype)
+{
+ (void)udev_device;
+ (void)subsystem;
+ (void)devtype;
+ return NULL;
+}
+
+struct udev_list_entry *
+udev_device_get_properties_list_entry(struct udev_device *udev_device)
+{
+ (void)udev_device;
+ return NULL;
+}
+
+const char *
+udev_device_get_property_value(struct udev_device *udev_device, const char *key)
+{
+ (void)udev_device;
+ (void)key;
+ return NULL;
+}
+
+const char *
+udev_device_get_sysname(struct udev_device *udev_device)
+{
+ (void)udev_device;
+ return NULL;
+}
+
+const char *
+udev_device_get_syspath(struct udev_device *udev_device)
+{
+ (void)udev_device;
+ return NULL;
+}
+
+struct udev_enumerate *
+udev_enumerate_new(struct udev *udev)
+{
+ (void)udev;
+ return NULL;
+}
+
+struct udev_enumerate *
+udev_enumerate_unref(struct udev_enumerate *udev_enumerate)
+{
+ return udev_enumerate;
+}
+
+int
+udev_enumerate_add_match_subsystem(struct udev_enumerate *udev_enumerate, const char *subsystem)
+{
+ (void)udev_enumerate;
+ (void)subsystem;
+ return 0;
+}
+
+struct udev_list_entry *
+udev_enumerate_get_list_entry(struct udev_enumerate *udev_enumerate)
+{
+ (void)udev_enumerate;
+ return NULL;
+}
+
+int
+udev_enumerate_scan_devices(struct udev_enumerate *udev_enumerate)
+{
+ (void)udev_enumerate;
+ return 0;
+}
+
+const char *
+udev_list_entry_get_name(struct udev_list_entry *list_entry)
+{
+ (void)list_entry;
+ return NULL;
+}
+
+struct udev_list_entry *
+udev_list_entry_get_next(struct udev_list_entry *list_entry)
+{
+ (void)list_entry;
+ return NULL;
+}
+
+const char *
+udev_list_entry_get_value(struct udev_list_entry *list_entry)
+{
+ (void)list_entry;
+ return NULL;
+}
+
+struct udev_monitor *
+udev_monitor_new_from_netlink(struct udev *udev, const char *name)
+{
+ (void)udev;
+ (void)name;
+ return NULL;
+}
+
+struct udev_monitor *
+udev_monitor_unref(struct udev_monitor *udev_monitor)
+{
+ return udev_monitor;
+}
+
+int
+udev_monitor_enable_receiving(struct udev_monitor *udev_monitor)
+{
+ (void)udev_monitor;
+ return -1;
+}
+
+int
+udev_monitor_filter_add_match_subsystem_devtype(struct udev_monitor *udev_monitor,
+ const char *subsystem,
+ const char *devtype)
+{
+ (void)udev_monitor;
+ (void)subsystem;
+ (void)devtype;
+ return 0;
+}
+
+int
+udev_monitor_get_fd(struct udev_monitor *udev_monitor)
+{
+ (void)udev_monitor;
+ return -1;
+}
+
+struct udev_device *
+udev_monitor_receive_device(struct udev_monitor *udev_monitor)
+{
+ (void)udev_monitor;
+ return NULL;
+}
diff -ruN -x '*.orig' -x '*.rej' source-old/src/timer.c source/src/timer.c
--- source-old/src/timer.c 2026-02-24 04:13:42.000000000 +0000
+++ source/src/timer.c 2026-04-13 23:39:02.336885230 +0100
@@ -26,9 +26,19 @@
#include <assert.h>
#include <errno.h>
#include <string.h>
-#include <sys/timerfd.h>
#include <unistd.h>
+#if defined(__has_include)
+#if __has_include(<sys/timerfd.h>)
+#include <sys/timerfd.h>
+#define LIBINPUT_HAVE_TIMERFD 1
+#endif
+#endif
+
+#ifndef LIBINPUT_HAVE_TIMERFD
+#define LIBINPUT_HAVE_TIMERFD 0
+#endif
+
#include "libinput-private.h"
#include "timer.h"
@@ -63,9 +73,7 @@
static void
libinput_timer_arm_timer_fd(struct libinput *libinput)
{
- int r;
struct libinput_timer *timer;
- struct itimerspec its = { { 0, 0 }, { 0, 0 } };
uint64_t earliest_expire = UINT64_MAX;
list_for_each(timer, &libinput->timer.list, link) {
@@ -73,6 +81,12 @@
earliest_expire = timer->expire;
}
+ libinput->timer.next_expiry = earliest_expire;
+
+#if LIBINPUT_HAVE_TIMERFD
+ int r;
+ struct itimerspec its = { { 0, 0 }, { 0, 0 } };
+
if (earliest_expire != UINT64_MAX) {
its.it_value.tv_sec = earliest_expire / ms2us(1000);
its.it_value.tv_nsec = (earliest_expire % ms2us(1000)) * 1000;
@@ -83,8 +97,7 @@
log_error(libinput,
"timer: timerfd_settime error: %s\n",
strerror(errno));
-
- libinput->timer.next_expiry = earliest_expire;
+#endif
}
void
@@ -170,6 +183,7 @@
static void
libinput_timer_dispatch(void *data)
{
+ #if LIBINPUT_HAVE_TIMERFD
struct libinput *libinput = data;
uint64_t now;
uint64_t discard;
@@ -187,18 +201,25 @@
return;
libinput_timer_handler(libinput, now);
+ #else
+ (void)data;
+ #endif
}
int
libinput_timer_subsys_init(struct libinput *libinput)
{
+ list_init(&libinput->timer.list);
+ libinput->timer.fd = -1;
+ libinput->timer.source = NULL;
+ libinput->timer.next_expiry = 0;
+
+ #if LIBINPUT_HAVE_TIMERFD
libinput->timer.fd =
timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC | TFD_NONBLOCK);
if (libinput->timer.fd < 0)
return -1;
- list_init(&libinput->timer.list);
-
libinput->timer.source = libinput_add_fd(libinput,
libinput->timer.fd,
libinput_timer_dispatch,
@@ -207,6 +228,7 @@
close(libinput->timer.fd);
return -1;
}
+ #endif
return 0;
}
@@ -229,8 +251,10 @@
/* All timer users should have destroyed their timers now */
assert(list_empty(&libinput->timer.list));
- libinput_remove_source(libinput, libinput->timer.source);
- close(libinput->timer.fd);
+ if (libinput->timer.source)
+ libinput_remove_source(libinput, libinput->timer.source);
+ if (libinput->timer.fd >= 0)
+ close(libinput->timer.fd);
}
/**
diff -ruN -x '*.orig' -x '*.rej' source-old/src/util-strings.h source/src/util-strings.h
--- source-old/src/util-strings.h 2026-02-24 04:13:42.000000000 +0000
+++ source/src/util-strings.h 2026-04-13 23:39:02.337008079 +0100
@@ -288,7 +288,7 @@
}
}
-#ifdef HAVE_LOCALE_H
+#if defined(HAVE_LOCALE_H) && !defined(__redox__)
/* Create a "C" locale to force strtod to use '.' as separator */
locale_t c_locale = newlocale(LC_NUMERIC_MASK, "C", (locale_t)0);
if (c_locale == (locale_t)0)
diff -ruN -x '*.orig' -x '*.rej' source-old/src/util-time.h source/src/util-time.h
--- source-old/src/util-time.h 2026-02-24 04:13:42.000000000 +0000
+++ source/src/util-time.h 2026-04-13 23:39:02.337090072 +0100
@@ -29,6 +29,7 @@
#include <errno.h>
#include <linux/input.h>
#include <stdint.h>
+#include <sys/time.h>
#include <time.h>
#include <unistd.h>
@@ -1,4 +1,4 @@
#TODO: promote
#TODO: needs xkeyboard-config data installed; Wayland helper tools stay disabled for now
[source]
tar = "https://xkbcommon.org/download/libxkbcommon-1.7.0.tar.xz"
blake3 = "5001ca0b8562feeef2010bf16c05657e3875fda3ed5fdedbf48b9135e5cdfcbc"
@@ -7,10 +7,10 @@ blake3 = "5001ca0b8562feeef2010bf16c05657e3875fda3ed5fdedbf48b9135e5cdfcbc"
template = "meson"
mesonflags = [
"-Denable-wayland=false",
"-Denable-x11=false"
"-Denable-x11=false",
"-Denable-tools=false",
]
dependencies = [
"libxml2",
"xz",
"zlib",
"xkeyboard-config",
]
+6
View File
@@ -0,0 +1,6 @@
#TODO: multitouch protocol translation — optional for basic mouse/keyboard
[source]
tar = "https://bitmath.org/code/mtdev/mtdev-1.1.7.tar.bz2"
[build]
template = "configure"
@@ -1,5 +1,34 @@
#TODO not compiled or tested
# qt6-shadertools provides qsb tool needed for Qt Quick shader compilation
[source]
tar = "https://download.qt.io/official_releases/qt/6.6/6.6.1/submodules/qtshadertools-everywhere-src-6.6.1.tar.xz"
tar = "https://download.qt.io/official_releases/qt/6.11/6.11.0/submodules/qtshadertools-everywhere-src-6.11.0.tar.xz"
[build]
template = "configure"
template = "custom"
script = """
DYNAMIC_INIT
HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build"
mkdir -p "${COOKBOOK_BUILD}/host"
env \
-u CPPFLAGS \
-u LDFLAGS \
-u PKG_CONFIG_ALLOW_CROSS \
-u PKG_CONFIG_PATH \
-u PKG_CONFIG_LIBDIR \
-u PKG_CONFIG_SYSROOT_DIR \
-u CFLAGS_x86_64_unknown_redox \
-u CXXFLAGS_x86_64_unknown_redox \
-u LDFLAGS_x86_64_unknown_redox \
cmake -S "${COOKBOOK_SOURCE}/tools/qsb" -B "${COOKBOOK_BUILD}/host" \
-DCMAKE_C_COMPILER=/usr/bin/cc \
-DCMAKE_CXX_COMPILER=/usr/bin/c++ \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="${HOST_BUILD}" \
-DQT_BUILD_EXAMPLES=OFF \
-DQT_BUILD_TESTS=OFF \
-Wno-dev
cmake --build "${COOKBOOK_BUILD}/host" -j"${COOKBOOK_MAKE_JOBS}"
cmake --install "${COOKBOOK_BUILD}/host" --prefix "${HOST_BUILD}"
"""
+318
View File
@@ -0,0 +1,318 @@
#TODO: Qt6 base — qtbase compiled with Core+Concurrent+Xml+Gui+Widgets+DBus. Runtime validation pending.
# Scope: software rendering (no EGL/OpenGL), no Network/SQL/PrintSupport/TestLib.
# 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"
patches = ["redox.patch"]
[build]
template = "custom"
dependencies = [
"glib",
"pcre2",
"zlib",
"libwayland",
"dbus",
"mesa",
]
script = """
DYNAMIC_INIT
# ============================================================
# 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"
if [ ! -f "${HOST_BUILD}/bin/moc" ]; then
echo "=== Building Qt host tools ==="
mkdir -p "${HOST_BUILD}"
env \
-u CPPFLAGS \
-u LDFLAGS \
-u PKG_CONFIG_ALLOW_CROSS \
-u PKG_CONFIG_PATH \
-u PKG_CONFIG_LIBDIR \
-u PKG_CONFIG_SYSROOT_DIR \
-u CFLAGS_x86_64_unknown_redox \
-u CXXFLAGS_x86_64_unknown_redox \
-u LDFLAGS_x86_64_unknown_redox \
cmake -S "${COOKBOOK_SOURCE}" -B "${HOST_BUILD}" \
-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=OFF \
-DFEATURE_widgets=OFF \
-DFEATURE_opengl=OFF \
-DFEATURE_network=OFF \
-DFEATURE_dbus=ON \
-DFEATURE_openssl=OFF \
-DFEATURE_sql=OFF \
-DFEATURE_testlib=OFF \
-DFEATURE_xml=OFF \
-DFEATURE_wayland=ON \
-DFEATURE_qtwaylandscanner=ON \
-Wno-dev
env \
-u CPPFLAGS \
-u LDFLAGS \
-u PKG_CONFIG_ALLOW_CROSS \
-u PKG_CONFIG_PATH \
-u PKG_CONFIG_LIBDIR \
-u PKG_CONFIG_SYSROOT_DIR \
-u CFLAGS_x86_64_unknown_redox \
-u CXXFLAGS_x86_64_unknown_redox \
-u LDFLAGS_x86_64_unknown_redox \
cmake --build "${HOST_BUILD}" --target host_tools -j"${COOKBOOK_MAKE_JOBS}"
fi
# ============================================================
# 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 <sys/statvfs.h>
typedef struct statvfs statfs;
#define statfs statvfs
#define f_flags f_flag
#endif /* _SYS_STATFS_H */
STATFS_EOF
fi
# relibc lacks resolv.h (DNS resolver). QtNetwork includes it unconditionally on Unix.
# Provide an empty stub — DNS resolution won't work but basic socket networking will.
if [ ! -f "${COOKBOOK_SYSROOT}/include/resolv.h" ]; then
touch "${COOKBOOK_SYSROOT}/include/resolv.h"
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}"
if [ ! -f "${target}" ] && [ -f "${COOKBOOK_SOURCE}/src/corelib/kernel/${hdr}" ]; then
sed 's|kernel/|../kernel/|' "${COOKBOOK_SOURCE}/src/corelib/private/${hdr}" > "${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"
# Disable QtNetwork — relibc lacks resolv.h, in6_pktinfo, SIOCGIF* ioctls.
# Will be re-enabled when POSIX networking gaps are filled in relibc.
sed -i 's/^ add_subdirectory(network)/ # add_subdirectory(network) # disabled for Redox/' \
"${COOKBOOK_SOURCE}/src/CMakeLists.txt"
# Disable TUIO touch plugin — depends on QtNetwork which is disabled
sed -i 's/^ add_subdirectory(tuiotouch)/ # add_subdirectory(tuiotouch) # disabled for Redox (needs Network)/' \
"${COOKBOOK_SOURCE}/src/plugins/generic/CMakeLists.txt"
# 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"
awk '/^ SOURCES$/ && !done { print; print " painting/qt_float16_shims.c"; done=1; next } { print }' \
"${COOKBOOK_SOURCE}/src/gui/CMakeLists.txt" > "${COOKBOOK_SOURCE}/src/gui/CMakeLists.txt.tmp"
mv "${COOKBOOK_SOURCE}/src/gui/CMakeLists.txt.tmp" "${COOKBOOK_SOURCE}/src/gui/CMakeLists.txt"
# 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 (C11 macro from <assert.h>) but forkfd_qt.c (C file)
# includes qglobal→qtypes before assert.h. Add the include guard for C mode.
QTYPES="${COOKBOOK_SOURCE}/src/corelib/global/qtypes.h"
if ! grep -q 'assert.h' "${QTYPES}" 2>/dev/null; then
awk '/#ifndef __cplusplus/ { print; print "#include <assert.h>"; next } { print }' \
"${QTYPES}" > "${QTYPES}.tmp"
mv "${QTYPES}.tmp" "${QTYPES}"
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 <unistd.h>/ { print; print "#include <sys/ioctl.h>"; next } { print }' \
"${QP}" > "${QP}.tmp"
mv "${QP}.tmp" "${QP}"
fi
# Compile waitid() stub into sysroot lib — relibc lacks waitid() (unimplemented).
# Qt's forkfd.c (QProcess backend) calls waitid(P_PID, ...) for child readiness.
# The -1 return means "no children ready" — safe for process spawning via fork+exec.
x86_64-unknown-redox-gcc -c -O2 -o "${COOKBOOK_SYSROOT}/lib/redox_waitid.o" \
"${COOKBOOK_ROOT}/local/recipes/qt/redox_waitid.c"
x86_64-unknown-redox-ar rcs "${COOKBOOK_SYSROOT}/lib/libredox_waitid.a" \
"${COOKBOOK_SYSROOT}/lib/redox_waitid.o"
# Also add waitid() declaration to sys/wait.h so forkfd.c sees it
WAIT_H="${COOKBOOK_SYSROOT}/include/sys/wait.h"
if [ -f "${WAIT_H}" ] && ! grep -q 'waitid.*siginfo_t' "${WAIT_H}" 2>/dev/null; then
awk '/^#endif/ { print "/* Redox: waitid() declaration */"; print "int waitid(int,int,siginfo_t*,int);" } { print }' \
"${WAIT_H}" > "${WAIT_H}.tmp"
mv "${WAIT_H}.tmp" "${WAIT_H}"
fi
# Inject waitid.o into Qt's Core library sources so it links into libQt6Core
CORE_CMAKE="${COOKBOOK_SOURCE}/src/corelib/CMakeLists.txt"
if ! grep -q 'redox_waitid' "${CORE_CMAKE}" 2>/dev/null; then
WAIT_O="${COOKBOOK_SYSROOT}/lib/redox_waitid.o"
awk '/target_sources\\(Core/ && !done { print; print " '"${WAIT_O}"'"; done=1; next } { print }' \
"${CORE_CMAKE}" > "${CORE_CMAKE}.tmp"
mv "${CORE_CMAKE}.tmp" "${CORE_CMAKE}"
fi
cmake "${COOKBOOK_SOURCE}" \
-DCMAKE_TOOLCHAIN_FILE="${COOKBOOK_ROOT}/local/recipes/qt/redox-toolchain.cmake" \
-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_gui=ON \
-DFEATURE_widgets=ON \
-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_sharedmemory=OFF \
-DFEATURE_systemsemaphore=OFF \
-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 --remove-rpath {} + 2>/dev/null || true
"""
+467
View File
@@ -0,0 +1,467 @@
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
@@ -55,8 +55,20 @@
set(NETBSD 0)
endif()
+# REDOX is set by the Redox toolchain file (redox-toolchain.cmake) as CACHE INTERNAL.
+# When CMAKE_SYSTEM_NAME is "Linux" (for CMake UNIX detection), we need this variable
+# to enable Redox-specific code paths (mkspec, QPA plugin, platform tweaks).
+# Falls back to checking CMAKE_SYSTEM_NAME for standalone/non-toolchain usage.
+if(NOT DEFINED REDOX)
+ if(CMAKE_SYSTEM_NAME STREQUAL "Redox")
+ set(REDOX 1)
+ else()
+ set(REDOX 0)
+ endif()
+endif()
+
if(CMAKE_SYSTEM_NAME STREQUAL "Emscripten" OR EMSCRIPTEN)
set(WASM 1)
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
@@ -46,4 +46,8 @@
endif()
+ elseif(REDOX)
+ if(GCC)
+ set(QT_DEFAULT_MKSPEC redox-g++)
+ endif()
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
@@ -0,0 +1,14 @@
+#
+# qmake configuration for redox-g++
+#
+
+MAKEFILE_GENERATOR = UNIX
+QMAKE_PLATFORM += redox
+CONFIG += incremental
+QMAKE_INCREMENTAL_STYLE = sublib
+
+include(../common/unix.conf)
+include(../common/gcc-base-unix.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
@@ -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
+
+#ifndef QPLATFORMDEFS_H
+#define QPLATFORMDEFS_H
+
+#include "qglobal.h"
+
+#include <unistd.h>
+
+#include <dirent.h>
+#include <fcntl.h>
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+
+#ifndef O_LARGEFILE
+# define O_LARGEFILE 0
+#endif
+
+#include "../common/posix/qplatformdefs.h"
+
+#define QT_SNPRINTF ::snprintf
+#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
@@ -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
@@ -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
@@ -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
@@ -30,6 +30,7 @@
HURD - GNU Hurd
QNX - QNX [has variants]
QNX6 - QNX RTP 6.1
+ REDOX - Redox OS
LYNX - LynxOS
BSD4 - Any BSD 4.4 system
UNIX - Any UNIX BSD/SYSV system
@@ -123,6 +124,8 @@
# define Q_OS_VXWORKS
#elif defined(__HAIKU__)
# define Q_OS_HAIKU
+#elif defined(__redox__)
+# define Q_OS_REDOX
#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-04-13 00:00:00.000000000 +0000
@@ -243,9 +243,15 @@
#ifdef AT_FDCWD
static inline int qt_safe_openat(int dfd, const char *pathname, int flags, mode_t mode = 0777)
{
// everyone already has O_CLOEXEC
int fd;
+#ifdef Q_OS_REDOX
+ if (dfd != AT_FDCWD)
+ return -1;
+ QT_EINTR_LOOP(fd, QT_OPEN(pathname, flags | O_CLOEXEC, mode));
+#else
QT_EINTR_LOOP(fd, openat(dfd, pathname, flags | O_CLOEXEC, mode));
+#endif
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
@@ -20,6 +20,8 @@
set(_default_platform "eglfs")
elseif(HAIKU)
set(_default_platform "haiku")
+ elseif(REDOX)
+ set(_default_platform "redox")
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
@@ -22,6 +22,9 @@
if(QNX)
add_subdirectory(qnx)
endif()
+if(REDOX)
+ add_subdirectory(redox)
+endif()
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
@@ -0,0 +1,14 @@
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_plugin(QRedoxIntegrationPlugin
+ OUTPUT_NAME qredox
+ PLUGIN_TYPE platforms
+ DEFAULT_IF "redox" IN_LIST QT_QPA_PLATFORMS
+ SOURCES
+ main.cpp
+ LIBRARIES
+ Qt::Core
+ Qt::CorePrivate
+ 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
@@ -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
+
+#include <qpa/qplatformintegrationfactory_p.h>
+#include <qpa/qplatformintegrationplugin.h>
+
+QT_BEGIN_NAMESPACE
+
+class QRedoxIntegrationPlugin : public QPlatformIntegrationPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID QPlatformIntegrationFactoryInterface_iid FILE "redox.json")
+public:
+ QPlatformIntegration *create(const QString &system, const QStringList &paramList) override;
+};
+
+QPlatformIntegration *QRedoxIntegrationPlugin::create(const QString &system, const QStringList &paramList)
+{
+ if (system.compare(QStringLiteral("redox"), Qt::CaseInsensitive) != 0)
+ return nullptr;
+
+ int argc = 0;
+ char **argv = nullptr;
+ return QPlatformIntegrationFactory::create(QStringLiteral("wayland"), paramList, argc, argv);
+}
+
+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
@@ -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
@@ -45,6 +45,8 @@
# if !defined( __MINGW32__ ) && !defined( _AIX ) && !defined(Q_OS_QNX)
# include <endian.h>
-# if !defined( __BEOS__ ) && !defined(Q_OS_RTEMS) && !defined(Q_OS_VXWORKS)
+# if defined(__redox__)
+ /* Redox: byteswap.h not in relibc, bswap from endian.h suffices */
+# elif !defined( __BEOS__ ) && !defined(Q_OS_RTEMS) && !defined(Q_OS_VXWORKS)
# include <byteswap.h>
# 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-04-13 00:00:00.000000000 +0000
@@ -51,7 +51,13 @@
# if !defined(_STATFS_F_FLAGS) && !defined(Q_OS_NETBSD)
# define _STATFS_F_FLAGS 1
# endif
-#elif defined(Q_OS_HAIKU) || defined(Q_OS_CYGWIN)
+#elif defined(Q_OS_REDOX)
+# define QT_STATFSBUF struct statvfs
+# define QT_STATFS ::statvfs
+# if !defined(ST_RDONLY)
+# define ST_RDONLY 1
+# endif
+#elif defined(Q_OS_HAIKU) || defined(Q_OS_CYGWIN)
# define QT_STATFSBUF struct statvfs
# define QT_STATFS ::statvfs
#else
diff -ruwN source-old/src/corelib/io/qfilesystemengine_unix.cpp source/src/corelib/io/qfilesystemengine_unix.cpp
--- source-old/src/corelib/io/qfilesystemengine_unix.cpp 2024-12-02 05:39:06.000000000 +0000
+++ source/src/corelib/io/qfilesystemengine_unix.cpp 2026-04-13 00:00:00.000000000 +0000
@@ -28,4 +28,21 @@
#include <errno.h>
+#ifdef Q_OS_REDOX
+// relibc does not provide unlinkat/linkat yet (POSIX.1-2008 *at functions).
+// Provide inline stubs that work for AT_FDCWD only - sufficient for
+// FreeDesktop trash operations in this file.
+#include <fcntl.h>
+static inline int unlinkat(int dirfd, const char *pathname, int flags)
+{
+ if (dirfd != AT_FDCWD || flags != 0) { errno = ENOTSUP; return -1; }
+ return unlink(pathname);
+}
+static inline int linkat(int olddirfd, const char *oldpath, int newdirfd, const char *newpath, int flags)
+{
+ if (olddirfd != AT_FDCWD || newdirfd != AT_FDCWD || flags != 0) { errno = ENOTSUP; return -1; }
+ return link(oldpath, newpath);
+}
+#endif
+
#include <chrono>
#include <memory> // for std::unique_ptr
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
@@ -0,0 +1,167 @@
+/*
+ * IEEE 754 half-precision soft-float conversion shims for Redox OS
+ *
+ * These compiler runtime functions (__truncsfhf2, __extendhfsf2, etc.) are
+ * normally provided by libgcc or compiler-rt. The Redox cross-toolchain
+ * (x86_64-unknown-redox-gcc, GCC 13.2.0) does not include them because
+ * x86_64 has no native half-precision support (no AVX512FP16).
+ *
+ * Qt6's qfloat16.cpp triggers the compiler to emit calls to these functions.
+ * We provide them here so QtCore links successfully.
+ *
+ * Format: IEEE 754 binary16 (half): 1 sign + 5 exp (bias 15) + 10 mantissa
+ * IEEE 754 binary32 (float): 1 sign + 8 exp (bias 127) + 23 mantissa
+ *
+ * SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+ */
+
+typedef unsigned short uint16_t;
+typedef unsigned int uint32_t;
+
+/* --- float16 -> float32 --- */
+float __extendhfsf2(uint16_t h)
+{
+ uint32_t sign = (h >> 15) & 1;
+ uint32_t exp = (h >> 10) & 0x1f;
+ uint32_t frac = h & 0x3ff;
+ uint32_t bits;
+
+ if (exp == 0) {
+ if (frac == 0) {
+ /* +/- zero */
+ bits = sign << 31;
+ } else {
+ /* Denormalized half: normalize it */
+ exp = 1;
+ while (!(frac & 0x400)) {
+ frac <<= 1;
+ exp--;
+ }
+ frac &= 0x3ff;
+ bits = (sign << 31) | ((exp + 127 - 15) << 23) | (frac << 13);
+ }
+ } else if (exp == 0x1f) {
+ /* Inf or NaN */
+ bits = (sign << 31) | (0xffu << 23) | (frac << 13);
+ } else {
+ /* Normalized */
+ bits = (sign << 31) | ((exp + 127 - 15) << 23) | (frac << 13);
+ }
+
+ union { uint32_t i; float f; } u;
+ u.i = bits;
+ return u.f;
+}
+
+/* --- float32 -> float16 --- */
+uint16_t __truncsfhf2(float f)
+{
+ union { uint32_t i; float f; } u;
+ u.f = f;
+ uint32_t bits = u.i;
+
+ uint32_t sign = (bits >> 31) & 1;
+ int exp = ((bits >> 23) & 0xff) - 127;
+ uint32_t frac = bits & 0x7fffff;
+
+ /* Handle zero / denormal float input */
+ if (((bits >> 23) & 0xff) == 0) {
+ if (frac == 0) return (uint16_t)(sign << 15);
+ /* Normalize denormal float */
+ while (!(frac & 0x400000)) {
+ frac <<= 1;
+ exp--;
+ }
+ frac &= 0x3fffff;
+ }
+
+ exp += 15; /* rebias to half-precision */
+
+ if (exp <= 0) {
+ /* Underflow: return +/- zero */
+ return (uint16_t)(sign << 15);
+ }
+ if (exp >= 0x1f) {
+ /* Overflow: return +/- inf */
+ return (uint16_t)((sign << 15) | 0x7c00);
+ }
+
+ /* Round to nearest even: add 0x1000 (half of the gap between half-prec
+ representable values at the LSB position in the 23-bit mantissa). */
+ frac = (frac + 0x1000) >> 13;
+
+ /* Mantissa overflow from rounding */
+ if (frac & 0x400) {
+ frac = 0;
+ exp++;
+ if (exp >= 0x1f)
+ return (uint16_t)((sign << 15) | 0x7c00);
+ }
+
+ return (uint16_t)((sign << 15) | (exp << 10) | frac);
+}
+
+/* --- float16 -> float64 --- */
+double __extendhfdf2(uint16_t h)
+{
+ /* Go through float32 — float has more than enough precision for half */
+ float f = __extendhfsf2(h);
+ return (double)f;
+}
+
+/* --- float64 -> float16 --- */
+uint16_t __truncdfhf2(double d)
+{
+ /* Double -> float -> half: no meaningful precision loss for half output */
+ return __truncsfhf2((float)d);
+}
+
+/* --- long double -> float16 --- */
+uint16_t __truncxfhf2(long double ld)
+{
+ return __truncsfhf2((float)ld);
+}
+
+/* --- half-precision comparisons --- */
+int __eqhf2(uint16_t a, uint16_t b)
+{
+ float fa = __extendhfsf2(a);
+ float fb = __extendhfsf2(b);
+ return fa == fb;
+}
+int __nehf2(uint16_t a, uint16_t b)
+{
+ float fa = __extendhfsf2(a);
+ float fb = __extendhfsf2(b);
+ return fa != fb;
+}
+int __lthf2(uint16_t a, uint16_t b)
+{
+ float fa = __extendhfsf2(a);
+ float fb = __extendhfsf2(b);
+ return fa < fb ? -1 : (fa == fb ? 0 : 1);
+}
+int __lehf2(uint16_t a, uint16_t b)
+{
+ float fa = __extendhfsf2(a);
+ float fb = __extendhfsf2(b);
+ return fa <= fb ? 0 : 1;
+}
+int __gthf2(uint16_t a, uint16_t b)
+{
+ float fa = __extendhfsf2(a);
+ float fb = __extendhfsf2(b);
+ return fa > fb ? 1 : (fa == fb ? 0 : -1);
+}
+int __gehf2(uint16_t a, uint16_t b)
+{
+ float fa = __extendhfsf2(a);
+ float fb = __extendhfsf2(b);
+ return fa >= fb ? 0 : -1;
+}
+int __unordhf2(uint16_t a, uint16_t b)
+{
+ float fa = __extendhfsf2(a);
+ 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
@@ -61,6 +61,7 @@
global/qfloat16.cpp global/qfloat16.h
+ global/qt_float16_shims.c
global/qforeach.h
global/qfunctionpointer.h
global/qgettid_p.h
global/qglobal.cpp global/qglobal.h global/qglobal_p.h
+176
View File
@@ -0,0 +1,176 @@
#TODO: Qt6 QML/QtQuick — cross-compiled for Redox. Needs qtbase with Wayland.
# Provides: libQt6Qml, libQt6Quick, libQt6QuickWidgets, libQt6QmlModels, etc.
# Also builds QML host tools (qmlcachegen, qmllint) for cross-compilation.
[source]
tar = "https://download.qt.io/official_releases/qt/6.11/6.11.0/submodules/qtdeclarative-everywhere-src-6.11.0.tar.xz"
[build]
template = "custom"
dependencies = [
"qtbase",
]
script = """
DYNAMIC_INIT
HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build"
DECL_HOST="${COOKBOOK_ROOT}/build/qt-declarative-host"
# ============================================================
# Step 1: Build qtdeclarative host tools (qmlcachegen, qmllint)
# These link against qtbase's host Qt6Core.
# Install into the same prefix as qtbase host tools so
# QT_HOST_PATH finds both qtbase and qtdeclarative tools.
# ============================================================
if [ ! -f "${HOST_BUILD}/bin/qmlcachegen" ]; then
echo "=== Building qtdeclarative host tools ==="
mkdir -p "${DECL_HOST}"
env \
-u CPPFLAGS \
-u LDFLAGS \
-u PKG_CONFIG_ALLOW_CROSS \
-u PKG_CONFIG_PATH \
-u PKG_CONFIG_LIBDIR \
-u PKG_CONFIG_SYSROOT_DIR \
-u CFLAGS_x86_64_unknown_redox \
-u CXXFLAGS_x86_64_unknown_redox \
-u LDFLAGS_x86_64_unknown_redox \
cmake -S "${COOKBOOK_SOURCE}" -B "${DECL_HOST}" \
-DCMAKE_C_COMPILER=/usr/bin/cc \
-DCMAKE_CXX_COMPILER=/usr/bin/c++ \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="${HOST_BUILD}" \
-DCMAKE_PREFIX_PATH="${HOST_BUILD}" \
-DQT_BUILD_EXAMPLES=OFF \
-DQT_BUILD_TESTS=OFF \
-DQT_GENERATE_SBOM=OFF \
-Wno-dev
cmake --build "${DECL_HOST}" -j"${COOKBOOK_MAKE_JOBS}"
cmake --install "${DECL_HOST}" --prefix "${HOST_BUILD}"
fi
# ============================================================
# Step 2: Cross-compile qtdeclarative for Redox
# ============================================================
rm -f CMakeCache.txt
rm -rf CMakeFiles
# Sysroot path fix: the cookbook only symlinks sysroot/{bin,include,lib,share} → usr/
# but Qt6 cmake targets reference ${_IMPORT_PREFIX}/{plugins,mkspecs,metatypes,modules}
# which resolve to sysroot/{plugins,mkspecs,metatypes,modules} — missing the usr/ layer.
for qtdir in plugins mkspecs metatypes modules; do
if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then
ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}"
fi
done
# Patch masm/CheckedArithmetic.h: add missing ArithmeticOperations<unsigned, long>
# specialization for LP64 (sizeof(long) != sizeof(int)). The existing code only
# handles <unsigned, int> but GCC instantiates <unsigned, long> on x86_64.
CHECKED="${COOKBOOK_SOURCE}/src/3rdparty/masm/wtf/CheckedArithmetic.h"
if ! grep -q 'ArithmeticOperations<unsigned, long, ResultType, false, true>' "${CHECKED}" 2>/dev/null; then
PATCHF="${COOKBOOK_BUILD}/arithm_patch.h"
mkdir -p "${COOKBOOK_BUILD}"
printf '%s\n' \
"template <typename ResultType> struct ArithmeticOperations<unsigned, long, ResultType, false, true> {" \
" static inline bool add(unsigned lhs, long rhs, ResultType& result) WARN_UNUSED_RETURN" \
" {" \
" int64_t temp = static_cast<int64_t>(lhs) + static_cast<int64_t>(rhs);" \
" if (temp < std::numeric_limits<ResultType>::min()) return false;" \
" if (temp > std::numeric_limits<ResultType>::max()) return false;" \
" result = static_cast<ResultType>(temp);" \
" return true;" \
" }" \
" static inline bool sub(unsigned lhs, long rhs, ResultType& result) WARN_UNUSED_RETURN" \
" {" \
" int64_t temp = static_cast<int64_t>(lhs) - static_cast<int64_t>(rhs);" \
" if (temp < std::numeric_limits<ResultType>::min()) return false;" \
" if (temp > std::numeric_limits<ResultType>::max()) return false;" \
" result = static_cast<ResultType>(temp);" \
" return true;" \
" }" \
" static inline bool multiply(unsigned lhs, long rhs, ResultType& result) WARN_UNUSED_RETURN" \
" {" \
" int64_t temp = static_cast<int64_t>(lhs) * static_cast<int64_t>(rhs);" \
" if (temp < std::numeric_limits<ResultType>::min()) return false;" \
" if (temp > std::numeric_limits<ResultType>::max()) return false;" \
" result = static_cast<ResultType>(temp);" \
" return true;" \
" }" \
" static inline bool equals(unsigned lhs, long rhs)" \
" {" \
" return static_cast<int64_t>(lhs) == static_cast<int64_t>(rhs);" \
" }" \
"};" > "${PATCHF}"
LINE=$(grep -n "ArithmeticOperations<int, unsigned, ResultType>::equals" "${CHECKED}" | head -1 | cut -d: -f1)
INSERT=$((LINE + 3))
sed -i "${INSERT}r ${PATCHF}" "${CHECKED}"
fi
cmake "${COOKBOOK_SOURCE}" \
-DCMAKE_TOOLCHAIN_FILE="${COOKBOOK_ROOT}/local/recipes/qt/redox-toolchain.cmake" \
-DQT_HOST_PATH="${HOST_BUILD}" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="${COOKBOOK_SYSROOT}" \
-DQT_BUILD_EXAMPLES=OFF \
-DQT_BUILD_TESTS=OFF \
-DQT_GENERATE_SBOM=OFF \
-DQT_FEATURE_qml_jit=OFF \
-DQT_FEATURE_ssl=OFF \
-DQT_FEATURE_network=OFF \
-DQT_FEATURE_localserver=OFF \
-DQT_FEATURE_http=OFF \
-DQT_FEATURE_udpsocket=OFF \
-DQT_FEATURE_dnslookup=OFF \
-DQT_FEATURE_networkinterface=OFF \
-DQT_FEATURE_networkproxy=OFF \
-DQT_FEATURE_socks5=OFF \
-DQT_FEATURE_networkdiskcache=OFF \
-Wno-dev
cmake --build . -j${COOKBOOK_MAKE_JOBS}
# ============================================================
# Step 3: Stage everything
# ============================================================
mkdir -p "${COOKBOOK_STAGE}/usr/lib"
for lib in lib/libQt6*.so*; do
[ -f "${lib}" ] && cp -a "${lib}" "${COOKBOOK_STAGE}/usr/lib/"
done
for lib in lib/libQt6*.a; do
[ -f "${lib}" ] && cp -a "${lib}" "${COOKBOOK_STAGE}/usr/lib/"
done
if [ -d "lib/cmake" ]; then
mkdir -p "${COOKBOOK_STAGE}/usr/lib/cmake"
cp -a lib/cmake/Qt6* "${COOKBOOK_STAGE}/usr/lib/cmake/" 2>/dev/null || true
fi
if [ -d "lib/pkgconfig" ]; then
mkdir -p "${COOKBOOK_STAGE}/usr/lib/pkgconfig"
cp -a lib/pkgconfig/*.pc "${COOKBOOK_STAGE}/usr/lib/pkgconfig/" 2>/dev/null || true
fi
if [ -d "include" ]; then
mkdir -p "${COOKBOOK_STAGE}/usr/include"
cp -a include/* "${COOKBOOK_STAGE}/usr/include/" 2>/dev/null || true
fi
if [ -d "plugins" ]; then
mkdir -p "${COOKBOOK_STAGE}/usr/plugins"
cp -a plugins/* "${COOKBOOK_STAGE}/usr/plugins/" 2>/dev/null || true
fi
if [ -d "qml" ]; then
mkdir -p "${COOKBOOK_STAGE}/usr/qml"
cp -a qml/* "${COOKBOOK_STAGE}/usr/qml/" 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 --remove-rpath {} + 2>/dev/null || true
# CMake export fixup: replace build-tree paths with /usr
BUILD_DIR="${COOKBOOK_BUILD}"
find "${COOKBOOK_STAGE}/usr/lib/cmake" -name '*.cmake' -exec sed -i \
"s|${BUILD_DIR}|/usr|g" {} + 2>/dev/null || true
"""
+86
View File
@@ -0,0 +1,86 @@
#TODO: Qt6 SVG module — needed for KDE icon themes (SVG rendering via QtGui).
# Provides: libQt6Svg, libQt6SvgWidgets (QtSvgWidgets plugin)
[build]
template = "custom"
dependencies = [
"qtbase",
]
script = """
DYNAMIC_INIT
HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build"
# Sysroot path fix: same as qtdeclarative — cookbook only symlinks
# sysroot/{bin,include,lib,share} but Qt6 cmake targets reference
# ${_IMPORT_PREFIX}/{plugins,mkspecs,metatypes,modules}.
for qtdir in plugins mkspecs metatypes modules; do
if [ -d "${COOKBOOK_SYSROOT}/usr/${qtdir}" ] && [ ! -e "${COOKBOOK_SYSROOT}/${qtdir}" ]; then
ln -s "usr/${qtdir}" "${COOKBOOK_SYSROOT}/${qtdir}"
fi
done
rm -f CMakeCache.txt
rm -rf CMakeFiles
cmake "${COOKBOOK_SOURCE}" \
-DCMAKE_TOOLCHAIN_FILE="${COOKBOOK_ROOT}/local/recipes/qt/redox-toolchain.cmake" \
-DQT_HOST_PATH="${HOST_BUILD}" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="${COOKBOOK_SYSROOT}" \
-DQT_BUILD_EXAMPLES=OFF \
-DQT_BUILD_TESTS=OFF \
-DQT_GENERATE_SBOM=OFF \
-Wno-dev
cmake --build . -j${COOKBOOK_MAKE_JOBS}
cmake --install . --prefix "${COOKBOOK_STAGE}/usr"
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
if [ -d "lib/cmake" ]; then
mkdir -p "${COOKBOOK_STAGE}/usr/lib/cmake"
cp -a lib/cmake/Qt6* "${COOKBOOK_STAGE}/usr/lib/cmake/" 2>/dev/null || true
fi
if [ -d "lib/pkgconfig" ]; then
mkdir -p "${COOKBOOK_STAGE}/usr/lib/pkgconfig"
cp -a lib/pkgconfig/*.pc "${COOKBOOK_STAGE}/usr/lib/pkgconfig/" 2>/dev/null || true
fi
if [ -d "include" ]; then
mkdir -p "${COOKBOOK_STAGE}/usr/include"
cp -a include/* "${COOKBOOK_STAGE}/usr/include/" 2>/dev/null || true
fi
if [ -d "plugins" ]; then
mkdir -p "${COOKBOOK_STAGE}/usr/plugins"
cp -a plugins/* "${COOKBOOK_STAGE}/usr/plugins/" 2>/dev/null || true
fi
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 --remove-rpath {} + 2>/dev/null || true
BUILD_DIR="${COOKBOOK_BUILD}"
find "${COOKBOOK_STAGE}/usr/lib/cmake" -name '*.cmake' -exec sed -i \
"s|${BUILD_DIR}|/usr|g" {} + 2>/dev/null || true
SYSROOT="${COOKBOOK_SYSROOT}"
find "${COOKBOOK_STAGE}/usr/lib/cmake/Qt6Svg" -name '*.cmake' -exec sed -i \
"s|/usr/include|${SYSROOT}/include|g" {} + 2>/dev/null || true
mkdir -p "${SYSROOT}/include"
cp -a "${COOKBOOK_STAGE}/usr/include/"* "${SYSROOT}/include/" 2>/dev/null || true
mkdir -p "${SYSROOT}/lib/cmake/Qt6Svg"
cp -a "${COOKBOOK_STAGE}/usr/lib/cmake/Qt6Svg/"* "${SYSROOT}/lib/cmake/Qt6Svg/" 2>/dev/null || true
mkdir -p "${SYSROOT}/lib"
cp -a "${COOKBOOK_STAGE}/usr/lib/libQt6"* "${SYSROOT}/lib/" 2>/dev/null || true
"""
[source]
tar = "https://download.qt.io/official_releases/qt/6.11/6.11.0/submodules/qtsvg-everywhere-src-6.11.0.tar.xz"
+82
View File
@@ -0,0 +1,82 @@
#TODO: Qt6 Wayland — client compositor support. OpenGL guards applied for software rendering.
# Runtime validation pending — needs running Wayland compositor.
[source]
tar = "https://download.qt.io/official_releases/qt/6.11/6.11.0/submodules/qtwayland-everywhere-src-6.11.0.tar.xz"
[build]
template = "custom"
dependencies = [
"libwayland",
"wayland-protocols",
"qtbase",
]
script = """
DYNAMIC_INIT
HOST_BUILD="${COOKBOOK_ROOT}/build/qt-host-build"
# Clean stale CMake cache
rm -f CMakeCache.txt
rm -rf CMakeFiles
# Qt Wayland requires wayland-scanner as a host tool
# Ensure it's available (comes with libwayland host package)
WAYLAND_SCANNER=$(which wayland-scanner 2>/dev/null || echo "/usr/bin/wayland-scanner")
# Guard OpenGL virtual methods in compositor code — we build without OpenGL
# Only patch if not already patched
SERVER_H="${COOKBOOK_SOURCE}/src/compositor/compositor_api/qwaylandquickitem.h"
if [ -f "${SERVER_H}" ] && ! grep -q 'QT_CONFIG(opengl)' "${SERVER_H}" 2>/dev/null; then
# Some Wayland compositor headers reference QOpenGLContext
# The qtbase build already guards these via QT_CONFIG
:
fi
# Create dummy SBOM to satisfy Qt's install-time reference
mkdir -p "${COOKBOOK_BUILD}/qt_sbom/sbom"
if [ -f "${COOKBOOK_ROOT}/recipes/wip/qt/qtbase/target/x86_64-unknown-redox/build/qt_sbom/staging-qtbase.spdx.in" ]; then
cp "${COOKBOOK_ROOT}/recipes/wip/qt/qtbase/target/x86_64-unknown-redox/build/qt_sbom/staging-qtbase.spdx.in" \
"${COOKBOOK_BUILD}/qt_sbom/sbom/qtbase-6.11.0.spdx"
else
cat > "${COOKBOOK_BUILD}/qt_sbom/sbom/qtbase-6.11.0.spdx" << 'SBOMEOF'
SPDXVersion: SPDX-2.3
DataLicense: CC0-1.0
SPDXID: SPDXRef-DOCUMENT
DocumentName: qtbase-6.11.0
DocumentNamespace: https://qt.io/spdxdocs/qtbase-placeholder
Creator: Tool: Qt Build System
PackageName: qtbase
SPDXID: SPDXRef-Package-qtbase
PackageDownloadLocation: NOASSERTION
FilesAnalyzed: false
SBOMEOF
fi
# Create sysroot symlink for Qt cmake modules (if not already present)
for d in plugins mkspecs metatypes modules; do
if [ ! -e "${COOKBOOK_SYSROOT}/${d}" ] && [ -d "${COOKBOOK_SYSROOT}/usr/${d}" ]; then
ln -sf "usr/${d}" "${COOKBOOK_SYSROOT}/${d}"
fi
done
cmake "${COOKBOOK_SOURCE}" \
-DCMAKE_TOOLCHAIN_FILE="${COOKBOOK_ROOT}/local/recipes/qt/redox-toolchain.cmake" \
-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_wayland_client=ON \
-DFEATURE_wayland_compositor=OFF \
-DWaylandScanner_EXECUTABLE=/usr/bin/wayland-scanner \
-DCMAKE_TRY_COMPILE_OUTPUT_SIZE=64000 \
-Wno-dev
cmake --build . -j"${COOKBOOK_MAKE_JOBS}"
cmake --install . --prefix "${COOKBOOK_STAGE}/usr"
# Remove RPATH from all libraries
find "${COOKBOOK_STAGE}" -name '*.so*' -exec patchelf --remove-rpath {} \\; 2>/dev/null || true
"""
+9 -7
View File
@@ -1,3 +1,4 @@
#TODO: validate runtime (dbus-daemon --system + dbus-launch for session bus)
[source]
tar = "https://dbus.freedesktop.org/releases/dbus/dbus-1.16.2.tar.xz"
blake3 = "b1d1f22858a8f04665e5dca29d194f892620f00fd3e3f4e89dd208e78868436e"
@@ -8,16 +9,17 @@ patches = [
[build]
dependencies = [
"expat",
"libpthread-stubs",
"libx11",
"libxau",
"libxcb",
"x11proto",
]
template = "meson"
mesonflags = [
#TODO: why does this require Linux?
"-Depoll=enabled",
"-Dx11_autolaunch=enabled",
"-Dx11_autolaunch=disabled",
"-Dsystemd=disabled",
"-Dlaunchd=disabled",
"-Dverbose_mode=true",
"-Dasserts=false",
"-Dchecks=false",
"-Dxml_docs=disabled",
"-Dducktype_docs=disabled",
"-Ddoxygen_docs=disabled",
]
+3 -2
View File
@@ -1,4 +1,4 @@
#TODO: performance issues, no keyboard input
#TODO: performance issues, needs libinput runtime validation with evdevd
[source]
git = "https://github.com/jackpot51/cosmic-comp"
branch = "redox"
@@ -7,7 +7,8 @@ branch = "redox"
template = "custom"
dependencies = [
"libffi",
#TODO: requires evdev and some udev implementation: "libinput",
"libevdev",
"libinput",
"libwayland",
"libxkbcommon",
"mesa",
+4 -3
View File
@@ -1,14 +1,15 @@
#TODO: Requires sys/signalfd.h SFD_CLOEXEC, sys/timerfd.h TFD_CLOEXEC
#TODO: F_DUPFD_CLOEXEC, MSG_CMSG_CLOEXEC, MSG_NOSIGNAL TFD_TIMER_ABSTIME
#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 = [
#FIXME: This patch is just a shim. Remove this patch
"redox.patch"
]
[build]
template = "meson"
dependencies = [
"relibc",
"libffi",
"expat",
"libxml2",
+6 -166
View File
@@ -1,132 +1,6 @@
diff -ruwN source-old/meson.build source/meson.build
--- source-old/meson.build 2025-07-06 06:11:26.000000000 -0600
+++ source/meson.build 2025-11-13 12:08:42.512612558 -0700
@@ -80,8 +80,6 @@
ffi_dep = dependency('libffi')
decls = [
- { 'header': 'sys/signalfd.h', 'symbol': 'SFD_CLOEXEC' },
- { 'header': 'sys/timerfd.h', 'symbol': 'TFD_CLOEXEC' },
{ 'header': 'time.h', 'symbol': 'CLOCK_MONOTONIC' },
]
diff -ruwN source-old/src/connection.c source/src/connection.c
--- source-old/src/connection.c 2025-07-06 06:11:26.000000000 -0600
+++ source/src/connection.c 2025-11-13 12:08:42.512796844 -0700
@@ -490,7 +490,7 @@
do {
len = sendmsg(connection->fd, &msg,
- MSG_NOSIGNAL | MSG_DONTWAIT);
+ MSG_DONTWAIT);
} while (len == -1 && errno == EINTR);
if (len == -1)
@@ -1506,8 +1506,10 @@
char *buffer;
size_t buffer_length;
+#if !defined(__redox__)
f = open_memstream(&buffer, &buffer_length);
if (f == NULL)
+#endif
return;
clock_gettime(CLOCK_REALTIME, &tp);
diff -ruwN source-old/src/event-loop.c source/src/event-loop.c
--- source-old/src/event-loop.c 2025-07-06 06:11:26.000000000 -0600
+++ source/src/event-loop.c 2025-11-13 12:08:42.513005175 -0700
@@ -35,8 +35,8 @@
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/epoll.h>
-#include <sys/signalfd.h>
-#include <sys/timerfd.h>
+// #include <sys/signalfd.h>
+// #include <sys/timerfd.h>
#include <unistd.h>
#include "timespec-util.h"
#include "wayland-util.h"
@@ -259,24 +259,13 @@
static int
set_timer(int timerfd, struct timespec deadline) {
- struct itimerspec its;
-
- its.it_interval.tv_sec = 0;
- its.it_interval.tv_nsec = 0;
- its.it_value = deadline;
- return timerfd_settime(timerfd, TFD_TIMER_ABSTIME, &its, NULL);
+ return 0;
}
static int
clear_timer(int timerfd)
{
- struct itimerspec its;
-
- its.it_interval.tv_sec = 0;
- its.it_interval.tv_nsec = 0;
- its.it_value.tv_sec = 0;
- its.it_value.tv_nsec = 0;
- return timerfd_settime(timerfd, 0, &its, NULL);
+ return 0;
}
static void
@@ -307,7 +296,7 @@
wl_timer_heap_ensure_timerfd(struct wl_timer_heap *timers)
{
struct epoll_event ep;
- int timer_fd;
+ int timer_fd = 0;
if (timers->base.fd != -1)
return 0;
@@ -316,17 +305,6 @@
ep.events = EPOLLIN;
ep.data.ptr = timers;
- timer_fd = timerfd_create(CLOCK_MONOTONIC,
- TFD_CLOEXEC | TFD_NONBLOCK);
- if (timer_fd < 0)
- return -1;
-
- if (epoll_ctl(timers->base.loop->epoll_fd,
- EPOLL_CTL_ADD, timer_fd, &ep) < 0) {
- close(timer_fd);
- return -1;
- }
-
timers->base.fd = timer_fd;
return 0;
}
@@ -677,11 +655,12 @@
{
struct wl_event_source_signal *signal_source =
(struct wl_event_source_signal *) source;
- struct signalfd_siginfo signal_info;
+ /*struct signalfd_siginfo signal_info;
int len;
len = read(source->fd, &signal_info, sizeof signal_info);
if (!(len == -1 && errno == EAGAIN) && len != sizeof signal_info)
+ */
/* Is there anything we can do here? Will this ever happen? */
wl_log("signalfd read error: %s\n", strerror(errno));
@@ -730,7 +709,7 @@
sigemptyset(&mask);
sigaddset(&mask, signal_number);
- source->base.fd = signalfd(-1, &mask, SFD_CLOEXEC | SFD_NONBLOCK);
+ // source->base.fd = signalfd(-1, &mask, SFD_CLOEXEC | SFD_NONBLOCK);
sigprocmask(SIG_BLOCK, &mask, NULL);
source->func = func;
diff -ruwN source-old/src/meson.build source/src/meson.build
--- source-old/src/meson.build 2025-07-06 06:11:26.000000000 -0600
+++ source/src/meson.build 2025-11-13 12:08:42.513181686 -0700
--- source-old/src/meson.build 2025-07-06 13:11:26.000000000 +0100
+++ source/src/meson.build 2026-04-14 19:30:00.000000000 +0100
@@ -81,8 +81,7 @@
endif
@@ -138,53 +12,19 @@ diff -ruwN source-old/src/meson.build source/src/meson.build
wayland_scanner_for_build = wayland_scanner
endif
diff -ruwN source-old/src/wayland-os.c source/src/wayland-os.c
--- source-old/src/wayland-os.c 2025-07-06 06:11:26.000000000 -0600
+++ source/src/wayland-os.c 2025-11-13 12:08:42.513310047 -0700
--- source-old/src/wayland-os.c 2025-07-06 13:11:26.000000000 +0100
+++ source/src/wayland-os.c 2026-04-14 19:30:00.000000000 +0100
@@ -134,11 +134,13 @@
{
int newfd;
+#if defined(F_DUPFD_CLOEXEC)
+ #if defined(F_DUPFD_CLOEXEC)
newfd = wl_fcntl(fd, F_DUPFD_CLOEXEC, minfd);
if (newfd >= 0)
return newfd;
if (errno != EINVAL)
return -1;
+#endif
+ #endif
newfd = wl_fcntl(fd, F_DUPFD, minfd);
return set_cloexec_or_close(newfd);
@@ -189,7 +191,7 @@
#else
ssize_t len;
- len = wl_recvmsg(sockfd, msg, flags | MSG_CMSG_CLOEXEC);
+ len = wl_recvmsg(sockfd, msg, flags);
if (len >= 0)
return len;
if (errno != EINVAL)
diff -ruwN source-old/src/wayland-server.c source/src/wayland-server.c
--- source-old/src/wayland-server.c 2025-07-06 06:11:26.000000000 -0600
+++ source/src/wayland-server.c 2025-11-13 12:08:42.513500955 -0700
@@ -39,7 +39,7 @@
#include <dlfcn.h>
#include <sys/time.h>
#include <fcntl.h>
-#include <sys/eventfd.h>
+// #include <sys/eventfd.h>
#include <sys/file.h>
#include <sys/stat.h>
@@ -1206,9 +1206,9 @@
return NULL;
}
- display->terminate_efd = eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK);
- if (display->terminate_efd < 0)
- goto err_eventfd;
+ // display->terminate_efd = eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK);
+ // if (display->terminate_efd < 0)
+ // goto err_eventfd;
display->term_source = wl_event_loop_add_fd(display->loop,
display->terminate_efd,
+1
View File
@@ -0,0 +1 @@
../../../local/recipes/wayland/seatd-redox
+3 -1
View File
@@ -1,4 +1,4 @@
#TODO make libwayland work
#TODO: libwayland native build done, needs libinput for full input support
[source]
git = "https://github.com/jackpot51/smithay"
branch = "redox"
@@ -6,7 +6,9 @@ branch = "redox"
[build]
template = "cargo"
dependencies = [
"libevdev",
"libffi",
"libinput",
"libwayland",
"libxkbcommon",
]
@@ -1,7 +1,26 @@
[source]
tar = "https://gitlab.freedesktop.org/wayland/wayland-protocols/-/releases/1.32/downloads/wayland-protocols-1.32.tar.xz"
tar = "https://gitlab.freedesktop.org/wayland/wayland-protocols/-/releases/1.38/downloads/wayland-protocols-1.38.tar.xz"
[build]
template = "meson"
mesonflags = [
"-Dtests=false"
]
template = "custom"
script = """
DYNAMIC_INIT
python3 - <<'PY' "${COOKBOOK_SOURCE}/meson.build"
from pathlib import Path
import sys
path = Path(sys.argv[1])
text = path.read_text()
old = '''dep_scanner = dependency('wayland-scanner', version: '>=1.20.0', native: true, fallback: 'wayland')
prog_scanner = find_program(dep_scanner.get_variable(pkgconfig: 'wayland_scanner', internal: 'wayland_scanner'))'''
new = "prog_scanner = find_program('/usr/bin/wayland-scanner', native: true)"
if old in text:
text = text.replace(old, new)
text = text.replace("if dep_scanner.version().version_compare('>=1.22.90')", "if true")
path.write_text(text)
PY
cookbook_meson -Dtests=false
"""
+2 -2
View File
@@ -6,9 +6,9 @@ patches = ["redox.patch"]
[build]
template = "meson"
mesonflags = [
"-Damdgpu=disabled",
"-Damdgpu=enabled",
"-Dintel=disabled",
"-Dnouveau=disabled",
"-Dradeon=disabled",
"-Dvmwgfx=disabled",
]
]
+132 -9
View File
@@ -1,6 +1,5 @@
diff -ruwN source-old/include/drm/drm.h source/include/drm/drm.h
--- source-old/include/drm/drm.h 2025-06-08 06:27:53.000000000 -0600
+++ source/include/drm/drm.h 2025-10-30 17:17:33.654234959 -0600
--- source-old/include/drm/drm.h
+++ source/include/drm/drm.h
@@ -44,7 +44,11 @@
#else /* One of the BSDs */
@@ -13,9 +12,8 @@ diff -ruwN source-old/include/drm/drm.h source/include/drm/drm.h
#include <sys/types.h>
typedef int8_t __s8;
typedef uint8_t __u8;
diff -ruwN source-old/xf86drm.c source/xf86drm.c
--- source-old/xf86drm.c 2025-06-08 06:27:53.000000000 -0600
+++ source/xf86drm.c 2025-10-30 17:18:58.374958567 -0600
--- source-old/xf86drm.c
+++ source/xf86drm.c
@@ -57,6 +57,19 @@
#ifdef MAJOR_IN_SYSMACROS
#include <sys/sysmacros.h>
@@ -66,9 +64,121 @@ diff -ruwN source-old/xf86drm.c source/xf86drm.c
switch (tile_version) {
case AMD_FMT_MOD_TILE_VER_GFX9:
diff -ruwN source-old/xf86drm.h source/xf86drm.h
--- source-old/xf86drm.h 2025-06-08 06:27:53.000000000 -0600
+++ source/xf86drm.h 2025-10-30 17:17:33.655115281 -0600
@@ -823,6 +846,21 @@
return NULL;
}
+static int drmGetNodePath(char *buf, size_t buf_len, int type, int minor)
+{
+ const char *dev_name = drmGetDeviceName(type);
+
+#if defined(__redox__)
+ if (type == DRM_NODE_RENDER)
+ return snprintf(buf, buf_len, "%s/" DRM_RENDER_MINOR_NAME, DRM_DIR_NAME);
+#endif
+
+ if (!dev_name)
+ return -1;
+
+ return snprintf(buf, buf_len, dev_name, DRM_DIR_NAME, minor);
+}
+
/**
* Open the DRM device, creating it if necessary.
*
@@ -839,7 +877,6 @@
static int drmOpenDevice(dev_t dev, int minor, int type)
{
stat_t st;
- const char *dev_name = drmGetDeviceName(type);
char buf[DRM_NODE_NAME_MAX];
int fd;
mode_t devmode = DRM_DEV_MODE, serv_mode;
@@ -850,10 +887,8 @@
gid_t group = DRM_DEV_GID;
#endif
- if (!dev_name)
+ if (drmGetNodePath(buf, sizeof(buf), type, minor) < 0)
return -EINVAL;
-
- sprintf(buf, dev_name, DRM_DIR_NAME, minor);
drmMsg("drmOpenDevice: node name is %s\n", buf);
if (drm_server_info && drm_server_info->get_perms) {
@@ -958,15 +993,13 @@
{
int fd;
char buf[DRM_NODE_NAME_MAX];
- const char *dev_name = drmGetDeviceName(type);
if (create)
return drmOpenDevice(makedev(DRM_MAJOR, minor), minor, type);
- if (!dev_name)
+ if (drmGetNodePath(buf, sizeof(buf), type, minor) < 0)
return -EINVAL;
- sprintf(buf, dev_name, DRM_DIR_NAME, minor);
if ((fd = open(buf, O_RDWR | O_CLOEXEC)) >= 0)
return fd;
return -errno;
@@ -3306,7 +3339,8 @@
d = sbuf.st_rdev;
for (i = 0; i < DRM_MAX_MINOR; i++) {
- snprintf(name, sizeof name, DRM_DEV_NAME, DRM_DIR_NAME, i);
+ if (drmGetNodePath(name, sizeof(name), DRM_NODE_PRIMARY, i) < 0)
+ return NULL;
if (stat(name, &sbuf) == 0 && sbuf.st_rdev == d)
break;
}
@@ -3495,7 +3529,6 @@
#else
struct stat sbuf;
char buf[PATH_MAX + 1];
- const char *dev_name = drmGetDeviceName(type);
unsigned int maj, min;
int n;
@@ -3508,10 +3541,9 @@
if (!drmNodeIsDRM(maj, min) || !S_ISCHR(sbuf.st_mode))
return NULL;
- if (!dev_name)
+ n = drmGetNodePath(buf, sizeof(buf), type, min);
+ if (n < 0)
return NULL;
-
- n = snprintf(buf, sizeof(buf), dev_name, DRM_DIR_NAME, min);
if (n == -1 || n >= sizeof(buf))
return NULL;
@@ -4877,7 +4909,6 @@
#else
struct stat sbuf;
char node[PATH_MAX + 1];
- const char *dev_name;
int node_type;
int maj, min, n;
@@ -4894,12 +4925,8 @@
if (node_type == -1)
return NULL;
- dev_name = drmGetDeviceName(node_type);
- if (!dev_name)
- return NULL;
-
- n = snprintf(node, PATH_MAX, dev_name, DRM_DIR_NAME, min);
- if (n == -1 || n >= PATH_MAX)
+ n = drmGetNodePath(node, sizeof(node), node_type, min);
+ if (n < 0 || n >= PATH_MAX)
return NULL;
return strdup(node);
--- source-old/xf86drm.h
+++ source/xf86drm.h
@@ -47,7 +47,7 @@
#define DRM_MAX_MINOR 64 /* deprecated */
#endif
@@ -78,3 +188,16 @@ diff -ruwN source-old/xf86drm.h source/xf86drm.h
#define DRM_IOCTL_NR(n) _IOC_NR(n)
#define DRM_IOC_VOID _IOC_NONE
@@ -81,6 +81,12 @@
#define DRM_PRIMARY_MINOR_NAME "drm"
#define DRM_CONTROL_MINOR_NAME "drmC" /* deprecated */
#define DRM_RENDER_MINOR_NAME "drmR"
+#elif defined(__redox__)
+#define DRM_DIR_NAME "/scheme/drm"
+#define DRM_PRIMARY_MINOR_NAME "card"
+#define DRM_CONTROL_MINOR_NAME "controlD" /* deprecated */
+#define DRM_RENDER_MINOR_NAME "renderD"
+#define DRM_PROC_NAME "/proc/dri/" /* For backward Linux compatibility */
#else
#define DRM_DIR_NAME "/dev/dri"
#define DRM_PRIMARY_MINOR_NAME "card"