Files
RedBear-OS/recipes/shells/zsh/recipe.toml
T
vasilito 04badb070e Fix zsh cross-compilation: --srcdir flag + awk permissions
Added --srcdir="${COOKBOOK_SOURCE}" to zsh configure flags to fix
the config.status error '/subs1.awk: Permission denied' during
cross-compilation. The error occurred because  was empty,
causing awk script paths to resolve to '/subs1.awk' instead of
the correct source directory path.

Also added chmod +x on Src/*.awk to ensure configure-generated
config.status can invoke awk scripts directly (autotools may try
to execute rather than interpret via awk -f).

This unblocks Phase 2.1 end-to-end build test.
2026-07-09 00:49:15 +03:00

48 lines
1.6 KiB
TOML

[source]
tar = "https://github.com/zsh-users/zsh/archive/refs/tags/zsh-5.9.tar.gz"
blake3 = "a15b94fae03e87aba6fc6a27df3c98e610b85b0c7c0fc90248f07fdcb8816860"
patches = [
"redox.patch"
]
script = """
DYNAMIC_INIT
autotools_recursive_regenerate
"""
[build]
template = "custom"
dependencies = [
"ncursesw",
]
script = """
DYNAMIC_INIT
COOKBOOK_CONFIGURE_FLAGS+=(
--srcdir="${COOKBOOK_SOURCE}"
--disable-gdbm
--disable-pcre
--disable-cap
zsh_cv_sys_elf=no
)
"${COOKBOOK_CONFIGURE}" "${COOKBOOK_CONFIGURE_FLAGS[@]}"
# Ensure awk scripts are executable (cross-compilation fix for
# config.status which tries to invoke awk scripts directly).
chmod +x "${COOKBOOK_SOURCE}"/Src/*.awk 2>/dev/null || true
# Pre-generate signames artifacts deterministically for Redox cross builds.
gawk -f "${COOKBOOK_SOURCE}/Src/signames1.awk" "${COOKBOOK_ROOT}/prefix/${TARGET}/sysroot/${TARGET}/include/signal.h" > "${COOKBOOK_BUILD}/Src/sigtmp.c"
"${COOKBOOK_ROOT}/bin/${TARGET}-gcc" -E -P "${COOKBOOK_BUILD}/Src/sigtmp.c" > "${COOKBOOK_BUILD}/Src/sigtmp.out"
gawk -f "${COOKBOOK_SOURCE}/Src/signames2.awk" "${COOKBOOK_BUILD}/Src/sigtmp.out" > "${COOKBOOK_BUILD}/Src/signames.c"
grep 'define.*SIGCOUNT' "${COOKBOOK_BUILD}/Src/signames.c" > "${COOKBOOK_BUILD}/Src/sigcount.h"
rm -f "${COOKBOOK_BUILD}/Src/sigtmp.c" "${COOKBOOK_BUILD}/Src/sigtmp.out"
"${COOKBOOK_MAKE}" -j "${COOKBOOK_MAKE_JOBS}"
"${COOKBOOK_MAKE}" install.bin install.modules install.fns DESTDIR="${COOKBOOK_STAGE}"
# Install system-wide zsh configuration files
mkdir -pv "${COOKBOOK_STAGE}/etc"
cp -r "${COOKBOOK_RECIPE}/etc/"* "${COOKBOOK_STAGE}/etc/"
"""