28b9621f17
uutils-tar (WIP recipe): - Pin to commit 8ecd8e0 (rust-version 1.85.0, compatible with our nightly-2025-10-03 toolchain) - Fix nix-0.30.1 Redox bug: SaFlags_t declared as c_ulong but libc-0.2.184 defines SA_*/sa_flags as c_int. Patch SaFlags_t to c_int. - Enable nix pty module for Redox (relibc has all POSIX PTY functions) - Add forkpty to libc-0.2.184 Redox module (relibc's pty.h defines it but libc crate doesn't expose it) ncurses: - Remove obsolete first hunk from redox.patch (cf_includedir lines already removed in ncurses-6.6). Keep second hunk (redox* platform detection).
46 lines
1.7 KiB
TOML
46 lines
1.7 KiB
TOML
#TODO not compiled or tested
|
|
[source]
|
|
git = "https://github.com/uutils/tar"
|
|
rev = "8ecd8e0bfde251de26df450efcec2da45135af9c"
|
|
[build]
|
|
template = "custom"
|
|
script = """
|
|
DYNAMIC_INIT
|
|
|
|
# nix-0.30.1 has three Redox bugs:
|
|
# 1. SaFlags_t is c_ulong (u64) but libc-0.2.184 defines SA_* and sa_flags
|
|
# as c_int (i32). Fix: change SaFlags_t to c_int for Redox.
|
|
# 2. The pty module is excluded for Redox (cfg(not(any(redox, fuchsia)))),
|
|
# but relibc now has all POSIX PTY functions. Fix: remove Redox exclusion.
|
|
# 3. libc-0.2.184 doesn't expose forkpty for Redox, but relibc's pty.h
|
|
# defines it. Fix: add forkpty declaration to libc Redox module.
|
|
for nix_src in /home/kellito/.cargo/registry/src/*/nix-0.30.1; do
|
|
if [ -f "$nix_src/src/sys/signal.rs" ]; then
|
|
# Fix 1: SaFlags_t type mismatch
|
|
sed -i 's/type SaFlags_t = libc::c_ulong;/type SaFlags_t = libc::c_int;/' \
|
|
"$nix_src/src/sys/signal.rs"
|
|
fi
|
|
if [ -f "$nix_src/src/lib.rs" ]; then
|
|
# Fix 2: Enable pty module for Redox
|
|
sed -i 's/#\\[cfg(not(any(target_os = "redox", target_os = "fuchsia")))\\]/#[cfg(not(target_os = "fuchsia"))]/' \
|
|
"$nix_src/src/lib.rs"
|
|
fi
|
|
done
|
|
|
|
# Fix 3: Add forkpty to libc Redox module (relibc's pty.h defines it)
|
|
for libc_src in /home/kellito/.cargo/registry/src/*/libc-0.2.184; do
|
|
if [ -f "$libc_src/src/unix/redox/mod.rs" ] && ! grep -q 'pub fn forkpty' "$libc_src/src/unix/redox/mod.rs"; then
|
|
sed -i '/pub fn login_tty(fd: c_int) -> c_int;/a\\
|
|
pub fn forkpty(\\
|
|
amaster: *mut c_int,\\
|
|
name: *mut c_char,\\
|
|
termp: *const termios,\\
|
|
winp: *const crate::winsize,\\
|
|
) -> c_int;' \
|
|
"$libc_src/src/unix/redox/mod.rs"
|
|
fi
|
|
done
|
|
|
|
cookbook_cargo
|
|
"""
|