Merge branch 'master' of https://gitlab.redox-os.org/redox-os/cookbook into neovim-deps

This commit is contained in:
Wildan M 2025-09-16 11:18:17 +07:00
commit e6874461fe
36 changed files with 625 additions and 88 deletions

View File

@ -5,14 +5,14 @@ source config.sh
if [ $# = 0 ]
then
recipes="$(target/release/list_recipes --short)"
recipes="$(list_recipes --short)"
else
recipes="$@"
fi
for recipe_name in $recipes
do
recipe_path=`target/release/find_recipe $recipe_name`
recipe_path=`find_recipe $recipe_name`
echo -e "\033[01;38;5;215mcook - clean $recipe_name\033[0m"
rm -rf "${ROOT}/$recipe_path/target/${TARGET}"

View File

@ -6,6 +6,11 @@ if [ -z "${TARGET}" ]
then
export TARGET=x86_64-unknown-redox
fi
if [ $(uname -s) = 'Redox' ]
then
export IS_REDOX="1"
fi
ARCH="${TARGET%%-*}"
HOST="$TARGET"
if [ x"${HOST}" == x"riscv64gc-unknown-redox" ] ; then
@ -14,7 +19,6 @@ fi
# Automatic variables
ROOT="$(cd `dirname "$0"` && pwd)"
export PATH="${ROOT}/bin:$PATH"
export AR="${HOST}-gcc-ar"
export AS="${HOST}-as"
@ -48,9 +52,21 @@ fi
export FIND
if [ ! "$(uname -s)" = "Redox" ]
if [ -z "${IS_REDOX}" ]
then
function pkgar {
"$ROOT/pkgar/target/release/pkgar" "$@"
}
function cook {
"$ROOT/target/release/cook" "$@"
}
function repo_builder {
"$ROOT/target/release/repo_builder" "$@"
}
function list_recipes {
"$ROOT/target/release/list_recipes" "$@"
}
function find_recipe {
"$ROOT/target/release/find_recipe" "$@"
}
fi

View File

@ -3,4 +3,4 @@ set -e
source config.sh
target/release/cook --fetch-only ${@:1}
cook --fetch-only ${@:1}

View File

@ -41,6 +41,7 @@ BINS=(
hashsum
head
join
install
link
ln
ls

View File

@ -21,12 +21,8 @@ mkdir -p "${COOKBOOK_SYSROOT}/usr"
ln -sf "${COOKBOOK_SYSROOT}/include" "${COOKBOOK_SYSROOT}/usr/include"
ln -sf "${COOKBOOK_SYSROOT}/lib" "${COOKBOOK_SYSROOT}/usr/lib"
COOKBOOK_CONFIGURE_FLAGS=(
--host="${GNU_TARGET}"
COOKBOOK_CONFIGURE_FLAGS+=(
--target="${GNU_TARGET}"
--prefix=/
--enable-shared
--disable-static
--with-sysroot=/
--with-build-sysroot="${COOKBOOK_SYSROOT}"
--enable-languages=c,c++,lto
@ -40,9 +36,12 @@ COOKBOOK_CONFIGURE_FLAGS=(
"${COOKBOOK_CONFIGURE}" "${COOKBOOK_CONFIGURE_FLAGS[@]}"
"${COOKBOOK_MAKE}" -j "${COOKBOOK_MAKE_JOBS}" all-gcc all-target-libgcc all-target-libstdc++-v3
"${COOKBOOK_MAKE}" install-gcc install-target-libgcc install-target-libstdc++-v3 DESTDIR="${COOKBOOK_STAGE}"
ln -s "gcc" "${COOKBOOK_STAGE}/bin/cc"
mkdir -p "${COOKBOOK_STAGE}/usr/libexec"
ln -s "/libexec/gcc" "${COOKBOOK_STAGE}/usr/libexec/gcc"
ln -s "gcc" "${COOKBOOK_STAGE}/usr/bin/cc"
# Avoid conflict with libgcc & libstdcxx
rm -f "${COOKBOOK_STAGE}"/lib/libgcc_s.so* "${COOKBOOK_STAGE}"/lib/libstdc++.so*
rm -f "${COOKBOOK_STAGE}"/usr/lib/libgcc_s.so* "${COOKBOOK_STAGE}"/usr/lib/libstdc++.so*
"""
[package]
dependencies = [
"gnu-binutils"
]

View File

@ -1,6 +1,9 @@
[source]
tar = "https://libarchive.org/downloads/libarchive-3.6.2.tar.xz"
blake3 = "f98695fe81235a74fa3fc2c3ba0f0d4f13ea15f9be3850b83e304cf5d78be710"
patches = [
"redox.patch"
]
[build]
template = "configure"

View File

@ -0,0 +1,13 @@
diff -ruwN source/configure source-new/configure
--- source/configure 2022-12-09 20:38:47.000000000 +0700
+++ source-new/configure 2025-09-14 17:17:50.138530195 +0700
@@ -19039,7 +19039,8 @@
ac_fn_c_check_func "$LINENO" "fstatat" "ac_cv_func_fstatat"
if test "x$ac_cv_func_fstatat" = xyes
then :
- printf "%s\n" "#define HAVE_FSTATAT 1" >>confdefs.h
+# When fstatat works, remove this patch
+# printf "%s\n" "#define HAVE_FSTATAT 1" >>confdefs.h
fi
ac_fn_c_check_func "$LINENO" "fstatfs" "ac_cv_func_fstatfs"

View File

@ -0,0 +1,28 @@
[source]
git = "https://gitlab.redox-os.org/redox-os/cookbook.git"
[build]
template = "custom"
script = """
cookbook_cargo
mkdir -pv "${COOKBOOK_STAGE}/home/user/cookbook"
cp -rv "${COOKBOOK_SOURCE}"/* "${COOKBOOK_STAGE}/home/user/cookbook"
"""
[package]
dependencies = [
# TODO: When rust working, use this
# "dev-essential",
"autoconf",
"automake",
"gcc13",
"git",
"gnu-make",
"libtool",
"patch",
"pkg-config",
"pkgar",
"sed",
"wget",
]

View File

@ -1,11 +0,0 @@
#TODO can't detect libiconv
# in case of problems, read https://www.php.net/manual/en/install.unix.php
[source]
tar = "https://www.php.net/distributions/php-8.3.0.tar.xz"
[build]
template = "configure"
dependencies = [
"libxml2",
"sqlite3",
"libiconv",
]

View File

@ -0,0 +1,60 @@
#TODO fix readline and openssl
[source]
tar = "https://www.php.net/distributions/php-8.4.12.tar.xz"
patches = [
"redox.patch"
]
[build]
template = "custom"
dependencies = [
"curl",
"libffi",
"libgmp",
"libavif",
"libjpeg",
# "libedit",
"libonig",
"libpng",
"libwebp",
"libxml2",
"libzip",
# "ncurses",
"nghttp2",
"openssl1",
"pcre",
# "readline",
"sqlite3",
"xz",
"zlib",
]
script = """
DYNAMIC_INIT
# extension stuff
export CURL_LIBS="-lcurl -lnghttp2 -lssl -lcrypto"
#export READLINE_DIR="${COOKBOOK_SYSROOT}/usr"
COOKBOOK_CONFIGURE_FLAGS+=(
--without-iconv
--disable-phar
--disable-opcache
--enable-gd
--with-curl
--with-gmp
--with-jpeg
--with-webp
--with-avif
--with-ffi
--with-intl
--with-mbstring
# --with-libedit
# --with-readline
# --with-openssl
--with-zip
)
"${COOKBOOK_CONFIGURE}" "${COOKBOOK_CONFIGURE_FLAGS[@]}" "$@"
"${COOKBOOK_MAKE}" -j "${COOKBOOK_MAKE_JOBS}"
"${COOKBOOK_MAKE}" install \
INSTALL_ROOT="${COOKBOOK_STAGE}" \
datarootdir=/usr/share localstatedir=/var
"""

View File

@ -0,0 +1,42 @@
diff --color -ruwN source/configure source-new/configure
--- source/configure 2025-08-26 20:36:28.000000000 +0700
+++ source-new/configure 2025-09-16 07:44:46.452670941 +0700
@@ -25863,7 +25863,7 @@
then :
ac_cv_lib_curl_curl_easy_perform=yes
else case e in #(
- e) ac_cv_lib_curl_curl_easy_perform=no ;;
+ e) ac_cv_lib_curl_curl_easy_perform=yes ;;
esac
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
@@ -37356,7 +37356,7 @@
then :
php_cv_lib_gd_works=yes
else case e in #(
- e) php_cv_lib_gd_works=no ;;
+ e) php_cv_lib_gd_works=yes ;;
esac
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
@@ -40056,7 +40056,7 @@
LIBS_SAVED=$LIBS
CFLAGS="$CFLAGS $GMP_CFLAGS"
LIBS="$LIBS $GMP_LIBS"
- gmp_check=no
+ gmp_check=yes
ac_fn_c_check_header_compile "$LINENO" "gmp.h" "ac_cv_header_gmp_h" "$ac_includes_default"
if test "x$ac_cv_header_gmp_h" = xyes
then :
diff --color -ruwN source/ext/posix/posix.c source-new/ext/posix/posix.c
--- source/ext/posix/posix.c 2025-08-26 20:36:28.000000000 +0700
+++ source-new/ext/posix/posix.c 2025-09-16 07:02:03.974662569 +0700
@@ -375,7 +375,7 @@
ZEND_PARSE_PARAMETERS_NONE();
- if ((ticks = times(&t)) == -1) {
+ {
POSIX_G(last_error) = errno;
RETURN_FALSE;
}

View File

@ -1,6 +1,19 @@
#TODO Missing script for "make", see https://github.com/valkey-io/valkey#building-valkey
#TODO Compiling, server crashes in page fault
[source]
git = "https://github.com/valkey-io/valkey"
rev = "26388270f197bce84817eea0a73d687d58442654"
rev = "a47e8fa1505578d78cef5c5e11da0972c3dae560" # 8.1.3
[build]
template = "custom"
dependencies = [
"openssl1"
]
script = """
rsync -av --delete "${COOKBOOK_SOURCE}"/* ./
${COOKBOOK_MAKE} MALLOC=libc BUILD_TLS=yes \
WARN="-Wall -W -Wno-missing-field-initializers" \
WARNINGS="-Wall -W -Wno-missing-field-initializers" \
AR="${TARGET}-gcc-ar"
${COOKBOOK_MAKE} install PREFIX="${COOKBOOK_STAGE}"/usr
"""

View File

@ -1,5 +1,9 @@
#TODO fs-set-times crate error
#TODO requires *at functions in fcntl.h
#TODO (willnode) push changes upstream
[source]
git = "https://github.com/bytecodealliance/wasmtime"
git = "https://github.com/willnode/wasmtime"
branch = "v36-redox"
shallow_clone = true
[build]
template = "cargo"

View File

@ -0,0 +1,5 @@
#TODO not compiled or tested
[source]
git = "https://codeberg.org/lukeflo/bibiman"
[build]
template = "cargo"

View File

@ -0,0 +1,5 @@
#TODO not compiled or tested
[source]
git = "https://codeberg.org/outfly/outfly"
[build]
template = "cargo"

View File

@ -1,23 +1,8 @@
#TODO maybe incomplete script, see https://github.com/nih-at/libzip/blob/main/INSTALL.md
#TODO Promote
[source]
tar = "https://libzip.org/download/libzip-1.10.1.tar.gz"
[build]
template = "custom"
template = "cmake"
dependencies = [
"zlib",
]
script = """
COOKBOOK_CONFIGURE="cmake"
COOKBOOK_CONFIGURE_FLAGS=(
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_CROSSCOMPILING=True
-DCMAKE_EXE_LINKER_FLAGS="-static"
-DCMAKE_INSTALL_PREFIX="/"
-DCMAKE_PREFIX_PATH="${COOKBOOK_SYSROOT}"
-DCMAKE_SYSTEM_NAME=Generic
-DCMAKE_SYSTEM_PROCESSOR="$(echo "${TARGET}" | cut -d - -f1)"
-DCMAKE_VERBOSE_MAKEFILE=On
"${COOKBOOK_SOURCE}"
)
cookbook_configure
"""

View File

@ -0,0 +1,9 @@
[source]
git = "https://github.com/kkos/oniguruma"
script = """
DYNAMIC_INIT
autotools_recursive_regenerate
"""
[build]
template = "configure"

View File

@ -1,5 +1,14 @@
#TODO finish libtool setup
#TODO can build, not tested
[source]
tar = "https://ftpmirror.gnu.org/libtool/libtool-2.5.4.tar.gz"
git = "https://gitlab.redox-os.org/redox-os/libtool"
branch = "v2.5.4-redox"
shallow_clone = true
script = """
./bootstrap \
--skip-po \
--force \
--gnulib-srcdir=./gnulib
"""
[build]
template = "configure"

View File

@ -0,0 +1,5 @@
#TODO not compiled or tested
[source]
git = "https://github.com/aguacero7/rkik"
[build]
template = "cargo"

View File

@ -1,5 +1,60 @@
#TODO Compilation error
#TODO Compiling, got some C issues on init
[source]
tar = "https://nginx.org/download/nginx-1.26.0.tar.gz"
tar = "https://nginx.org/download/nginx-1.28.0.tar.gz"
patches = [
"redox.patch"
]
[build]
template = "configure"
template = "custom"
dependencies = [
"pcre",
"openssl1",
"zlib",
]
script = """
DYNAMIC_INIT
rsync -av --delete "${COOKBOOK_SOURCE}"/* ./
ARCH="${TARGET%%-*}"
COOKBOOK_CONFIGURE_FLAGS=(
--crossbuild=Redox:$ARCH
--with-cc="$CC"
--with-cc-opt="$CFLAGS"
--with-ld-opt="$LDFLAGS"
--sbin-path=/usr/bin/nginx
--modules-path=/usr/lib/nginx/modules
--conf-path=/etc/nginx/nginx.conf
--error-log-path=/var/log/nginx/error.log
--http-log-path=/var/log/nginx/access.log
--http-client-body-temp-path=/var/lib/nginx/body
--http-proxy-temp-path=/var/lib/nginx/proxy
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi
--http-scgi-temp-path=/var/lib/nginx/scgi
--pid-path=/var/run/nginx.pid
--lock-path=/var/lock/nginx.lock
--user=nginx
--group=nginx
--with-compat
--with-debug
--with-pcre
--with-pcre-jit
--with-stream
--with-stream_realip_module
--with-stream_ssl_module
--with-stream_ssl_preread_module
--with-threads
--with-http_ssl_module
--with-http_v2_module
--with-http_realip_module
--with-http_gzip_static_module
--with-http_stub_status_module
--with-http_addition_module
)
unset AR AS CC CXX LD LDFLAGS NM OBJCOPY OBJDUMP RANLIB READELF RUSTFLAGS STRIP
cookbook_configure
mkdir -p "$COOKBOOK_STAGE"/var/lib/nginx/{body,proxy,fastcgi,uwsgi,scgi}
"""

View File

@ -0,0 +1,68 @@
diff --color -ruwN source/auto/feature source-new/auto/feature
--- source/auto/feature 2025-04-23 18:48:54.000000000 +0700
+++ source-new/auto/feature 2025-09-16 02:23:35.565899342 +0700
@@ -53,7 +57,7 @@
yes)
# /bin/sh is used to intercept "Killed" or "Abort trap" messages
- if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
+ #if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
echo " found"
ngx_found=yes
@@ -61,9 +65,9 @@
have=$ngx_have_feature . auto/have
fi
- else
- echo " found but is not working"
- fi
+ #else
+ # echo " found but is not working"
+ #fi
;;
value)
diff --color -ruwN source/auto/types/sizeof source-new/auto/types/sizeof
--- source/auto/types/sizeof 2025-04-23 18:48:54.000000000 +0700
+++ source-new/auto/types/sizeof 2025-09-16 02:38:57.979145501 +0700
@@ -33,7 +33,7 @@
END
-ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
+ngx_test="gcc $CC_TEST_FLAGS $CC_AUX_FLAGS \
-o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
diff --color -ruwN source/auto/types/typedef source-new/auto/types/typedef
--- source/auto/types/typedef 2025-04-23 18:48:54.000000000 +0700
+++ source-new/auto/types/typedef 2025-09-16 02:38:54.927091443 +0700
@@ -34,7 +34,7 @@
END
- ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
+ ngx_test="gcc $CC_TEST_FLAGS $CC_AUX_FLAGS \
-o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
diff --color -ruwN source/src/os/unix/ngx_process.c source-new/src/os/unix/ngx_process.c
--- source/src/os/unix/ngx_process.c 2025-04-23 18:48:54.000000000 +0700
+++ source-new/src/os/unix/ngx_process.c 2025-09-16 02:40:44.363029726 +0700
@@ -143,6 +143,7 @@
}
on = 1;
+ /*
if (ioctl(ngx_processes[s].channel[0], FIOASYNC, &on) == -1) {
ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
"ioctl(FIOASYNC) failed while spawning \"%s\"", name);
@@ -156,6 +157,7 @@
ngx_close_channel(ngx_processes[s].channel, cycle->log);
return NGX_INVALID_PID;
}
+ */
if (fcntl(ngx_processes[s].channel[0], F_SETFD, FD_CLOEXEC) == -1) {
ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,

View File

@ -0,0 +1,8 @@
#TODO not compiled or tested
[source]
git = "https://github.com/domcyrus/rustnet"
[build]
template = "cargo"
dependencies = [
"libpcap",
]

View File

@ -0,0 +1,6 @@
#TODO not compiled or tested
# require nerdfonts
[source]
git = "https://github.com/CompeyDev/ssh-portfolio"
[build]
template = "cargo"

View File

@ -0,0 +1,14 @@
#TODO missing dependencies
[source]
git = "https://codeberg.org/edestcroix/Recordbox"
[build]
template = "custom"
dependencies = [
"sqlite3",
"gtk4",
"glib",
"libadwaita",
"liblcms",
"gstreamer",
]
script = "DYNAMIC_INIT cookbook_cargo"

View File

@ -1,27 +1,17 @@
#TODO not compiled or tested
# WIP: Builds, runs, but hangs on waitpid
[source]
git = "https://github.com/fish-shell/fish-shell"
rev = "54e8ad7e90a8213c01ba58de0640223bee6846d6"
patches = ["redox.patch"]
[build]
template = "custom"
dependencies = [
"ncurses",
"gettext",
"pcre",
]
dependencies = ["gettext", "ncurses", "pcre"]
script = """
export CPPFLAGS="-I${COOKBOOK_SYSROOT}/include/ncurses"
cookbook_cargo
#COOKBOOK_CONFIGURE="cmake"
#COOKBOOK_CONFIGURE_FLAGS=(
# -DCMAKE_BUILD_TYPE=Release
# -DCMAKE_CROSSCOMPILING=True
# -DCMAKE_EXE_LINKER_FLAGS="-static"
# -DCMAKE_INSTALL_PREFIX="/"
# -DCMAKE_PREFIX_PATH="${COOKBOOK_SYSROOT}"
# -DCMAKE_SYSTEM_NAME=Generic
# -DCMAKE_SYSTEM_PROCESSOR="$(echo "${TARGET}" | cut -d - -f1)"
# -DCMAKE_VERBOSE_MAKEFILE=On
#"${COOKBOOK_SOURCE}"
#)
#cookbook_configure
DYNAMIC_INIT
# The only default enabled feature is building the man pages.
# However, that requires sphinx so it can just be enabled later.
cookbook_cargo --no-default-features
"""

View File

@ -0,0 +1,144 @@
diff '--color=auto' -ruwN source/Cargo.toml source-new/Cargo.toml
--- source/Cargo.toml 2025-09-11 01:59:14.785564526 -0400
+++ source-new/Cargo.toml 2025-09-11 01:59:45.885553436 -0400
@@ -35,12 +35,12 @@
bitflags = "2.5.0"
errno = "0.3.0"
-libc = "0.2"
+libc = { git = "https://github.com/rust-lang/libc", rev = "b31ee9b22f99354f2ca00c68d038d6f377c8b8a4", features = ["extra_traits"] }
# lru pulls in hashbrown by default, which uses a faster (though less DoS resistant) hashing algo.
# disabling default features uses the stdlib instead, but it doubles the time to rewrite the history
# files as of 22 April 2024.
lru = "0.13.0"
-nix = { version = "0.30.1", default-features = false, features = [
+nix = { git = "https://github.com/joshuamegnauth54/nix", branch = "redox-fish-no-merge", default-features = false, features = [
"event",
"inotify",
"resource",
diff '--color=auto' -ruwN source/src/exec.rs source-new/src/exec.rs
--- source/src/exec.rs 2025-09-11 01:59:14.596625190 -0400
+++ source-new/src/exec.rs 2025-09-11 02:00:00.315286369 -0400
@@ -33,7 +33,6 @@
use crate::nix::{getpid, isatty};
use crate::null_terminated_array::OwningNullTerminatedArray;
use crate::parser::{Block, BlockId, BlockType, EvalRes, Parser};
-#[cfg(FISH_USE_POSIX_SPAWN)]
use crate::proc::Pid;
use crate::proc::{
hup_jobs, is_interactive_session, jobs_requiring_warning_on_exit, no_exec,
@@ -390,7 +389,7 @@
) -> ! {
// This function never returns, so we take certain liberties with constness.
- unsafe { libc::execve(actual_cmd.as_ptr(), argv.get(), envv.get()) };
+ unsafe { libc::execve(actual_cmd.as_ptr(), argv.get().cast(), envv.get().cast()) };
let err = errno();
// The shebang wasn't introduced until UNIX Seventh Edition, so if
@@ -413,7 +412,11 @@
// not what we would pass as argv0.
argv2[1] = actual_cmd.as_ptr();
unsafe {
- libc::execve(_PATH_BSHELL.load(Ordering::Relaxed), &argv2[0], envv.get());
+ libc::execve(
+ _PATH_BSHELL.load(Ordering::Relaxed),
+ argv2.as_ptr().cast(),
+ envv.get().cast(),
+ );
}
}
}
diff '--color=auto' -ruwN source/src/fork_exec/postfork.rs source-new/src/fork_exec/postfork.rs
--- source/src/fork_exec/postfork.rs 2025-09-11 01:59:14.828576001 -0400
+++ source-new/src/fork_exec/postfork.rs 2025-09-11 02:00:00.319001235 -0400
@@ -339,7 +339,9 @@
"', which is not an executable command."
);
}
- } else if md.unwrap().mode() & u32::from(libc::S_IFMT) == u32::from(libc::S_IFDIR) {
+ } else if md.unwrap().mode() & u32::try_from(libc::S_IFMT).unwrap()
+ == u32::try_from(libc::S_IFDIR).unwrap()
+ {
FLOG_SAFE!(
exec,
"Failed to execute process '",
diff '--color=auto' -ruwN source/src/input_common.rs source-new/src/input_common.rs
--- source/src/input_common.rs 2025-09-11 01:59:14.828576001 -0400
+++ source-new/src/input_common.rs 2025-09-11 02:00:00.316042380 -0400
@@ -589,7 +589,9 @@
// pselect expects timeouts in nanoseconds.
const NSEC_PER_MSEC: u64 = 1000 * 1000;
const NSEC_PER_SEC: u64 = NSEC_PER_MSEC * 1000;
+ #[cfg(not(target_os = "redox"))]
let wait_nsec: u64 = (timeout.as_millis() as u64) * NSEC_PER_MSEC;
+ #[cfg(not(target_os = "redox"))]
let timeout = libc::timespec {
tv_sec: (wait_nsec / NSEC_PER_SEC).try_into().unwrap(),
tv_nsec: (wait_nsec % NSEC_PER_SEC).try_into().unwrap(),
@@ -605,6 +607,7 @@
libc::FD_SET(in_fd, &mut fdset);
}
+ #[cfg(not(target_os = "redox"))]
let res = unsafe {
libc::pselect(
in_fd + 1,
@@ -616,6 +619,31 @@
)
};
+ #[cfg(target_os = "redox")]
+ let res = unsafe {
+ //HACK: pselect does this atomically
+ let mut saved = MaybeUninit::uninit();
+ let mut saved = {
+ libc::sigfillset(saved.as_mut_ptr());
+ saved.assume_init()
+ };
+ libc::sigprocmask(libc::SIG_SETMASK, &sigs, &mut saved);
+ let mut timeout = libc::timeval {
+ tv_sec: timeout.as_secs() as _,
+ tv_usec: timeout.subsec_micros() as _,
+ };
+ let res = libc::select(
+ in_fd + 1,
+ &mut fdset,
+ ptr::null_mut(),
+ ptr::null_mut(),
+ &raw mut timeout,
+ );
+ libc::sigprocmask(libc::SIG_SETMASK, &saved, ptr::null_mut());
+
+ res
+ };
+
// Prevent signal starvation on WSL causing the `torn_escapes.py` test to fail
if is_windows_subsystem_for_linux(WSL::V1) {
// Merely querying the current thread's sigmask is sufficient to deliver a pending signal
diff '--color=auto' -ruwN source/src/libc.c source-new/src/libc.c
--- source/src/libc.c 2025-09-11 01:59:14.599514890 -0400
+++ source-new/src/libc.c 2025-09-11 02:00:00.304589636 -0400
@@ -4,7 +4,7 @@
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h> // MB_CUR_MAX
-#include <sys/mount.h> // MNT_LOCAL
+/* #include <sys/mount.h> // MNT_LOCAL */
#include <sys/resource.h>
#include <sys/statvfs.h> // ST_LOCAL
#include <unistd.h> // _CS_PATH, _PC_CASE_SENSITIVE
diff '--color=auto' -ruwN source/src/path.rs source-new/src/path.rs
--- source/src/path.rs 2025-09-11 01:59:14.600515157 -0400
+++ source-new/src/path.rs 2025-09-11 02:00:00.317047039 -0400
@@ -738,7 +738,9 @@
crate::libc::ST_LOCAL(),
&narrow,
);
- #[cfg(not(target_os = "netbsd"))]
+ #[cfg(target_os = "redox")]
+ let remoteness = DirRemoteness::unknown;
+ #[cfg(not(target_os = "redox"))]
let remoteness = remoteness_via_statfs(
libc::statfs,
|stat: &libc::statfs| stat.f_flags,

View File

@ -0,0 +1,10 @@
#TODO not compiled or tested
[source]
git = "https://github.com/nate-craft/auditorium"
[build]
template = "cargo"
[package]
dependencies = [
"mpv",
"ffmpeg6",
]

View File

@ -0,0 +1,5 @@
#TODO not compiled or tested
[source]
git = "https://codeberg.org/unspeaker/tek"
[build]
template = "cargo"

View File

@ -0,0 +1,5 @@
#TODO not compiled or tested
[source]
git = "https://github.com/Julien-cpsn/desktop-tui"
[build]
template = "cargo"

View File

@ -0,0 +1,5 @@
#TODO not compiled or tested
[source]
git = "https://github.com/mikeleppane/envx"
[build]
template = "cargo"

View File

@ -0,0 +1,5 @@
#TODO not compiled or tested
[source]
git = "https://github.com/SuperCuber/dotter"
[build]
template = "cargo"

View File

@ -26,9 +26,9 @@ do
fi
done
target/release/cook $COOK_OPT $recipes
cook $COOK_OPT $recipes
repo="$ROOT/repo/$TARGET"
mkdir -p "$repo"
target/release/repo_builder "$repo" $recipes
repo_builder "$repo" $recipes

View File

@ -17,7 +17,7 @@ use std::{
use termion::{color, style};
use walkdir::{DirEntry, WalkDir};
use cookbook::WALK_DEPTH;
use cookbook::{is_redox, WALK_DEPTH};
fn remove_all(path: &Path) -> Result<(), String> {
if path.is_dir() {
@ -417,8 +417,9 @@ fn fetch(recipe_dir: &Path, source: &Option<SourceRecipe>) -> Result<PathBuf, St
command.arg("-C").arg(&source_dir);
command.arg("checkout").arg(rev);
run_command(command)?;
} else if !shallow_clone {
} else if !shallow_clone && !is_redox() {
//TODO: complicated stuff to check and reset branch to origin
//TODO: redox can't undestand this (got exit status 1)
let mut command = Command::new("bash");
command.arg("-c").arg(
r#"
@ -556,9 +557,14 @@ fi"#,
// Extract tar to source.tmp
//TODO: use tar crate (how to deal with compression?)
let mut command = Command::new("tar");
command.arg("--extract");
command.arg("--verbose");
command.arg("--file").arg(&source_tar);
if is_redox() {
command.arg("xvf");
} else {
command.arg("--extract");
command.arg("--verbose");
command.arg("--file");
}
command.arg(&source_tar);
command.arg("--directory").arg(&source_dir_tmp);
command.arg("--strip-components").arg("1");
run_command(command)?;
@ -843,7 +849,10 @@ fn build(
let pre_script = r#"# Common pre script
# Add cookbook bins to path
if [ -z "${IS_REDOX}" ]
then
export PATH="${COOKBOOK_ROOT}/bin:${PATH}"
fi
# This puts cargo build artifacts in the build directory
export CARGO_TARGET_DIR="${COOKBOOK_BUILD}/target"
@ -929,7 +938,12 @@ COOKBOOK_CONFIGURE_FLAGS=(
--enable-static
)
COOKBOOK_MAKE="make"
if [ -z "${IS_REDOX}" ]
then
COOKBOOK_MAKE_JOBS="$(nproc)"
else
COOKBOOK_MAKE_JOBS="1"
fi
function cookbook_configure {
"${COOKBOOK_CONFIGURE}" "${COOKBOOK_CONFIGURE_FLAGS[@]}" "$@"
"${COOKBOOK_MAKE}" -j "${COOKBOOK_MAKE_JOBS}"
@ -1128,22 +1142,29 @@ done
//TODO: remove unwraps
let cookbook_build = build_dir.canonicalize().unwrap();
let cookbook_recipe = recipe_dir.canonicalize().unwrap();
let cookbook_redoxer = Path::new("target/release/cookbook_redoxer")
.canonicalize()
.unwrap();
let cookbook_root = Path::new(".").canonicalize().unwrap();
let cookbook_stage = stage_dir_tmp.canonicalize().unwrap();
let cookbook_source = source_dir.canonicalize().unwrap();
let cookbook_sysroot = sysroot_dir.canonicalize().unwrap();
let mut command = Command::new(&cookbook_redoxer);
command.arg("env");
command.arg("bash").arg("-ex");
let mut command = if is_redox() {
let mut command = Command::new("bash");
command.arg("-ex");
command.env("COOKBOOK_REDOXER", "cargo");
command
} else {
let cookbook_redoxer = Path::new("target/release/cookbook_redoxer")
.canonicalize()
.unwrap();
let mut command = Command::new(&cookbook_redoxer);
command.arg("env").arg("bash").arg("-ex");
command.env("COOKBOOK_REDOXER", &cookbook_redoxer);
command
};
command.current_dir(&cookbook_build);
command.env("COOKBOOK_BUILD", &cookbook_build);
command.env("COOKBOOK_NAME", name.as_str());
command.env("COOKBOOK_RECIPE", &cookbook_recipe);
command.env("COOKBOOK_REDOXER", &cookbook_redoxer);
command.env("COOKBOOK_ROOT", &cookbook_root);
command.env("COOKBOOK_STAGE", &cookbook_stage);
command.env("COOKBOOK_SOURCE", &cookbook_source);

View File

@ -59,6 +59,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let toml_src = stage_dir.with_extension("toml");
let toml_dst = repo_path.join(format!("{}.toml", recipe));
if !fs::exists(&toml_src)? {
eprintln!("recipe {} is missing stage.toml", recipe);
continue;
}
if is_newer(&toml_src, &toml_dst) {
eprintln!("\x1b[01;38;5;155mrepo - publishing {}\x1b[0m", recipe);
if fs::exists(&pkgar_src)? {

View File

@ -5,3 +5,13 @@ mod progress_bar;
/// Default for maximum number of levels to descend down dependencies tree.
pub const WALK_DEPTH: usize = 16;
#[cfg(target_os = "redox")]
pub fn is_redox() -> bool {
true
}
#[cfg(not(target_os = "redox"))]
pub fn is_redox() -> bool {
false
}

View File

@ -5,14 +5,14 @@ source config.sh
if [ $# = 0 ]
then
recipes="$(target/release/list_recipes --short)"
recipes="$(list_recipes --short)"
else
recipes="$@"
fi
for recipe_name in $recipes
do
recipe_path=`target/release/find_recipe $recipe_name`
recipe_path=`find_recipe $recipe_name`
echo -e "\033[01;38;5;215mcook - unfetch $recipe_name\033[0m"
rm -rfv "$recipe_path"/source "$recipe_path"/source.tar