diff --git a/recipes/net/openssh/recipe.toml b/recipes/net/openssh/recipe.toml index a348a732..06706cd7 100644 --- a/recipes/net/openssh/recipe.toml +++ b/recipes/net/openssh/recipe.toml @@ -1,4 +1,4 @@ -#TODO lack of resolv.h, expect dns not working +#TODO resolver runtime on Redox still needs stronger validation; relibc now exports resolv.h/nameser surfaces #TODO lack of utmpx.h, expect no way to track login in sshd [source] tar = "https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.8p1.tar.gz" @@ -14,6 +14,15 @@ dependencies = [ ] script = """ DYNAMIC_INIT +RELIBC_STAGE_INCLUDE="${COOKBOOK_ROOT}/recipes/core/relibc/target/${TARGET}/stage/usr/include" +RELIBC_STAGE_LIB="${COOKBOOK_ROOT}/recipes/core/relibc/target/${TARGET}/stage/usr/lib" +if [ -d "${RELIBC_STAGE_INCLUDE}" ]; then + export CPPFLAGS="${CPPFLAGS} -I${RELIBC_STAGE_INCLUDE}" + export CFLAGS="${CFLAGS} -I${RELIBC_STAGE_INCLUDE}" +fi +if [ -d "${RELIBC_STAGE_LIB}" ]; then + export LDFLAGS="-L${RELIBC_STAGE_LIB} -Wl,-rpath-link,${RELIBC_STAGE_LIB} ${LDFLAGS}" +fi COOKBOOK_CONFIGURE_FLAGS+=( --disable-strip --sysconfdir=/etc/ssh diff --git a/recipes/net/openssh/redox.patch b/recipes/net/openssh/redox.patch index a061b173..8b34b0ad 100644 --- a/recipes/net/openssh/redox.patch +++ b/recipes/net/openssh/redox.patch @@ -70,9 +70,9 @@ diff -ruwN source/hostfile.c source-new/hostfile.c #include #include -+#ifndef __redox__ ++/* Redox now has relibc resolv.h support. */ ++/* Keep this hunk explicit for downstream patch clarity. */ #include -+#endif #include #include #include @@ -165,131 +165,53 @@ diff -ruwN source/openbsd-compat/bsd-statvfs.h source-new/openbsd-compat/bsd-sta diff -ruwN source/openbsd-compat/getrrsetbyname.c source-new/openbsd-compat/getrrsetbyname.c --- source/openbsd-compat/getrrsetbyname.c 2024-07-01 11:36:28.000000000 +0700 +++ source-new/openbsd-compat/getrrsetbyname.c 2025-09-06 21:09:36.556438304 +0700 -@@ -67,6 +67,52 @@ - #endif - #define _THREAD_PRIVATE(a,b,c) (c) - -+#ifdef __redox__ -+ -+#include -+#include -+ -+/* -+ * Minimalist replacement for for systems that lack it, -+ * such as Redox OS. This provides the basic structures needed by -+ * the OpenSSH compatibility layer. -+ */ -+ -+// Define necessary constants -+#define MAXNS 3 /* max # name servers we'll track */ -+#define MAXDNSRCH 6 /* max # domains in search path */ -+#define MAXRESOLVSORT 10 /* number of nets to sort on */ -+#define MAXDNAME 256 /* max length of a domain name */ -+ -+/* -+ * A simplified, portable version of the resolver state structure. -+ * Glibc-specific fields, hooks, and complex unions have been removed. -+ */ -+struct __res_state { -+ int retrans; /* retransmission time interval */ -+ int retry; /* number of times to retransmit */ -+ unsigned long options; /* option flags */ -+ int nscount; /* number of name servers */ -+ struct sockaddr_in nsaddr_list[MAXNS]; /* address of name servers */ -+ unsigned short id; /* current message id */ -+ char *dnsrch[MAXDNSRCH + 1]; /* components of domain to search */ -+ char defdname[MAXDNAME]; /* default domain name */ -+ -+ struct { -+ struct in_addr addr; -+ uint32_t mask; -+ } sort_list[MAXRESOLVSORT]; -+ -+ int res_h_errno; /* last error code for this context */ -+ -+ // Simplified bitfields, removing glibc internals -+ unsigned ndots : 4; /* threshold for initial abs. query */ -+ unsigned nsort : 4; /* number of elements in sort_list[] */ -+}; -+ -+typedef struct __res_state *res_state; -+#endif /* __redox */ -+ - #ifndef HAVE__RES_EXTERN - struct __res_state _res; - #endif -@@ -167,6 +213,24 @@ - struct dns_rr *next; - }; - -+#ifdef __redox__ -+typedef struct { -+ uint16_t id; -+ uint8_t rd : 1; -+ uint8_t tc : 1; -+ uint8_t aa : 1; -+ uint8_t opcode : 4; -+ uint8_t qr : 1; -+ uint8_t rcode : 4; -+ uint8_t z : 3; -+ uint8_t ra : 1; -+ uint16_t qdcount; -+ uint16_t ancount; -+ uint16_t nscount; -+ uint16_t arcount; -+} HEADER; -+#endif -+ - struct dns_response { - HEADER header; - struct dns_query *query; -@@ -221,10 +285,10 @@ - } - - /* initialize resolver */ +@@ -221,10 +221,10 @@ + } + + /* initialize resolver */ - if ((_resp->options & RES_INIT) == 0 && res_init() == -1) { -+ // if (res_init() == -1) { - result = ERRSET_FAIL; - goto fail; ++ if ((_resp->options & RES_INIT) == 0 && res_init() == -1) { + result = ERRSET_FAIL; + goto fail; - } -+ // } - ++ } + #ifdef DEBUG - _resp->options |= RES_DEBUG; -@@ -482,12 +546,12 @@ - prev->next = curr; - - /* name */ + _resp->options |= RES_DEBUG; +@@ -482,12 +482,12 @@ + prev->next = curr; + + /* name */ - length = dn_expand(answer, answer + size, *cp, name, - sizeof(name)); - if (length < 0) { -+ // length = dn_expand(answer, answer + size, *cp, name, -+ // sizeof(name)); -+ // if (length < 0) { - free_dns_query(head); - return (NULL); ++ length = dn_expand(answer, answer + size, *cp, name, ++ sizeof(name)); ++ if (length < 0) { + free_dns_query(head); + return (NULL); - } -+ // } - curr->name = strdup(name); - if (curr->name == NULL) { - free_dns_query(head); -@@ -542,12 +606,12 @@ - prev->next = curr; - - /* name */ ++ } + curr->name = strdup(name); + if (curr->name == NULL) { + free_dns_query(head); +@@ -542,12 +542,12 @@ + prev->next = curr; + + /* name */ - length = dn_expand(answer, answer + size, *cp, name, - sizeof(name)); - if (length < 0) { -+ // length = dn_expand(answer, answer + size, *cp, name, -+ // sizeof(name)); -+ // if (length < 0) { - free_dns_rr(head); - return (NULL); ++ length = dn_expand(answer, answer + size, *cp, name, ++ sizeof(name)); ++ if (length < 0) { + free_dns_rr(head); + return (NULL); - } -+ // } - curr->name = strdup(name); - if (curr->name == NULL) { - free_dns_rr(head); ++ } + curr->name = strdup(name); + if (curr->name == NULL) { + free_dns_rr(head); diff -ruwN source/openbsd-compat/getrrsetbyname.h source-new/openbsd-compat/getrrsetbyname.h --- source/openbsd-compat/getrrsetbyname.h 2024-07-01 11:36:28.000000000 +0700 +++ source-new/openbsd-compat/getrrsetbyname.h 2025-09-06 21:09:36.557438268 +0700 @@ -297,13 +219,13 @@ diff -ruwN source/openbsd-compat/getrrsetbyname.h source-new/openbsd-compat/getr #include #include -+#ifndef __redox__ ++/* Redox now has relibc arpa/nameser.h support. */ ++/* Keep this include active instead of patch-local fallbacks. */ #include -+#endif #include -+#ifndef __redox__ ++/* Redox now has relibc resolv.h support. */ ++/* Keep this include active instead of patch-local fallbacks. */ #include -+#endif #ifndef HFIXEDSZ #define HFIXEDSZ 12 @@ -314,9 +236,9 @@ diff -ruwN source/openbsd-compat/inet_ntop.c source-new/openbsd-compat/inet_ntop #include #include #include -+#ifndef __redox__ ++/* Redox now has relibc arpa/nameser.h support. */ ++/* Keep this include active. */ #include -+#endif #include #include #include @@ -453,9 +375,9 @@ diff -ruwN source/regress/netcat.c source-new/regress/netcat.c #include #include #include -+#ifndef __redox__ ++/* Redox now has relibc resolv.h support. */ ++/* Keep this include active. */ #include -+#endif #define SOCKS_PORT "1080" #define HTTP_PROXY_PORT "3128" @@ -498,9 +420,9 @@ diff -ruwN source/sshbuf-misc.c source-new/sshbuf-misc.c #include #include #include -+#ifndef __redox__ ++/* Redox now has relibc resolv.h support. */ ++/* Keep this include active. */ #include -+#endif #include #include @@ -614,9 +536,9 @@ diff -ruwN source/sshkey.c source-new/sshkey.c #include #include #include -+#ifndef __redox__ ++/* Redox now has relibc resolv.h support. */ ++/* Keep this include active. */ #include -+#endif #include #ifdef HAVE_UTIL_H #include diff --git a/recipes/shells/bash/recipe.toml b/recipes/shells/bash/recipe.toml index e15d4e52..307583c4 100644 --- a/recipes/shells/bash/recipe.toml +++ b/recipes/shells/bash/recipe.toml @@ -28,3 +28,11 @@ cookbook_configure ln -s "bash" "${COOKBOOK_STAGE}/usr/bin/sh" cp -r "${COOKBOOK_RECIPE}/etc" "${COOKBOOK_STAGE}/etc" """ + +[package] +name = "bash" + +[package.files] +"/usr/bin/bash" = "bash" +"/usr/bin/sh" = "sh" +"/usr/bin/bashbug" = "bashbug" diff --git a/recipes/wip/AGENTS.md b/recipes/wip/AGENTS.md index 0cf1fd02..4e835a59 100644 --- a/recipes/wip/AGENTS.md +++ b/recipes/wip/AGENTS.md @@ -2,6 +2,34 @@ Experimental ports not yet ready for production. Wayland, KDE, GNOME, and driver WIP. +## OWNERSHIP RULE FOR UPSTREAM WIP + +In Red Bear OS, an upstream recipe or subsystem being marked **WIP** changes how we treat it. + +### What WIP means for Red Bear + +If an upstream recipe, package group, or subsystem is still WIP: + +1. Red Bear treats that area as a **local project** rather than a first-class upstream dependency +2. we may study, import, and refresh from the upstream WIP recipe +3. but the version we fix, validate, and ship should live in the Red Bear overlay (`local/recipes/`, + `local/patches/`, `local/docs/`), not in trust of the upstream WIP tree alone + +### What happens when upstream promotes it + +If upstream later removes the WIP status and the recipe becomes a first-class supported Redox +package, Red Bear should reevaluate immediately: + +- prefer the upstream recipe where it now solves the same problem adequately +- reduce or remove the local Red Bear copy/patches if they are no longer needed +- keep only the Red Bear-specific integration delta that upstream still does not solve + +### Practical implication + +`recipes/wip/` is therefore not “safe upstream ownership” for Red Bear shipping decisions. For this +project, upstream WIP is a **source of inputs and ideas**, but stable Red Bear delivery should come +from the local overlay until upstream promotes that work. + ## STRUCTURE ``` @@ -66,3 +94,5 @@ recipes/wip/ - BLAKE3 hashes optional for WIP - Test with `make r.` before adding to config - When ready: move from `wip/` to appropriate category, add BLAKE3 hash +- If Red Bear depends on a WIP subsystem long-term, prefer moving the maintained shipping version + under `local/recipes/` and documenting the delta in `local/docs/` diff --git a/recipes/wip/icons/breeze-icons/recipe.toml b/recipes/wip/icons/breeze-icons/recipe.toml index 2c1b4d96..340fce27 100644 --- a/recipes/wip/icons/breeze-icons/recipe.toml +++ b/recipes/wip/icons/breeze-icons/recipe.toml @@ -2,5 +2,14 @@ # lacking build instructions [source] tar = "https://download.kde.org/stable/frameworks/5.112/breeze-icons-5.112.0.tar.xz" + [build] -template = "cmake" +template = "custom" +dependencies = [ + "kf6-extra-cmake-modules", +] +script = """ +DYNAMIC_INIT +COOKBOOK_CMAKE_FLAGS+=("-DKF_IGNORE_PLATFORM_CHECK=ON") +cookbook_cmake +""" diff --git a/recipes/wip/wayland/libwayland/redox.patch b/recipes/wip/wayland/libwayland/redox.patch index 99d99401..c51c1b0b 100644 --- a/recipes/wip/wayland/libwayland/redox.patch +++ b/recipes/wip/wayland/libwayland/redox.patch @@ -9,22 +9,5 @@ diff -ruwN source-old/src/meson.build source/src/meson.build - wayland_scanner_for_build = find_program(scanner_dep.get_variable(pkgconfig: 'wayland_scanner')) + wayland_scanner_for_build = find_program('wayland-scanner', native: true) else - wayland_scanner_for_build = wayland_scanner + 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 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) - newfd = wl_fcntl(fd, F_DUPFD_CLOEXEC, minfd); - if (newfd >= 0) - return newfd; - if (errno != EINVAL) - return -1; -+ #endif - - newfd = wl_fcntl(fd, F_DUPFD, minfd); - return set_cloexec_or_close(newfd);