From 48eff2e7ac0da2c56dc1f51200df69092597be42 Mon Sep 17 00:00:00 2001 From: Wildan Mubarok Date: Tue, 5 Aug 2025 21:15:50 +0000 Subject: [PATCH] Add zsh to WIP recipe --- recipes/wip/shells/zsh/01_redox.patch | 54 +++++++++++++++++++++++++++ recipes/wip/shells/zsh/recipe.toml | 24 ++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 recipes/wip/shells/zsh/01_redox.patch create mode 100644 recipes/wip/shells/zsh/recipe.toml diff --git a/recipes/wip/shells/zsh/01_redox.patch b/recipes/wip/shells/zsh/01_redox.patch new file mode 100644 index 000000000..c1f230a9e --- /dev/null +++ b/recipes/wip/shells/zsh/01_redox.patch @@ -0,0 +1,54 @@ +diff --color -ruwN source/configure.ac source-new/configure.ac +--- source/configure.ac 2022-05-15 01:59:21.000000000 +0700 ++++ source-new/configure.ac 2025-08-06 02:08:48.797381523 +0700 +@@ -1311,7 +1311,7 @@ + setuid seteuid setreuid setresuid setsid \ + setgid setegid setregid setresgid \ + memcpy memmove strstr strerror strtoul \ +- getrlimit getrusage \ ++ getrusage \ + setlocale \ + isblank iswblank \ + uname \ +diff --color -ruwN source/Src/builtin.c source-new/Src/builtin.c +--- source/Src/builtin.c 2022-05-15 01:59:21.000000000 +0700 ++++ source-new/Src/builtin.c 2025-08-06 02:41:57.266846385 +0700 +@@ -7160,16 +7160,7 @@ + long clktck = get_clktck(); + + /* get time accounting information */ +- if (times(&buf) == -1) +- return 1; +- pttime(buf.tms_utime); /* user time */ +- putchar(' '); +- pttime(buf.tms_stime); /* system time */ +- putchar('\n'); +- pttime(buf.tms_cutime); /* user time, children */ +- putchar(' '); +- pttime(buf.tms_cstime); /* system time, children */ +- putchar('\n'); ++ // Somehow times() is not linking correctly + return 0; + } + +diff --color -ruwN source/Src/Builtins/rlimits.c source-new/Src/Builtins/rlimits.c +--- source/Src/Builtins/rlimits.c 2022-05-15 01:59:21.000000000 +0700 ++++ source-new/Src/Builtins/rlimits.c 2025-08-06 02:24:09.457135439 +0700 +@@ -892,7 +892,7 @@ + int + boot_(UNUSED(Module m)) + { +- set_resinfo(); ++// set_resinfo(); + return 0; + } + +@@ -900,7 +900,7 @@ + int + cleanup_(Module m) + { +- free_resinfo(); ++// free_resinfo(); + return setfeatureenables(m, &module_features, NULL); + } + diff --git a/recipes/wip/shells/zsh/recipe.toml b/recipes/wip/shells/zsh/recipe.toml new file mode 100644 index 000000000..572f979a4 --- /dev/null +++ b/recipes/wip/shells/zsh/recipe.toml @@ -0,0 +1,24 @@ +#TODO: Buggy, can't return after running commands +[source] +tar = "https://github.com/zsh-users/zsh/archive/refs/tags/zsh-5.9.tar.gz" +blake3 = "a15b94fae03e87aba6fc6a27df3c98e610b85b0c7c0fc90248f07fdcb8816860" +patches = [ + "01_redox.patch" +] +script = """ +DYNAMIC_INIT +autotools_recursive_regenerate +""" + +[build] +template = "custom" +dependencies = [ + "ncursesw", +] +script = """ +DYNAMIC_INIT + +"${COOKBOOK_CONFIGURE}" "${COOKBOOK_CONFIGURE_FLAGS[@]}" +"${COOKBOOK_MAKE}" -j "${COOKBOOK_MAKE_JOBS}" +"${COOKBOOK_MAKE}" install.bin install.modules install.fns DESTDIR="${COOKBOOK_STAGE}" +"""