From c80df6a9e54bc3d43b7e1e9371407ca241e4b872 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Thu, 9 Apr 2026 06:40:49 +0700 Subject: [PATCH 1/4] Fix ncurses compilation due to wchar_t --- recipes/libs/ncurses/recipe.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/libs/ncurses/recipe.toml b/recipes/libs/ncurses/recipe.toml index a3c7802e0..c4135c609 100644 --- a/recipes/libs/ncurses/recipe.toml +++ b/recipes/libs/ncurses/recipe.toml @@ -12,10 +12,11 @@ DYNAMIC_INIT COOKBOOK_CONFIGURE_FLAGS+=( --disable-db-install --disable-stripping + --disable-widec + --enable-pc-files --without-ada --without-manpages --without-tests - --enable-pc-files --with-terminfo-dirs=/usr/share/terminfo --with-pkg-config-libdir=/usr/lib/pkgconfig cf_cv_func_mkstemp=yes From 95386660d47d4f130717b09d9f869263ce306bfd Mon Sep 17 00:00:00 2001 From: Wildan M Date: Thu, 9 Apr 2026 07:22:12 +0700 Subject: [PATCH 2/4] Use ncursesw for xterm --- recipes/wip/x11/xterm/recipe.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/wip/x11/xterm/recipe.toml b/recipes/wip/x11/xterm/recipe.toml index 81f46a81b..f0bc4c612 100644 --- a/recipes/wip/x11/xterm/recipe.toml +++ b/recipes/wip/x11/xterm/recipe.toml @@ -22,7 +22,7 @@ dependencies = [ "libxpm", "libxrender", "libxt", - "ncurses", + "ncursesw", "pcre2", "x11proto", "zlib", From ed2f8dd667278ac92631f1e28b800ffc4fe4dc9e Mon Sep 17 00:00:00 2001 From: Wildan M Date: Thu, 9 Apr 2026 07:23:13 +0700 Subject: [PATCH 3/4] Port tmux --- config/x86_64/ci.toml | 1 + recipes/wip/terminal/tmux/recipe.toml | 10 ++- recipes/wip/terminal/tmux/redox.patch | 95 +++++++++++++++++++++++++++ 3 files changed, 103 insertions(+), 3 deletions(-) create mode 100644 recipes/wip/terminal/tmux/redox.patch diff --git a/config/x86_64/ci.toml b/config/x86_64/ci.toml index 9efd63039..23ce90a6f 100644 --- a/config/x86_64/ci.toml +++ b/config/x86_64/ci.toml @@ -206,6 +206,7 @@ strace = {} syobonaction = {} terminfo = {} timidity = {} +tmux = {} tokei = {} ttf-hack = {} userutils = {} diff --git a/recipes/wip/terminal/tmux/recipe.toml b/recipes/wip/terminal/tmux/recipe.toml index 6a95203b6..922d84624 100644 --- a/recipes/wip/terminal/tmux/recipe.toml +++ b/recipes/wip/terminal/tmux/recipe.toml @@ -1,10 +1,14 @@ -#TODO not compiled or tested +#TODO Promote [source] -tar = "https://github.com/tmux/tmux/releases/download/3.4/tmux-3.4.tar.gz" +tar = "https://github.com/tmux/tmux/releases/download/3.6a/tmux-3.6a.tar.gz" +blake3 = "43a9a5fd4ebe403efccd666c7b620fcf65489b123092df70113466a2b5aedb5a" +patches = [ + "redox.patch" +] [build] template = "custom" dependencies = [ - "ncurses", + "ncursesw", "libevent", ] script = """ diff --git a/recipes/wip/terminal/tmux/redox.patch b/recipes/wip/terminal/tmux/redox.patch new file mode 100644 index 000000000..169e6b8e0 --- /dev/null +++ b/recipes/wip/terminal/tmux/redox.patch @@ -0,0 +1,95 @@ +diff --color -ruwN source/compat/base64.c source-new/compat/base64.c +--- source/compat/base64.c 2022-04-25 15:25:13.000000000 +0700 ++++ source-new/compat/base64.c 2026-04-09 07:15:37.515384719 +0700 +@@ -46,10 +46,10 @@ + #include + #include + #include +-#include ++// #include + + #include +-#include ++// #include + #include + + #include +diff --color -ruwN source/compat/reallocarray.c source-new/compat/reallocarray.c +--- source/compat/reallocarray.c 2022-04-25 15:25:13.000000000 +0700 ++++ source-new/compat/reallocarray.c 2026-04-09 07:15:37.515516254 +0700 +@@ -22,6 +22,7 @@ + + #include "compat.h" + ++#ifndef __redox__ + /* + * This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX + * if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW +@@ -38,3 +39,4 @@ + } + return realloc(optr, size * nmemb); + } ++#endif +diff --color -ruwN source/input.c source-new/input.c +--- source/input.c 2025-12-05 12:37:44.000000000 +0700 ++++ source-new/input.c 2026-04-09 07:15:37.515731613 +0700 +@@ -21,7 +21,7 @@ + #include + + #include +-#include ++// #include + #include + #include + #include +diff --color -ruwN source/tmux.c source-new/tmux.c +--- source/tmux.c 2025-10-29 15:49:16.000000000 +0700 ++++ source-new/tmux.c 2026-04-09 07:17:30.947212475 +0700 +@@ -222,10 +222,13 @@ + xasprintf(cause, "%s is not a directory", base); + goto fail; + } ++// FIXME: mkdir set wrong permission ++#ifndef __redox__ + if (sb.st_uid != uid || (sb.st_mode & TMUX_SOCK_PERM) != 0) { + xasprintf(cause, "directory %s has unsafe permissions", base); + goto fail; + } ++#endif + xasprintf(&path, "%s/%s", base, label); + free(base); + return (path); +diff --color -ruwN source/tty.c source-new/tty.c +--- source/tty.c 2025-12-05 12:37:44.000000000 +0700 ++++ source-new/tty.c 2026-04-09 07:15:37.516745754 +0700 +@@ -24,7 +24,7 @@ + #include + #include + #include +-#include ++// #include + #include + #include + #include +@@ -347,8 +347,7 @@ + tio.c_iflag &= ~(IXON|IXOFF|ICRNL|INLCR|IGNCR|IMAXBEL|ISTRIP); + tio.c_iflag |= IGNBRK; + tio.c_oflag &= ~(OPOST|ONLCR|OCRNL|ONLRET); +- tio.c_lflag &= ~(IEXTEN|ICANON|ECHO|ECHOE|ECHONL|ECHOCTL|ECHOPRT| +- ECHOKE|ISIG); ++ tio.c_lflag &= ~(IEXTEN|ICANON|ECHO|ECHOE|ECHONL|ECHOPRT|ISIG); + tio.c_cc[VMIN] = 1; + tio.c_cc[VTIME] = 0; + if (tcsetattr(c->fd, TCSANOW, &tio) == 0) +diff --color -ruwN source/tty-keys.c source-new/tty-keys.c +--- source/tty-keys.c 2025-12-05 12:37:44.000000000 +0700 ++++ source-new/tty-keys.c 2026-04-09 07:15:37.516964363 +0700 +@@ -23,7 +23,7 @@ + + #include + #include +-#include ++// #include + #include + #include + #include From 1737337beb41c2e5d13fd793f74cc9803dda7e23 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Thu, 9 Apr 2026 07:57:48 +0700 Subject: [PATCH 4/4] Use template for tmux --- recipes/wip/terminal/tmux/recipe.toml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/recipes/wip/terminal/tmux/recipe.toml b/recipes/wip/terminal/tmux/recipe.toml index 922d84624..04af36e33 100644 --- a/recipes/wip/terminal/tmux/recipe.toml +++ b/recipes/wip/terminal/tmux/recipe.toml @@ -1,4 +1,4 @@ -#TODO Promote +#TODO can't exit from terminal, can't clean socket itself [source] tar = "https://github.com/tmux/tmux/releases/download/3.6a/tmux-3.6a.tar.gz" blake3 = "43a9a5fd4ebe403efccd666c7b620fcf65489b123092df70113466a2b5aedb5a" @@ -6,12 +6,8 @@ patches = [ "redox.patch" ] [build] -template = "custom" +template = "configure" dependencies = [ "ncursesw", "libevent", ] -script = """ -export CPPFLAGS="-I${COOKBOOK_SYSROOT}/include/ncurses" -cookbook_configure -"""