From 965ff8fccf3afa1da6343ae21911b1be9f3b55c3 Mon Sep 17 00:00:00 2001 From: Wildan Mubarok Date: Mon, 4 Aug 2025 10:10:21 +0000 Subject: [PATCH 01/33] Update zig recipe --- recipes/wip/dev/lang/zig/01_redox.patch | 83 +++++++++++++++++++++++++ recipes/wip/dev/lang/zig/recipe.toml | 26 ++++---- 2 files changed, 94 insertions(+), 15 deletions(-) create mode 100644 recipes/wip/dev/lang/zig/01_redox.patch diff --git a/recipes/wip/dev/lang/zig/01_redox.patch b/recipes/wip/dev/lang/zig/01_redox.patch new file mode 100644 index 000000000..093eb2f41 --- /dev/null +++ b/recipes/wip/dev/lang/zig/01_redox.patch @@ -0,0 +1,83 @@ +diff -ruwN source/build.zig source-new/build.zig +--- source/build.zig 2025-05-23 11:31:41 ++++ source-new/build.zig 2025-08-04 17:06:57 +@@ -802,7 +802,7 @@ + try addCxxKnownPath(b, cfg, exe, b.fmt("libstdc++.{s}", .{lib_suffix}), null, need_cpp_includes); + try addCxxKnownPath(b, cfg, exe, b.fmt("libgcc_eh.{s}", .{lib_suffix}), null, need_cpp_includes); + }, +- .haiku => { ++ .haiku, .redox => { + try addCxxKnownPath(b, cfg, exe, b.fmt("libstdc++.{s}", .{lib_suffix}), null, need_cpp_includes); + }, + else => {}, +diff -ruwN source/lib/std/Target.zig source-new/lib/std/Target.zig +--- source/lib/std/Target.zig 2025-05-23 11:31:41 ++++ source-new/lib/std/Target.zig 2025-08-04 16:59:08 +@@ -29,6 +29,7 @@ + hurd, + linux, + plan9, ++ redox, + rtems, + serenity, + zos, +@@ -904,6 +905,7 @@ + .fuchsia, + .hermit, + .plan9, ++ .redox, + .serenity, + .zos, + .dragonfly, +@@ -2435,6 +2437,16 @@ + else + "/usr", + }) else none, ++ ++ .redox => switch (cpu.arch) { ++ .x86, ++ => init("/usr/lib/ld.so.1"), ++ .aarch64, ++ .riscv64, ++ .x86_64, ++ => init("/usr/lib/ld64.so.1"), ++ else => none, ++ }, + + .freebsd => switch (cpu.arch) { + .arm, +diff -ruwN source/test/llvm_targets.zig source-new/test/llvm_targets.zig +--- source/test/llvm_targets.zig 2025-05-23 11:31:41 ++++ source-new/test/llvm_targets.zig 2025-08-04 17:02:56 +@@ -20,6 +20,7 @@ + .{ .cpu_arch = .aarch64, .os_tag = .macos, .abi = .none }, + .{ .cpu_arch = .aarch64, .os_tag = .netbsd, .abi = .none }, + .{ .cpu_arch = .aarch64, .os_tag = .openbsd, .abi = .none }, ++ .{ .cpu_arch = .aarch64, .os_tag = .redox, .abi = .none }, + .{ .cpu_arch = .aarch64, .os_tag = .rtems, .abi = .none }, + .{ .cpu_arch = .aarch64, .os_tag = .serenity, .abi = .none }, + .{ .cpu_arch = .aarch64, .os_tag = .tvos, .abi = .none }, +@@ -238,6 +239,7 @@ + .{ .cpu_arch = .riscv64, .os_tag = .linux, .abi = .none }, + .{ .cpu_arch = .riscv64, .os_tag = .netbsd, .abi = .none }, + .{ .cpu_arch = .riscv64, .os_tag = .openbsd, .abi = .none }, ++ .{ .cpu_arch = .riscv64, .os_tag = .redox, .abi = .none }, + .{ .cpu_arch = .riscv64, .os_tag = .rtems, .abi = .none }, + .{ .cpu_arch = .riscv64, .os_tag = .serenity, .abi = .none }, + // .{ .cpu_arch = .riscv64, .os_tag = .uefi, .abi = .none }, +@@ -325,6 +327,7 @@ + .{ .cpu_arch = .x86, .os_tag = .linux, .abi = .none }, + .{ .cpu_arch = .x86, .os_tag = .netbsd, .abi = .none }, + .{ .cpu_arch = .x86, .os_tag = .openbsd, .abi = .none }, ++ .{ .cpu_arch = .x86, .os_tag = .redox, .abi = .none }, + .{ .cpu_arch = .x86, .os_tag = .rtems, .abi = .none }, + .{ .cpu_arch = .x86, .os_tag = .solaris, .abi = .none }, + .{ .cpu_arch = .x86, .os_tag = .uefi, .abi = .none }, +@@ -361,6 +364,7 @@ + .{ .cpu_arch = .x86_64, .os_tag = .macos, .abi = .none }, + .{ .cpu_arch = .x86_64, .os_tag = .netbsd, .abi = .none }, + .{ .cpu_arch = .x86_64, .os_tag = .openbsd, .abi = .none }, ++ .{ .cpu_arch = .x86_64, .os_tag = .redox, .abi = .none }, + .{ .cpu_arch = .x86_64, .os_tag = .rtems, .abi = .none }, + .{ .cpu_arch = .x86_64, .os_tag = .serenity, .abi = .none }, + .{ .cpu_arch = .x86_64, .os_tag = .solaris, .abi = .none }, diff --git a/recipes/wip/dev/lang/zig/recipe.toml b/recipes/wip/dev/lang/zig/recipe.toml index 90ceedba0..c88b9070f 100644 --- a/recipes/wip/dev/lang/zig/recipe.toml +++ b/recipes/wip/dev/lang/zig/recipe.toml @@ -1,20 +1,16 @@ -#TODO probably wrong script, see https://github.com/ziglang/zig/wiki/Building-Zig-From-Source +#TODO see https://github.com/ziglang/zig/wiki/Building-Zig-From-Source [source] -tar = "https://ziglang.org/download/0.10.1/zig-0.10.1.tar.xz" +tar = "https://ziglang.org/download/0.14.1/zig-0.14.1.tar.xz" +patches = [ + "01_redox.patch" +] + [build] +dependencies = [ + "llvm18" # need lld +] template = "custom" 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 +DYNAMIC_INIT +cookbook_cmake """ From f4d3630ef8d24b7ef1cf59f4d6a53f7f6a3bd1b6 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Mon, 1 Sep 2025 21:38:14 +0200 Subject: [PATCH 02/33] Remove all code that handles recipe.sh --- cook.sh | 275 ------------------------------------------------------- fetch.sh | 7 +- repo.sh | 60 +----------- 3 files changed, 6 insertions(+), 336 deletions(-) diff --git a/cook.sh b/cook.sh index 6435f2cce..ad457277e 100755 --- a/cook.sh +++ b/cook.sh @@ -13,28 +13,10 @@ export DEBUG= export EXAMPLES= export PREPARE_COPY=1 -if hash sha256sum 2>/dev/null -then - SHASUM="sha256sum" -else - SHASUM="shasum -a 256" -fi - function usage { echo "cook.sh $1 " >&2 - echo " dist" >&2 echo " distclean" >&2 - echo " build" >&2 - echo " clean" >&2 - echo " fetch" >&2 echo " unfetch" >&2 - echo " pkg" >&2 - echo " unpkg" >&2 - echo " prepare" >&2 - echo " unprepare" >&2 - echo " stage" >&2 - echo " unstage" >&2 - echo " version" >&2 } function op { @@ -44,275 +26,22 @@ function op { fi case "$2" in - dist) - op $1 prepare - op $1 build - op $1 stage - op $1 pkg - ;; distclean) op $1 unpkg op $1 unstage op $1 unprepare ;; - fetch) - skip=0 - if [ "$(type -t recipe_fetch)" = "function" ] - then - recipe_fetch - fi - if [ "$skip" -eq "0" ] - then - if [ -n "$TAR" ] - then - if [ ! -f source.tar ] - then - wget "$TAR" --continue -O source.tar.tmp - mv source.tar.tmp source.tar - fi - - if [ -n "$TAR_SHA256" ] - then - $SHASUM -c <<< "${TAR_SHA256} source.tar" - fi - - if [ ! -d source ] - then - mkdir source - tar xvf source.tar -C source --strip-components 1 - fi - elif [ -n "$GIT" ] - then - if [ ! -d source ] - then - if [ -n "$BRANCH" ] - then - git clone --recursive "$GIT" -b "$BRANCH" source - else - git clone --recursive "$GIT" source - fi - fi - - pushd source > /dev/null - git remote set-url origin "$GIT" - git fetch origin - if [ -n "$GIT_UPSTREAM" ] - then - git remote set-url upstream "$GIT_UPSTREAM" &> /dev/null || - git remote add upstream "$GIT_UPSTREAM" - git fetch upstream - fi - - ORIGIN_BRANCH="$(git branch --remotes | grep '^ origin/HEAD -> ' | cut -d ' ' -f 5-)" - if [ -n "$BRANCH" ] - then - ORIGIN_BRANCH="origin/$BRANCH" - fi - - if [ "$(git rev-parse HEAD)" != "$(git rev-parse $ORIGIN_BRANCH)" ] - then - git checkout -B "$(echo "$ORIGIN_BRANCH" | cut -d / -f 2-)" "$ORIGIN_BRANCH" - fi - git submodule sync --recursive - git submodule update --init --recursive - popd > /dev/null - fi - fi - ;; unfetch) rm -rfv source source.tar ;; - prepare) - skip=0 - if [ "$(type -t recipe_prepare)" = "function" ] - then - recipe_prepare - fi - if [ "$skip" -eq "0" ] - then - rm -rf "${COOKBOOK_SYSROOT}" - mkdir "${COOKBOOK_SYSROOT}" - - # usrmerge - mkdir "${COOKBOOK_SYSROOT}/usr" - for folder in bin include lib share - do - mkdir "${COOKBOOK_SYSROOT}/usr/${folder}" - ln -s "usr/${folder}" "${COOKBOOK_SYSROOT}/${folder}" - done - - if [ ${#BUILD_DEPENDS} -gt 0 ] - then - pushd $ROOT - ./repo.sh "${BUILD_DEPENDS[@]}" - popd - - for i in "${BUILD_DEPENDS[@]}" - do - pkgar \ - extract \ - "${COOKBOOK_SYSROOT}" \ - --archive "$REPO/$i.pkgar" \ - --pkey "${ROOT}/build/id_ed25519.pub.toml" - done - fi - - rm -rf "${COOKBOOK_BUILD}" - if [ "$PREPARE_COPY" -eq "0" ] - then - mkdir "${COOKBOOK_BUILD}" - else - cp -Rp source "${COOKBOOK_BUILD}" - fi - - for patch in *.patch - do - patch -p1 -d "${COOKBOOK_BUILD}" < "$patch" - done - fi - ;; unprepare) rm -rf "${COOKBOOK_BUILD}" rm -rf "${COOKBOOK_SYSROOT}" ;; - version) - pushd "${COOKBOOK_BUILD}" > /dev/null - skip=0 - if [ "$(type -t recipe_version)" = "function" ] - then - recipe_version - fi - if [ "$skip" -eq "0" ] - then - # there's an unstable built-in cargo config command, so hack around it - cargo-config config package.version | tr -d '"' - fi - popd > /dev/null - ;; - gitversion) - if [ -d "${COOKBOOK_BUILD}"/.git ] - then - echo "$(op $1 version)-$(git -C "${COOKBOOK_BUILD}" rev-parse --short HEAD)" - else - op $1 version - fi - ;; - build) - pushd "${COOKBOOK_BUILD}" > /dev/null - skip=0 - if [ "$(type -t recipe_build)" = "function" ] - then - recipe_build - fi - - release_flag="--release" - if [ "$DEBUG" == 1 ] - then - release_flag= - fi - - if [ -n "$CARGO_PACKAGE" ]; then - package_flag="--package=$CARGO_PACKAGE" - else - package_flag= - fi - - if [ "$skip" -eq "0" ] - then - "${CARGO[@]}" "$CARGOBUILD" --target "$TARGET" $release_flag $package_flag $CARGOFLAGS - fi - popd > /dev/null - ;; - clean) - pushd "${COOKBOOK_BUILD}" > /dev/null - skip=0 - if [ "$(type -t recipe_clean)" = "function" ] - then - recipe_clean - fi - if [ "$skip" -eq "0" ] - then - "${CARGO[@]}" clean - fi - popd > /dev/null - ;; - stage) - op $1 unstage - mkdir -p "${COOKBOOK_STAGE}" - stage="$(realpath "${COOKBOOK_STAGE}")" - source="$(realpath source)" - pushd "${COOKBOOK_BUILD}" > /dev/null - skip=0 - if [ "$(type -t recipe_stage)" = "function" ] - then - recipe_stage "$stage" - fi - if [ "$skip" -eq "0" ] - then - #TODO "${CARGO[@]}" install --root "$stage" $CARGOFLAGS - if [ "$DEBUG" == 1 ] - then - build=debug - else - build=release - fi - - bins="$(find target/$TARGET/$build/ -maxdepth 1 -type f ! -name '*.*')" - if [ -z "$bins" ] || [ "$EXAMPLES" == 1 ] - then - example=true - bins="$bins $(find target/$TARGET/$build/examples/ -maxdepth 1 -type f ! -name '*.*' ! -name '*-*' \ - 2> /dev/null || true)" - fi - if [ -n "$bins" ] - then - if [ -n "$example" ] && [ "$EXAMPLES" != 1 ] - then - echo "$(tput bold)Note$(tput sgr0): No binaries detected, using example binaries" - fi - mkdir -p "$stage/$BINDIR" - for bin in $bins - do - if [ "$DEBUG" == 1 ] - then - cp -v "$bin" "$stage/$BINDIR/$(basename $bin)" - else - "${STRIP}" -v "$bin" -o "$stage/$BINDIR/$(basename $bin)" - fi - done - else - echo "$(tput bold)Warning$(tput sgr0): Recipe does not have any binaries" >&2 - fi - fi - popd > /dev/null - ;; unstage) rm -rfv "${COOKBOOK_STAGE}" rm -fv "${TARGET_DIR}/auto_deps.toml" ;; - pkg) - pkgar \ - create \ - --archive "${COOKBOOK_STAGE}.pkgar" \ - --skey "${ROOT}/build/id_ed25519.toml" \ - "${COOKBOOK_STAGE}" - - # Generate stage.toml - echo "name = \"$1\"" > "${COOKBOOK_STAGE}.toml" - echo "version = \"$(op $1 version)\"" >> "${COOKBOOK_STAGE}.toml" - echo "target = \"$TARGET\"" >> "${COOKBOOK_STAGE}.toml" - - # Add runtime dependencies to package if they exist - if [ -n "$DEPENDS" ] - then - # Remove leading and trailing whitespace, replace whitespace between - # package names with commas, and surround package names with quotes - dependencies=$(echo -e "$DEPENDS" | sed -E 's/^[[:space:]]*//;s/[[:space:]]*$//;s/[[:space:]]+/,/g;s/[^, ][^, ]*/"&"/g') - echo "depends = [$dependencies]" >> "${COOKBOOK_STAGE}.toml" - else - echo "depends = []" >> "${COOKBOOK_STAGE}.toml" - fi - ;; unpkg) rm -fv "${COOKBOOK_STAGE}.pkgar" "${COOKBOOK_STAGE}.toml" ;; @@ -351,10 +80,6 @@ then cd "${COOKBOOK_RECIPE}" - if [ -e recipe.sh ]; then - source recipe.sh - fi - ops=() for arg in "${@:2}" do diff --git a/fetch.sh b/fetch.sh index 060ac6e4d..a3bc69c76 100755 --- a/fetch.sh +++ b/fetch.sh @@ -32,10 +32,5 @@ do recipe_path=`target/release/find_recipe $recipe_name` fi - if [ -e "$recipe_path/recipe.toml" ] - then - target/release/cook --fetch-only "$recipe_name" - else - ./cook.sh "$recipe_name" fetch - fi + target/release/cook --fetch-only "$recipe_name" done diff --git a/repo.sh b/repo.sh index 40476cefd..8869c0e7b 100755 --- a/repo.sh +++ b/repo.sh @@ -34,9 +34,6 @@ then recipes="$(target/release/list_recipes)" fi -# All $recipes that are in the new TOML format. -toml_recipes="" - for recipe in $recipes do recipe_path=`target/release/find_recipe $recipe` @@ -47,65 +44,18 @@ do COOKBOOK_SOURCE="${COOKBOOK_RECIPE}/source" COOKBOOK_SYSROOT="${TARGET_DIR}/sysroot" - if [ -e "${COOKBOOK_RECIPE}/recipe.toml" ] - then - toml_recipes+=" $recipe" - target/release/cook $COOK_OPT "$recipe" - continue - fi - - if [ ! -d "${COOKBOOK_SOURCE}" ] - then - echo -e "\033[01;38;5;155mrepo - fetching $recipe\033[0m" >&2 - ./cook.sh "$recipe" fetch - fi - - if [ ! -d "${COOKBOOK_BUILD}" ] - then - echo -e "\033[01;38;5;155mrepo - preparing $recipe\033[0m" >&2 - ./cook.sh "$recipe" prepare - elif [ ! -d "${COOKBOOK_SYSROOT}" ] - then - echo -e "\033[01;38;5;155mrepo - repreparing $recipe\033[0m" >&2 - ./cook.sh "$recipe" unprepare prepare - else - TIME_SOURCE="$($FIND "${COOKBOOK_SOURCE}" -type f -not -path '*/.git*' -printf "%Ts\n" | sort -nr | head -n 1)" - TIME_BUILD="$($FIND "${COOKBOOK_BUILD}" -type f -not -path '*/.git*' -printf "%Ts\n" | sort -nr | head -n 1)" - if [ "$TIME_SOURCE" -gt "$TIME_BUILD" ] - then - echo -e "\033[01;38;5;155mrepo - repreparing $recipe\033[0m" >&2 - ./cook.sh "$recipe" unprepare prepare - fi - fi - - if [ ! -f "${COOKBOOK_STAGE}.pkgar" ] - then - echo -e "\033[01;38;5;155mrepo - building $recipe\033[0m" >&2 - ./cook.sh "$recipe" build stage pkg $DEBUG - else - TIME_BUILD="$($FIND "${COOKBOOK_BUILD}" -type f -not -path '*/.git*' -printf "%Ts\n" | sort -nr | head -n 1)" - TIME_STAGE="$($STAT -c "%Y" "${COOKBOOK_STAGE}.pkgar")" - TIME_RECIPE="$($FIND "${COOKBOOK_RECIPE}"/{recipe.sh,*.patch} -printf '%Ts\n' | sort -nr | head -n 1)" - if [ "$TIME_BUILD" -gt "$TIME_STAGE" -o "$TIME_RECIPE" -gt "$TIME_STAGE" ] - then - echo -e "\033[01;38;5;155mrepo - rebuilding $recipe\033[0m" >&2 - ./cook.sh "$recipe" untar unstage build stage pkg $DEBUG - else - echo -e "\033[01;38;5;155mrepo - $recipe up to date\033[0m" >&2 - fi - fi + target/release/cook $COOK_OPT "$recipe" done mkdir -p "$REPO" declare -A APPSTREAM_SOURCES -# Currently, we only support runtime dependencies for recipes in the new TOML -# format. Runtime dependencies include both `[package.dependencies]` and -# dynamically linked packages discovered by auto_deps. -# +# Runtime dependencies include both `[package.dependencies]` and dynamically +# linked packages discovered by auto_deps. +# # The following adds the package dependencies of the recipes to the repo as # well. -recipes="$recipes $(target/release/pkg_deps $toml_recipes)" +recipes="$recipes $(target/release/pkg_deps $recipes)" target/release/repo_builder "$REPO" $recipes From 24eccf7093faf9055fba638cca4832b7d4669731 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Mon, 1 Sep 2025 21:52:06 +0200 Subject: [PATCH 03/33] Remove cook.sh --- clean.sh | 22 ++++++++++- cook.sh | 105 ----------------------------------------------------- unfetch.sh | 13 ++++++- 3 files changed, 31 insertions(+), 109 deletions(-) delete mode 100755 cook.sh diff --git a/clean.sh b/clean.sh index 7aba7ca85..c1ed4cf24 100755 --- a/clean.sh +++ b/clean.sh @@ -10,7 +10,25 @@ else recipes="$@" fi -for recipe_path in $recipes +for recipe in $recipes do - ./cook.sh "$recipe_path" distclean + if (echo "$recipe" | grep '.*/.*' >/dev/null); then + recipe_name=$(basename "$recipe") + recipe_path="$recipe" + else + recipe_name="$recipe" + recipe_path=`target/release/find_recipe $recipe` + fi + + echo -e "\033[01;38;5;215mcook - clean $recipe_name\033[0m" + + if [ -d "$ROOT/$recipe_path" ] + then + COOKBOOK_RECIPE="${ROOT}/$recipe_path" + TARGET_DIR="${ROOT}/$recipe_path/target/${TARGET}" + + rm -rf "${TARGET_DIR}" + else + echo "clean.sh: recipe '$recipe_name' not found" >&2 + fi done diff --git a/cook.sh b/cook.sh deleted file mode 100755 index ad457277e..000000000 --- a/cook.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/env bash -set -e -shopt -s nullglob - -source config.sh - -# Variables to be overriden by recipes -export BINDIR=bin -export CARGO=(env RUSTFLAGS="$PREFIX_RUSTFLAGS -C link-arg=-zmuldefs" cargo) -export CARGOBUILD=rustc -export CARGOFLAGS= -export DEBUG= -export EXAMPLES= -export PREPARE_COPY=1 - -function usage { - echo "cook.sh $1 " >&2 - echo " distclean" >&2 - echo " unfetch" >&2 -} - -function op { - if [ ! "$COOK_QUIET" = "1" ] - then - echo -e "\033[01;38;5;215mcook - $1 $2\033[0m" >&2 - fi - - case "$2" in - distclean) - op $1 unpkg - op $1 unstage - op $1 unprepare - ;; - unfetch) - rm -rfv source source.tar - ;; - unprepare) - rm -rf "${COOKBOOK_BUILD}" - rm -rf "${COOKBOOK_SYSROOT}" - ;; - unstage) - rm -rfv "${COOKBOOK_STAGE}" - rm -fv "${TARGET_DIR}/auto_deps.toml" - ;; - unpkg) - rm -fv "${COOKBOOK_STAGE}.pkgar" "${COOKBOOK_STAGE}.toml" - ;; - *) - usage $1 - ;; - esac -} - -if [ -n "$1" ] -then - if (echo "$1" | grep '.*/.*' >/dev/null); then - recipe_name=$(basename "$1") - recipe_path="$1" - else - recipe_name="$1" - recipe_path=`target/release/find_recipe $recipe_name` - fi - - if [ -d "$ROOT/$recipe_path" ] - then - export COOKBOOK_RECIPE="${ROOT}/$recipe_path" - - TARGET_DIR="${COOKBOOK_RECIPE}/target/${TARGET}" - mkdir -p "${TARGET_DIR}" - - export COOKBOOK_BUILD="${TARGET_DIR}/build" - export COOKBOOK_STAGE="${TARGET_DIR}/stage" - export COOKBOOK_SOURCE="${COOKBOOK_RECIPE}/source" - export COOKBOOK_SYSROOT="${TARGET_DIR}/sysroot" - - export PKG_CONFIG_ALLOW_CROSS=1 - export PKG_CONFIG_PATH= - export PKG_CONFIG_LIBDIR="${COOKBOOK_SYSROOT}/lib/pkgconfig" - export PKG_CONFIG_SYSROOT_DIR="${COOKBOOK_SYSROOT}" - - cd "${COOKBOOK_RECIPE}" - - ops=() - for arg in "${@:2}" - do - if [ "$arg" == "--debug" ] - then - DEBUG=1 - else - ops[${#ops[@]}]="$arg" - fi - done - - for i in "${ops[@]}" - do - op "$recipe_name" "$i" - done - elif [ "$IGNORE_ERROR" != "1" ] - then - echo "cook.sh: recipe '$recipe_name' at not found" >&2 - exit 1 - fi -else - usage "{package}" -fi diff --git a/unfetch.sh b/unfetch.sh index eb73178c3..d8016a05f 100755 --- a/unfetch.sh +++ b/unfetch.sh @@ -10,7 +10,16 @@ else recipes="$@" fi -for recipe_path in $recipes +for recipe in $recipes do - ./cook.sh "$recipe_path" unfetch + if (echo "$recipe" | grep '.*/.*' >/dev/null); then + recipe_name=$(basename "$recipe") + recipe_path="$recipe" + else + recipe_name="$recipe" + recipe_path=`target/release/find_recipe $recipe` + fi + + rm -rfv "$recipe_path"/source "$recipe_path"/source.tar done + From 081367d343155280636c3d1dd246a569193f8881 Mon Sep 17 00:00:00 2001 From: Wildan Mubarok Date: Tue, 2 Sep 2025 15:31:26 +0000 Subject: [PATCH 04/33] Fix relibc tests --- recipes/tests/relibc-tests/recipe.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/tests/relibc-tests/recipe.toml b/recipes/tests/relibc-tests/recipe.toml index 023ac741e..8f587bb5d 100644 --- a/recipes/tests/relibc-tests/recipe.toml +++ b/recipes/tests/relibc-tests/recipe.toml @@ -8,7 +8,7 @@ script = """ rsync -av --delete "${COOKBOOK_SOURCE}/" ./ pushd tests export CARGO_TEST="${COOKBOOK_CARGO}" -export NATIVE_RELIBC=1 +export NATIVE_RELIBC=0 # set 0 to link against relibc "${COOKBOOK_MAKE}" -j "${COOKBOOK_MAKE_JOBS}" all bins_verify/relibc-tests popd mkdir -pv "${COOKBOOK_STAGE}/share/relibc" From bf026ddaf813d0d6a8a3231e167ee1230ad8bbdb Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Tue, 2 Sep 2025 20:33:37 +0200 Subject: [PATCH 05/33] Couple more cleanups --- clean.sh | 11 +---------- config.sh | 18 +----------------- repo.sh | 15 +++------------ 3 files changed, 5 insertions(+), 39 deletions(-) diff --git a/clean.sh b/clean.sh index c1ed4cf24..45c2e14a3 100755 --- a/clean.sh +++ b/clean.sh @@ -21,14 +21,5 @@ do fi echo -e "\033[01;38;5;215mcook - clean $recipe_name\033[0m" - - if [ -d "$ROOT/$recipe_path" ] - then - COOKBOOK_RECIPE="${ROOT}/$recipe_path" - TARGET_DIR="${ROOT}/$recipe_path/target/${TARGET}" - - rm -rf "${TARGET_DIR}" - else - echo "clean.sh: recipe '$recipe_name' not found" >&2 - fi + rm -rf "${ROOT}/$recipe_path/target/${TARGET}" done diff --git a/config.sh b/config.sh index f3a3b2de4..71131eb89 100755 --- a/config.sh +++ b/config.sh @@ -14,7 +14,6 @@ fi # Automatic variables ROOT="$(cd `dirname "$0"` && pwd)" -REPO="$ROOT/repo/$TARGET" export PATH="${ROOT}/bin:$PATH" export AR="${HOST}-gcc-ar" @@ -43,26 +42,11 @@ export PKG_CONFIG_FOR_BUILD="pkg-config" if [[ "$OSTYPE" == "darwin"* ]] || [[ "$OSTYPE" == "FreeBSD" ]]; then # GNU find FIND="gfind"; - - # GNU stat from Homebrew or MacPorts - if [ ! -z "$(which brew)" ]; then - STAT="$(brew --prefix)/opt/coreutils/libexec/gnubin/stat"; - elif [ ! -z "$(which port)" ]; then - # TODO: find a programatic way of asking MacPorts for it's root dir. - STAT="/opt/local/opt/coreutils/libexec/gnubin/stat"; - elif [ ! -z "$(which pkg)" ]; then - STAT="gnustat" - else - echo "Please install either Homebrew or MacPorts and run the boostrap script." - exit 1 - fi else - FIND="find" - STAT="stat"; + FIND="find"; fi export FIND -export STAT if [ ! "$(uname -s)" = "Redox" ] then diff --git a/repo.sh b/repo.sh index 8869c0e7b..99ec7f272 100755 --- a/repo.sh +++ b/repo.sh @@ -36,20 +36,11 @@ fi for recipe in $recipes do - recipe_path=`target/release/find_recipe $recipe` - COOKBOOK_RECIPE="$recipe_path" - TARGET_DIR="${COOKBOOK_RECIPE}/target/${TARGET}" - COOKBOOK_BUILD="${TARGET_DIR}/build" - COOKBOOK_STAGE="${TARGET_DIR}/stage" - COOKBOOK_SOURCE="${COOKBOOK_RECIPE}/source" - COOKBOOK_SYSROOT="${TARGET_DIR}/sysroot" - target/release/cook $COOK_OPT "$recipe" done -mkdir -p "$REPO" - -declare -A APPSTREAM_SOURCES +repo="$ROOT/repo/$TARGET" +mkdir -p "$repo" # Runtime dependencies include both `[package.dependencies]` and dynamically # linked packages discovered by auto_deps. @@ -58,4 +49,4 @@ declare -A APPSTREAM_SOURCES # well. recipes="$recipes $(target/release/pkg_deps $recipes)" -target/release/repo_builder "$REPO" $recipes +target/release/repo_builder "$repo" $recipes From 87699a364e132b4c55d3347cea3ce14f3c2b7777 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Tue, 2 Sep 2025 20:43:39 +0200 Subject: [PATCH 06/33] Only accept recipe name in shell scripts Rather than recipe path. --- clean.sh | 12 +++--------- fetch.sh | 10 +--------- unfetch.sh | 13 ++++--------- 3 files changed, 8 insertions(+), 27 deletions(-) diff --git a/clean.sh b/clean.sh index 45c2e14a3..e26dba32a 100755 --- a/clean.sh +++ b/clean.sh @@ -5,20 +5,14 @@ source config.sh if [ $# = 0 ] then - recipes="$(target/release/list_recipes)" + recipes="$(target/release/list_recipes --short)" else recipes="$@" fi -for recipe in $recipes +for recipe_name in $recipes do - if (echo "$recipe" | grep '.*/.*' >/dev/null); then - recipe_name=$(basename "$recipe") - recipe_path="$recipe" - else - recipe_name="$recipe" - recipe_path=`target/release/find_recipe $recipe` - fi + recipe_path=`target/release/find_recipe $recipe_name` echo -e "\033[01;38;5;215mcook - clean $recipe_name\033[0m" rm -rf "${ROOT}/$recipe_path/target/${TARGET}" diff --git a/fetch.sh b/fetch.sh index a3bc69c76..1ca153c51 100755 --- a/fetch.sh +++ b/fetch.sh @@ -22,15 +22,7 @@ then recipes="$(target/release/list_recipes)" fi -for recipe_path in $recipes +for recipe_name in $recipes do - if (echo "$recipe_path" | grep '.*/.*' >/dev/null); then - recipe_name=$(basename "$recipe_path") - recipe_path="$recipe_path" - else - recipe_name="$recipe_path" - recipe_path=`target/release/find_recipe $recipe_name` - fi - target/release/cook --fetch-only "$recipe_name" done diff --git a/unfetch.sh b/unfetch.sh index d8016a05f..6763ff824 100755 --- a/unfetch.sh +++ b/unfetch.sh @@ -5,21 +5,16 @@ source config.sh if [ $# = 0 ] then - recipes="$(target/release/list_recipes)" + recipes="$(target/release/list_recipes --short)" else recipes="$@" fi -for recipe in $recipes +for recipe_name in $recipes do - if (echo "$recipe" | grep '.*/.*' >/dev/null); then - recipe_name=$(basename "$recipe") - recipe_path="$recipe" - else - recipe_name="$recipe" - recipe_path=`target/release/find_recipe $recipe` - fi + recipe_path=`target/release/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 done From 7388bc9d0170e2dd29e64e7fca39bb39bee12a22 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Tue, 2 Sep 2025 20:46:36 +0200 Subject: [PATCH 07/33] Don't allow empty package list in fetch.sh and repo.sh --- fetch.sh | 5 ----- repo.sh | 5 ----- 2 files changed, 10 deletions(-) diff --git a/fetch.sh b/fetch.sh index 1ca153c51..a6b7b67cf 100755 --- a/fetch.sh +++ b/fetch.sh @@ -17,11 +17,6 @@ do fi done -if [ "$recipes" == "" ] -then - recipes="$(target/release/list_recipes)" -fi - for recipe_name in $recipes do target/release/cook --fetch-only "$recipe_name" diff --git a/repo.sh b/repo.sh index 99ec7f272..c0125c978 100755 --- a/repo.sh +++ b/repo.sh @@ -29,11 +29,6 @@ do fi done -if [ "$recipes" == "" ] -then - recipes="$(target/release/list_recipes)" -fi - for recipe in $recipes do target/release/cook $COOK_OPT "$recipe" From 13d9e4794f761f8e53e91b783125ceaf5ed33e15 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Tue, 2 Sep 2025 20:52:44 +0200 Subject: [PATCH 08/33] Move handling of multiple recipes into cook --- fetch.sh | 10 ++-------- repo.sh | 12 +++--------- src/bin/cook.rs | 12 ++++++++---- 3 files changed, 13 insertions(+), 21 deletions(-) diff --git a/fetch.sh b/fetch.sh index a6b7b67cf..dd7481ae8 100755 --- a/fetch.sh +++ b/fetch.sh @@ -6,10 +6,7 @@ source config.sh recipes="" for arg in "${@:1}" do - if [ "$arg" == "--nonstop" ] - then - set +e - elif [ "$arg" == "--offline" ] + if [ "$arg" == "--offline" ] then export COOKBOOK_OFFLINE="1" else @@ -17,7 +14,4 @@ do fi done -for recipe_name in $recipes -do - target/release/cook --fetch-only "$recipe_name" -done +target/release/cook --fetch-only $recipes diff --git a/repo.sh b/repo.sh index c0125c978..5e0f98810 100755 --- a/repo.sh +++ b/repo.sh @@ -12,15 +12,12 @@ do if [ "$arg" == "--appstream" ] then APPSTREAM="1" - elif [ "$arg" == "--debug" ] - then - DEBUG=--debug elif [ "$arg" == "--with-package-deps" ] then - COOK_OPT=--with-package-deps + COOK_OPT+=" --with-package-deps" elif [ "$arg" == "--nonstop" ] then - set +e + COOK_OPT+=" --nonstop" elif [ "$arg" == "--offline" ] then export COOKBOOK_OFFLINE="1" @@ -29,10 +26,7 @@ do fi done -for recipe in $recipes -do - target/release/cook $COOK_OPT "$recipe" -done +target/release/cook $COOK_OPT $recipes repo="$ROOT/repo/$TARGET" mkdir -p "$repo" diff --git a/src/bin/cook.rs b/src/bin/cook.rs index ca2e4484b..70a186a3f 100644 --- a/src/bin/cook.rs +++ b/src/bin/cook.rs @@ -928,7 +928,7 @@ EOF -Wno-dev \ "${COOKBOOK_CMAKE_FLAGS[@]}" \ "$@" - + "${COOKBOOK_NINJA}" -j"${COOKBOOK_MAKE_JOBS}" DESTDIR="${COOKBOOK_STAGE}" "${COOKBOOK_NINJA}" install -j"${COOKBOOK_MAKE_JOBS}" } @@ -996,7 +996,7 @@ function cookbook_meson { let post_script = r#"# Common post script # Strip binaries -for dir in "${COOKBOOK_STAGE}/bin" "${COOKBOOK_STAGE}/usr/bin" +for dir in "${COOKBOOK_STAGE}/bin" "${COOKBOOK_STAGE}/usr/bin" do if [ -d "${dir}" ] && [ -z "${COOKBOOK_NOSTRIP}" ] then @@ -1005,7 +1005,7 @@ do done # Remove libtool files -for dir in "${COOKBOOK_STAGE}/lib" "${COOKBOOK_STAGE}/usr/lib" +for dir in "${COOKBOOK_STAGE}/lib" "${COOKBOOK_STAGE}/usr/lib" do if [ -d "${dir}" ] then @@ -1282,6 +1282,7 @@ fn main() { let mut fetch_only = false; let mut with_package_deps = false; let mut quiet = false; + let mut nonstop = false; let mut recipe_names = Vec::new(); for arg in env::args().skip(1) { match arg.as_str() { @@ -1290,6 +1291,7 @@ fn main() { "--with-package-deps" if matching => with_package_deps = true, "--fetch-only" if matching => fetch_only = true, "-q" | "--quiet" if matching => quiet = true, + "--nonstop" => nonstop = true, _ => recipe_names.push(arg.try_into().expect("Invalid package name")), } } @@ -1370,7 +1372,9 @@ fn main() { style::Reset, err, ); - process::exit(1); + if !nonstop { + process::exit(1); + } } } } From 70fba227648048eab36c695495ad5fc67e8cbc5f Mon Sep 17 00:00:00 2001 From: Wildan Mubarok Date: Thu, 4 Sep 2025 11:48:00 +0000 Subject: [PATCH 09/33] Use fork instead --- recipes/wip/dev/lang/zig/01_redox.patch | 83 ------------------------- recipes/wip/dev/lang/zig/recipe.toml | 23 ++++--- 2 files changed, 14 insertions(+), 92 deletions(-) delete mode 100644 recipes/wip/dev/lang/zig/01_redox.patch diff --git a/recipes/wip/dev/lang/zig/01_redox.patch b/recipes/wip/dev/lang/zig/01_redox.patch deleted file mode 100644 index 093eb2f41..000000000 --- a/recipes/wip/dev/lang/zig/01_redox.patch +++ /dev/null @@ -1,83 +0,0 @@ -diff -ruwN source/build.zig source-new/build.zig ---- source/build.zig 2025-05-23 11:31:41 -+++ source-new/build.zig 2025-08-04 17:06:57 -@@ -802,7 +802,7 @@ - try addCxxKnownPath(b, cfg, exe, b.fmt("libstdc++.{s}", .{lib_suffix}), null, need_cpp_includes); - try addCxxKnownPath(b, cfg, exe, b.fmt("libgcc_eh.{s}", .{lib_suffix}), null, need_cpp_includes); - }, -- .haiku => { -+ .haiku, .redox => { - try addCxxKnownPath(b, cfg, exe, b.fmt("libstdc++.{s}", .{lib_suffix}), null, need_cpp_includes); - }, - else => {}, -diff -ruwN source/lib/std/Target.zig source-new/lib/std/Target.zig ---- source/lib/std/Target.zig 2025-05-23 11:31:41 -+++ source-new/lib/std/Target.zig 2025-08-04 16:59:08 -@@ -29,6 +29,7 @@ - hurd, - linux, - plan9, -+ redox, - rtems, - serenity, - zos, -@@ -904,6 +905,7 @@ - .fuchsia, - .hermit, - .plan9, -+ .redox, - .serenity, - .zos, - .dragonfly, -@@ -2435,6 +2437,16 @@ - else - "/usr", - }) else none, -+ -+ .redox => switch (cpu.arch) { -+ .x86, -+ => init("/usr/lib/ld.so.1"), -+ .aarch64, -+ .riscv64, -+ .x86_64, -+ => init("/usr/lib/ld64.so.1"), -+ else => none, -+ }, - - .freebsd => switch (cpu.arch) { - .arm, -diff -ruwN source/test/llvm_targets.zig source-new/test/llvm_targets.zig ---- source/test/llvm_targets.zig 2025-05-23 11:31:41 -+++ source-new/test/llvm_targets.zig 2025-08-04 17:02:56 -@@ -20,6 +20,7 @@ - .{ .cpu_arch = .aarch64, .os_tag = .macos, .abi = .none }, - .{ .cpu_arch = .aarch64, .os_tag = .netbsd, .abi = .none }, - .{ .cpu_arch = .aarch64, .os_tag = .openbsd, .abi = .none }, -+ .{ .cpu_arch = .aarch64, .os_tag = .redox, .abi = .none }, - .{ .cpu_arch = .aarch64, .os_tag = .rtems, .abi = .none }, - .{ .cpu_arch = .aarch64, .os_tag = .serenity, .abi = .none }, - .{ .cpu_arch = .aarch64, .os_tag = .tvos, .abi = .none }, -@@ -238,6 +239,7 @@ - .{ .cpu_arch = .riscv64, .os_tag = .linux, .abi = .none }, - .{ .cpu_arch = .riscv64, .os_tag = .netbsd, .abi = .none }, - .{ .cpu_arch = .riscv64, .os_tag = .openbsd, .abi = .none }, -+ .{ .cpu_arch = .riscv64, .os_tag = .redox, .abi = .none }, - .{ .cpu_arch = .riscv64, .os_tag = .rtems, .abi = .none }, - .{ .cpu_arch = .riscv64, .os_tag = .serenity, .abi = .none }, - // .{ .cpu_arch = .riscv64, .os_tag = .uefi, .abi = .none }, -@@ -325,6 +327,7 @@ - .{ .cpu_arch = .x86, .os_tag = .linux, .abi = .none }, - .{ .cpu_arch = .x86, .os_tag = .netbsd, .abi = .none }, - .{ .cpu_arch = .x86, .os_tag = .openbsd, .abi = .none }, -+ .{ .cpu_arch = .x86, .os_tag = .redox, .abi = .none }, - .{ .cpu_arch = .x86, .os_tag = .rtems, .abi = .none }, - .{ .cpu_arch = .x86, .os_tag = .solaris, .abi = .none }, - .{ .cpu_arch = .x86, .os_tag = .uefi, .abi = .none }, -@@ -361,6 +364,7 @@ - .{ .cpu_arch = .x86_64, .os_tag = .macos, .abi = .none }, - .{ .cpu_arch = .x86_64, .os_tag = .netbsd, .abi = .none }, - .{ .cpu_arch = .x86_64, .os_tag = .openbsd, .abi = .none }, -+ .{ .cpu_arch = .x86_64, .os_tag = .redox, .abi = .none }, - .{ .cpu_arch = .x86_64, .os_tag = .rtems, .abi = .none }, - .{ .cpu_arch = .x86_64, .os_tag = .serenity, .abi = .none }, - .{ .cpu_arch = .x86_64, .os_tag = .solaris, .abi = .none }, diff --git a/recipes/wip/dev/lang/zig/recipe.toml b/recipes/wip/dev/lang/zig/recipe.toml index c88b9070f..f5103b296 100644 --- a/recipes/wip/dev/lang/zig/recipe.toml +++ b/recipes/wip/dev/lang/zig/recipe.toml @@ -1,16 +1,21 @@ -#TODO see https://github.com/ziglang/zig/wiki/Building-Zig-From-Source +#TODO requires openat functions and posix_getdents to compile [source] -tar = "https://ziglang.org/download/0.14.1/zig-0.14.1.tar.xz" -patches = [ - "01_redox.patch" -] +git = "https://github.com/willnode/zig" +branch = "zig-0.15-redox" [build] -dependencies = [ - "llvm18" # need lld -] template = "custom" script = """ DYNAMIC_INIT -cookbook_cmake +rsync -av --delete "${COOKBOOK_SOURCE}"/* ./ +export ZIG_BOOTSTRAP_CFLAGS="$CFLAGS" +export ZIG_BOOTSTRAP_LDFLAGS="$LDFLAGS" +export ZIG_BOOTSTRAP_TARGET_CC="${TARGET}-gcc" +export ZIG_HOST_TARGET_TRIPLE="${TARGET%%-*}-redox" +unset AR AS CC CXX LD LDFLAGS NM OBJCOPY OBJDUMP RANLIB READELF RUSTFLAGS STRIP +cc bootstrap.c -o ./bootstrap +./bootstrap + +mkdir -pv "${COOKBOOK_STAGE}/usr/bin" +cp -v "zig2" "${COOKBOOK_STAGE}/usr/bin/zig" """ From 5a666533304d5f6a6a002665c7ea435394b1de45 Mon Sep 17 00:00:00 2001 From: Ribbon Date: Thu, 4 Sep 2025 19:41:36 -0300 Subject: [PATCH 10/33] Add recipes --- recipes/wip/demos/feoxdb/recipe.toml | 8 ++++++++ recipes/wip/demos/genpdf-rs/recipe.toml | 8 ++++++++ recipes/wip/demos/reticulum-rs/recipe.toml | 9 +++++++++ recipes/wip/monitors/socktop/recipe.toml | 8 ++++++++ recipes/wip/net/analysis/angryether-rs/recipe.toml | 5 +++++ recipes/wip/net/remote/bayesian-ssh/recipe.toml | 5 +++++ recipes/wip/net/server/feox-server/recipe.toml | 5 +++++ recipes/wip/office/doxx/recipe.toml | 5 +++++ recipes/wip/security/safecloset/recipe.toml | 5 +++++ recipes/wip/sound/jukebox-cli/recipe.toml | 5 +++++ recipes/wip/sys-info/ffetch/recipe.toml | 5 +++++ 11 files changed, 68 insertions(+) create mode 100644 recipes/wip/demos/feoxdb/recipe.toml create mode 100644 recipes/wip/demos/genpdf-rs/recipe.toml create mode 100644 recipes/wip/demos/reticulum-rs/recipe.toml create mode 100644 recipes/wip/monitors/socktop/recipe.toml create mode 100644 recipes/wip/net/analysis/angryether-rs/recipe.toml create mode 100644 recipes/wip/net/remote/bayesian-ssh/recipe.toml create mode 100644 recipes/wip/net/server/feox-server/recipe.toml create mode 100644 recipes/wip/office/doxx/recipe.toml create mode 100644 recipes/wip/security/safecloset/recipe.toml create mode 100644 recipes/wip/sound/jukebox-cli/recipe.toml create mode 100644 recipes/wip/sys-info/ffetch/recipe.toml diff --git a/recipes/wip/demos/feoxdb/recipe.toml b/recipes/wip/demos/feoxdb/recipe.toml new file mode 100644 index 000000000..84b8e46c4 --- /dev/null +++ b/recipes/wip/demos/feoxdb/recipe.toml @@ -0,0 +1,8 @@ +#TODO not compiled or tested +[source] +git = "https://github.com/mehrantsi/FeOxDB" +[build] +template = "custom" +script = """ +cookbook_cargo_examples basic_usage deterministic_test +""" diff --git a/recipes/wip/demos/genpdf-rs/recipe.toml b/recipes/wip/demos/genpdf-rs/recipe.toml new file mode 100644 index 000000000..20fc1c827 --- /dev/null +++ b/recipes/wip/demos/genpdf-rs/recipe.toml @@ -0,0 +1,8 @@ +#TODO not compiled or tested +[source] +git = "https://git.sr.ht/~ireas/genpdf-rs" +[build] +template = "custom" +script = """ +cookbook_cargo_examples demo +""" diff --git a/recipes/wip/demos/reticulum-rs/recipe.toml b/recipes/wip/demos/reticulum-rs/recipe.toml new file mode 100644 index 000000000..f4064148a --- /dev/null +++ b/recipes/wip/demos/reticulum-rs/recipe.toml @@ -0,0 +1,9 @@ +#TODO not compiled or tested +# the protobuf compiler needs to be installed +[source] +git = "https://github.com/BeechatNetworkSystemsLtd/Reticulum-rs" +[build] +template = "custom" +script = """ +cookbook_cargo_examples tcp_client kaonic_client +""" diff --git a/recipes/wip/monitors/socktop/recipe.toml b/recipes/wip/monitors/socktop/recipe.toml new file mode 100644 index 000000000..ab499e0e9 --- /dev/null +++ b/recipes/wip/monitors/socktop/recipe.toml @@ -0,0 +1,8 @@ +#TODO not compiled or tested +[source] +git = "https://github.com/jasonwitty/socktop" +[build] +template = "custom" +script = """ +cookbook_cargo_packages socktop socktop_agent +""" diff --git a/recipes/wip/net/analysis/angryether-rs/recipe.toml b/recipes/wip/net/analysis/angryether-rs/recipe.toml new file mode 100644 index 000000000..e780647da --- /dev/null +++ b/recipes/wip/net/analysis/angryether-rs/recipe.toml @@ -0,0 +1,5 @@ +#TODO not compiled or tested +[source] +git = "https://github.com/pg3uk/AngryEtherRust" +[build] +template = "cargo" diff --git a/recipes/wip/net/remote/bayesian-ssh/recipe.toml b/recipes/wip/net/remote/bayesian-ssh/recipe.toml new file mode 100644 index 000000000..2b0c18fcf --- /dev/null +++ b/recipes/wip/net/remote/bayesian-ssh/recipe.toml @@ -0,0 +1,5 @@ +#TODO not compiled or tested +[source] +git = "https://github.com/abdoufermat5/bayesian-ssh" +[build] +template = "cargo" diff --git a/recipes/wip/net/server/feox-server/recipe.toml b/recipes/wip/net/server/feox-server/recipe.toml new file mode 100644 index 000000000..c2aa744df --- /dev/null +++ b/recipes/wip/net/server/feox-server/recipe.toml @@ -0,0 +1,5 @@ +#TODO not compiled or tested +[source] +git = "https://github.com/mehrantsi/feox-server" +[build] +template = "cargo" diff --git a/recipes/wip/office/doxx/recipe.toml b/recipes/wip/office/doxx/recipe.toml new file mode 100644 index 000000000..4375cd1e9 --- /dev/null +++ b/recipes/wip/office/doxx/recipe.toml @@ -0,0 +1,5 @@ +#TODO not compiled or tested +[source] +git = "https://github.com/bgreenwell/doxx" +[build] +template = "cargo" diff --git a/recipes/wip/security/safecloset/recipe.toml b/recipes/wip/security/safecloset/recipe.toml new file mode 100644 index 000000000..4617d7afc --- /dev/null +++ b/recipes/wip/security/safecloset/recipe.toml @@ -0,0 +1,5 @@ +#TODO not compiled or tested +[source] +git = "https://github.com/Canop/safecloset" +[build] +template = "cargo" diff --git a/recipes/wip/sound/jukebox-cli/recipe.toml b/recipes/wip/sound/jukebox-cli/recipe.toml new file mode 100644 index 000000000..f47b45106 --- /dev/null +++ b/recipes/wip/sound/jukebox-cli/recipe.toml @@ -0,0 +1,5 @@ +#TODO not compiled or tested +[source] +git = "https://github.com/FedeCarollo/jukebox-cli" +[build] +template = "cargo" diff --git a/recipes/wip/sys-info/ffetch/recipe.toml b/recipes/wip/sys-info/ffetch/recipe.toml new file mode 100644 index 000000000..8b23aada9 --- /dev/null +++ b/recipes/wip/sys-info/ffetch/recipe.toml @@ -0,0 +1,5 @@ +#TODO not compiled or tested +[source] +git = "https://github.com/0l3d/ffetch" +[build] +template = "cargo" From 04d88c61097a309afef69bc900930f6ebdfb0f13 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Tue, 2 Sep 2025 21:30:57 +0200 Subject: [PATCH 11/33] Replace COOKBOOK_OFFLINE with --offline --- fetch.sh | 13 +------------ repo.sh | 2 +- src/bin/cook.rs | 12 ++++++++++-- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/fetch.sh b/fetch.sh index dd7481ae8..2a1e87a99 100755 --- a/fetch.sh +++ b/fetch.sh @@ -3,15 +3,4 @@ set -e source config.sh -recipes="" -for arg in "${@:1}" -do - if [ "$arg" == "--offline" ] - then - export COOKBOOK_OFFLINE="1" - else - recipes+=" $arg" - fi -done - -target/release/cook --fetch-only $recipes +target/release/cook --fetch-only ${@:1} diff --git a/repo.sh b/repo.sh index 5e0f98810..5fc214215 100755 --- a/repo.sh +++ b/repo.sh @@ -20,7 +20,7 @@ do COOK_OPT+=" --nonstop" elif [ "$arg" == "--offline" ] then - export COOKBOOK_OFFLINE="1" + COOK_OPT+=" --offline" else recipes+=" $arg" fi diff --git a/src/bin/cook.rs b/src/bin/cook.rs index 70a186a3f..7b3f291ab 100644 --- a/src/bin/cook.rs +++ b/src/bin/cook.rs @@ -1237,12 +1237,12 @@ fn cook( name: &PackageName, recipe: &Recipe, fetch_only: bool, + is_offline: bool, ) -> Result<(), String> { if recipe.build.kind == BuildKind::None { return cook_meta(recipe_dir, name, recipe, fetch_only); } - let is_offline = env::var("COOKBOOK_OFFLINE").unwrap_or("".to_string()) == "1"; let source_dir = match is_offline { true => fetch_offline(recipe_dir, &recipe.source), false => fetch(recipe_dir, &recipe.source), @@ -1283,6 +1283,7 @@ fn main() { let mut with_package_deps = false; let mut quiet = false; let mut nonstop = false; + let mut is_offline = false; let mut recipe_names = Vec::new(); for arg in env::args().skip(1) { match arg.as_str() { @@ -1292,6 +1293,7 @@ fn main() { "--fetch-only" if matching => fetch_only = true, "-q" | "--quiet" if matching => quiet = true, "--nonstop" => nonstop = true, + "--offline" => is_offline = true, _ => recipe_names.push(arg.try_into().expect("Invalid package name")), } } @@ -1346,7 +1348,13 @@ fn main() { } Ok(()) } else { - cook(&recipe.dir, &recipe.name, &recipe.recipe, fetch_only) + cook( + &recipe.dir, + &recipe.name, + &recipe.recipe, + fetch_only, + is_offline, + ) }; match res { From 9a40987f616ece3c52fcfe48c0ab51738de4e49b Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Tue, 2 Sep 2025 21:37:38 +0200 Subject: [PATCH 12/33] Use LF as line ending in repo_builder.rs --- src/bin/repo_builder.rs | 328 ++++++++++++++++++++-------------------- 1 file changed, 164 insertions(+), 164 deletions(-) diff --git a/src/bin/repo_builder.rs b/src/bin/repo_builder.rs index 6a7a8a35d..4af35624c 100644 --- a/src/bin/repo_builder.rs +++ b/src/bin/repo_builder.rs @@ -1,164 +1,164 @@ -use pkg::recipes; -use std::collections::{BTreeMap, HashMap}; -use std::env; -use std::fs::{self, File}; -use std::io::{Read, Write}; -use std::path::{Path, PathBuf}; -use std::process::Command; -use toml::Value; - -fn is_newer(src: &Path, dst: &Path) -> bool { - match (fs::metadata(src), fs::metadata(dst)) { - (Ok(src_meta), Ok(dst_meta)) => match (src_meta.modified(), dst_meta.modified()) { - (Ok(src_time), Ok(dst_time)) => src_time > dst_time, - (Ok(_), Err(_)) => true, - _ => false, - }, - (Ok(_), Err(_)) => true, - _ => false, - } -} - -fn main() -> Result<(), Box> { - let mut args = env::args().skip(1); - let repo_dir = args - .next() - .expect("Usage: repo_builder ..."); - let recipe_list: Vec = args.collect(); - let repo_path = Path::new(&repo_dir); - - let mut appstream_sources: HashMap = HashMap::new(); - let mut packages: BTreeMap = BTreeMap::new(); - - // === 1. Push recipes in list === - for recipe in &recipe_list { - let Some(recipe_path) = recipes::find(recipe) else { - eprintln!("recipe {} not found", recipe); - continue; - }; - - let cookbook_recipe = Path::new(&recipe_path); - let target = env::var("TARGET").unwrap_or_else(|_| "x86_64-unknown-linux-gnu".into()); - let stage_dir = cookbook_recipe.join("target").join(&target).join("stage"); - - let pkgar_src = stage_dir.with_extension("pkgar"); - let pkgar_dst = repo_path.join(format!("{}.pkgar", recipe)); - let toml_src = stage_dir.with_extension("toml"); - let toml_dst = repo_path.join(format!("{}.toml", recipe)); - - if is_newer(&toml_src, &toml_dst) { - eprintln!("\x1b[01;38;5;155mrepo - publishing {}\x1b[0m", recipe); - if fs::exists(&pkgar_src)? { - fs::copy(&pkgar_src, &pkgar_dst)?; - } - fs::copy(&toml_src, &toml_dst)?; - } - - if stage_dir.join("usr/share/metainfo").exists() { - appstream_sources.insert(recipe.clone(), stage_dir.clone()); - } - } - - // === 2. Optional AppStream generation === - if env::var("APPSTREAM").ok().as_deref() == Some("1") { - eprintln!("\x1b[01;38;5;155mrepo - generating appstream data\x1b[0m"); - - let root = env::var("ROOT").unwrap_or_else(|_| ".".into()); - let target = env::var("TARGET").unwrap_or_else(|_| "x86_64-unknown-linux-gnu".into()); - let appstream_root = Path::new(&root) - .join("build") - .join(&target) - .join("appstream"); - let appstream_pkg = repo_path.join("appstream.pkgar"); - - fs::remove_dir_all(&appstream_root).ok(); - fs::remove_file(&appstream_pkg).ok(); - fs::create_dir_all(&appstream_root)?; - - if !appstream_sources.is_empty() { - let mut compose_cmd = Command::new("appstreamcli"); - compose_cmd - .arg("compose") - .arg("--origin=pkgar") - .arg(format!("--result-root={}", appstream_root.display())); - - for (_recipe, source_path) in &appstream_sources { - compose_cmd.arg(source_path); - } - - compose_cmd - .status()? - .success() - .then_some(()) - .ok_or("appstreamcli failed")?; - - Command::new("pkgar") - .arg("create") - .arg("--archive") - .arg(&appstream_pkg) - .arg("--skey") - .arg(format!("{}/build/id_ed25519.toml", root)) - .arg(&appstream_root) - .status()? - .success() - .then_some(()) - .ok_or("pkgar create failed")?; - } - } - - eprintln!("\x1b[01;38;5;155mrepo - generating repo.toml\x1b[0m"); - - // === 3. Read and update repo.toml === - let repo_toml_path = repo_path.join("repo.toml"); - if repo_toml_path.exists() { - let mut file = File::open(&repo_toml_path)?; - let mut contents = String::new(); - file.read_to_string(&mut contents)?; - - let parsed: Value = toml::from_str(&contents)?; - if let Some(pkg_table) = parsed.get("packages").and_then(|v| v.as_table()) { - for (k, v) in pkg_table { - if let Some(s) = v.as_str() { - packages.insert(k.clone(), format!("\"{}\"", s)); - } else { - packages.insert(k.clone(), v.to_string()); - } - } - } - } - - for entry in fs::read_dir(&repo_path)? { - let entry = entry?; - let path = entry.path(); - - if path.extension().and_then(|s| s.to_str()) != Some("toml") { - continue; - } - - if path.file_stem().and_then(|s| s.to_str()) == Some("repo") { - continue; - } - - let content = fs::read_to_string(&path)?; - let parsed: Value = toml::from_str(&content)?; - - if let Some(version_val) = parsed.get("version") { - let version_str = version_val.to_string(); // includes quotes - let package_name = path.file_stem().unwrap().to_string_lossy().to_string(); - packages.insert(package_name, version_str); - } else { - eprintln!("Warning: no [version] found in {:?}", path); - } - } - - // FIXME: Use proper TOML serializer - let mut output = String::from("[packages]\n"); - for (name, version) in &packages { - output.push_str(&format!("{name} = {version}\n")); - } - - let mut output_file = File::create(&repo_toml_path)?; - output_file.write_all(output.as_bytes())?; - - Ok(()) -} +use pkg::recipes; +use std::collections::{BTreeMap, HashMap}; +use std::env; +use std::fs::{self, File}; +use std::io::{Read, Write}; +use std::path::{Path, PathBuf}; +use std::process::Command; +use toml::Value; + +fn is_newer(src: &Path, dst: &Path) -> bool { + match (fs::metadata(src), fs::metadata(dst)) { + (Ok(src_meta), Ok(dst_meta)) => match (src_meta.modified(), dst_meta.modified()) { + (Ok(src_time), Ok(dst_time)) => src_time > dst_time, + (Ok(_), Err(_)) => true, + _ => false, + }, + (Ok(_), Err(_)) => true, + _ => false, + } +} + +fn main() -> Result<(), Box> { + let mut args = env::args().skip(1); + let repo_dir = args + .next() + .expect("Usage: repo_builder ..."); + let recipe_list: Vec = args.collect(); + let repo_path = Path::new(&repo_dir); + + let mut appstream_sources: HashMap = HashMap::new(); + let mut packages: BTreeMap = BTreeMap::new(); + + // === 1. Push recipes in list === + for recipe in &recipe_list { + let Some(recipe_path) = recipes::find(recipe) else { + eprintln!("recipe {} not found", recipe); + continue; + }; + + let cookbook_recipe = Path::new(&recipe_path); + let target = env::var("TARGET").unwrap_or_else(|_| "x86_64-unknown-linux-gnu".into()); + let stage_dir = cookbook_recipe.join("target").join(&target).join("stage"); + + let pkgar_src = stage_dir.with_extension("pkgar"); + let pkgar_dst = repo_path.join(format!("{}.pkgar", recipe)); + let toml_src = stage_dir.with_extension("toml"); + let toml_dst = repo_path.join(format!("{}.toml", recipe)); + + if is_newer(&toml_src, &toml_dst) { + eprintln!("\x1b[01;38;5;155mrepo - publishing {}\x1b[0m", recipe); + if fs::exists(&pkgar_src)? { + fs::copy(&pkgar_src, &pkgar_dst)?; + } + fs::copy(&toml_src, &toml_dst)?; + } + + if stage_dir.join("usr/share/metainfo").exists() { + appstream_sources.insert(recipe.clone(), stage_dir.clone()); + } + } + + // === 2. Optional AppStream generation === + if env::var("APPSTREAM").ok().as_deref() == Some("1") { + eprintln!("\x1b[01;38;5;155mrepo - generating appstream data\x1b[0m"); + + let root = env::var("ROOT").unwrap_or_else(|_| ".".into()); + let target = env::var("TARGET").unwrap_or_else(|_| "x86_64-unknown-linux-gnu".into()); + let appstream_root = Path::new(&root) + .join("build") + .join(&target) + .join("appstream"); + let appstream_pkg = repo_path.join("appstream.pkgar"); + + fs::remove_dir_all(&appstream_root).ok(); + fs::remove_file(&appstream_pkg).ok(); + fs::create_dir_all(&appstream_root)?; + + if !appstream_sources.is_empty() { + let mut compose_cmd = Command::new("appstreamcli"); + compose_cmd + .arg("compose") + .arg("--origin=pkgar") + .arg(format!("--result-root={}", appstream_root.display())); + + for (_recipe, source_path) in &appstream_sources { + compose_cmd.arg(source_path); + } + + compose_cmd + .status()? + .success() + .then_some(()) + .ok_or("appstreamcli failed")?; + + Command::new("pkgar") + .arg("create") + .arg("--archive") + .arg(&appstream_pkg) + .arg("--skey") + .arg(format!("{}/build/id_ed25519.toml", root)) + .arg(&appstream_root) + .status()? + .success() + .then_some(()) + .ok_or("pkgar create failed")?; + } + } + + eprintln!("\x1b[01;38;5;155mrepo - generating repo.toml\x1b[0m"); + + // === 3. Read and update repo.toml === + let repo_toml_path = repo_path.join("repo.toml"); + if repo_toml_path.exists() { + let mut file = File::open(&repo_toml_path)?; + let mut contents = String::new(); + file.read_to_string(&mut contents)?; + + let parsed: Value = toml::from_str(&contents)?; + if let Some(pkg_table) = parsed.get("packages").and_then(|v| v.as_table()) { + for (k, v) in pkg_table { + if let Some(s) = v.as_str() { + packages.insert(k.clone(), format!("\"{}\"", s)); + } else { + packages.insert(k.clone(), v.to_string()); + } + } + } + } + + for entry in fs::read_dir(&repo_path)? { + let entry = entry?; + let path = entry.path(); + + if path.extension().and_then(|s| s.to_str()) != Some("toml") { + continue; + } + + if path.file_stem().and_then(|s| s.to_str()) == Some("repo") { + continue; + } + + let content = fs::read_to_string(&path)?; + let parsed: Value = toml::from_str(&content)?; + + if let Some(version_val) = parsed.get("version") { + let version_str = version_val.to_string(); // includes quotes + let package_name = path.file_stem().unwrap().to_string_lossy().to_string(); + packages.insert(package_name, version_str); + } else { + eprintln!("Warning: no [version] found in {:?}", path); + } + } + + // FIXME: Use proper TOML serializer + let mut output = String::from("[packages]\n"); + for (name, version) in &packages { + output.push_str(&format!("{name} = {version}\n")); + } + + let mut output_file = File::create(&repo_toml_path)?; + output_file.write_all(output.as_bytes())?; + + Ok(()) +} From ee25a707f83dce0afbc856e067dd65a80a4501a5 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Wed, 3 Sep 2025 18:22:41 +0200 Subject: [PATCH 13/33] Remove pkg_deps binary --- repo.sh | 7 ------- src/bin/pkg_deps.rs | 22 ---------------------- src/bin/repo_builder.rs | 17 +++++++++++++++-- 3 files changed, 15 insertions(+), 31 deletions(-) delete mode 100644 src/bin/pkg_deps.rs diff --git a/repo.sh b/repo.sh index 5fc214215..f24580057 100755 --- a/repo.sh +++ b/repo.sh @@ -31,11 +31,4 @@ target/release/cook $COOK_OPT $recipes repo="$ROOT/repo/$TARGET" mkdir -p "$repo" -# Runtime dependencies include both `[package.dependencies]` and dynamically -# linked packages discovered by auto_deps. -# -# The following adds the package dependencies of the recipes to the repo as -# well. -recipes="$recipes $(target/release/pkg_deps $recipes)" - target/release/repo_builder "$repo" $recipes diff --git a/src/bin/pkg_deps.rs b/src/bin/pkg_deps.rs deleted file mode 100644 index 4fddb79d9..000000000 --- a/src/bin/pkg_deps.rs +++ /dev/null @@ -1,22 +0,0 @@ -use std::env::args; - -use pkg::{ - package::{Package, PackageError}, - PackageName, -}; - -use cookbook::WALK_DEPTH; - -fn main() -> Result<(), PackageError> { - let names: Vec = args() - .skip(1) - .map(PackageName::new) - .collect::>()?; - - let packages = Package::new_recursive(&names, WALK_DEPTH)?; - for package in packages { - println!("{}", package.name); - } - - Ok(()) -} diff --git a/src/bin/repo_builder.rs b/src/bin/repo_builder.rs index 4af35624c..d903bfd13 100644 --- a/src/bin/repo_builder.rs +++ b/src/bin/repo_builder.rs @@ -1,4 +1,5 @@ -use pkg::recipes; +use cookbook::WALK_DEPTH; +use pkg::{recipes, Package, PackageName}; use std::collections::{BTreeMap, HashMap}; use std::env; use std::fs::{self, File}; @@ -24,9 +25,21 @@ fn main() -> Result<(), Box> { let repo_dir = args .next() .expect("Usage: repo_builder ..."); - let recipe_list: Vec = args.collect(); let repo_path = Path::new(&repo_dir); + // Runtime dependencies include both `[package.dependencies]` and dynamically + // linked packages discovered by auto_deps. + // + // The following adds the package dependencies of the recipes to the repo as + // well. + let recipe_list = Package::new_recursive( + &args.map(PackageName::new).collect::, _>>()?, + WALK_DEPTH, + )? + .into_iter() + .map(|pkg| pkg.name.as_str().to_owned()) + .collect::>(); + let mut appstream_sources: HashMap = HashMap::new(); let mut packages: BTreeMap = BTreeMap::new(); From 5dc9b3a5933c4f125c2a85df0dc0aafe7208003f Mon Sep 17 00:00:00 2001 From: Wildan Mubarok Date: Sat, 6 Sep 2025 17:58:56 +0000 Subject: [PATCH 14/33] OpenSSH daemon support --- recipes/wip/ssh/openssh/recipe.toml | 31 +- recipes/wip/ssh/openssh/redox.patch | 424 +++++++++++++++++++++++++++- 2 files changed, 437 insertions(+), 18 deletions(-) diff --git a/recipes/wip/ssh/openssh/recipe.toml b/recipes/wip/ssh/openssh/recipe.toml index 26ed0f91f..85798b1df 100644 --- a/recipes/wip/ssh/openssh/recipe.toml +++ b/recipes/wip/ssh/openssh/recipe.toml @@ -1,6 +1,7 @@ -#TODO compiled but not tested -#TODO lack of utmpx.h and resolv.h, expect dns not working -#TODO maybe actually implement utmpx.h in relibc? +#TODO lack of resolv.h, expect dns not working +#TODO lack of utmpx.h, expect no way to track login in sshd +#TODO lack of an equivalent to shadow.h, expect sshd password not working +#TODO lack of openssl support, use only ssh-keygen from redox [source] tar = "https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.8p1.tar.gz" patches = [ @@ -9,12 +10,34 @@ patches = [ [build] template = "custom" dependencies = [ - "openssl1", "zlib", ] script = """ DYNAMIC_INIT +COOKBOOK_CONFIGURE_FLAGS+=( + --disable-strip +# requires openssl 1.1.1, result in libcrypto error otherwise + --without-openssl +) cookbook_configure mv "${COOKBOOK_STAGE}"/usr/sbin/sshd "${COOKBOOK_STAGE}"/usr/bin/sshd rmdir "${COOKBOOK_STAGE}"/usr/sbin + +# Extracted from `make host-key-force` +# TODO: Very insecure! but there's no postscript yet +ssh-keygen -t dsa -f "${COOKBOOK_STAGE}"/usr/etc/ssh_host_dsa_key -N "" +ssh-keygen -t rsa -f "${COOKBOOK_STAGE}"/usr/etc/ssh_host_rsa_key -N "" +ssh-keygen -t ed25519 -f "${COOKBOOK_STAGE}"/usr/etc/ssh_host_ed25519_key -N "" +ssh-keygen -t ecdsa -f "${COOKBOOK_STAGE}"/usr/etc/ssh_host_ecdsa_key -N "" + +# The config can be found here, not /etc +CONFIG_FILE="${COOKBOOK_STAGE}"/usr/etc/sshd_config +sed -i "s/#LogLevel INFO/LogLevel DEBUG3/g" "${CONFIG_FILE}" + +# ipv6 is not working yet +sed -i "s/#AddressFamily any/AddressFamily inet/g" "${CONFIG_FILE}" +# hardcoded to 0.0.0.0 in patches +sed -i "s/#ListenAddress 0.0.0.0/ListenAddress 0.0.0.0/g" "${CONFIG_FILE}" +# will never work +sed -i "s/#PasswordAuthentication yes/PasswordAuthentication no/g" "${CONFIG_FILE}" """ diff --git a/recipes/wip/ssh/openssh/redox.patch b/recipes/wip/ssh/openssh/redox.patch index e1b43cae3..153e9cda2 100644 --- a/recipes/wip/ssh/openssh/redox.patch +++ b/recipes/wip/ssh/openssh/redox.patch @@ -1,6 +1,20 @@ +diff -ruwN source/configure source-new/configure +--- source/configure 2024-07-01 11:36:28.000000000 +0700 ++++ source-new/configure 2025-09-06 23:54:58.147442355 +0700 +@@ -12606,6 +12606,10 @@ + printf "%s\n" "#define BROKEN_POLL 1" >>confdefs.h + + ;; ++*-*-redox) ++ ++ # todo ++ ;; + mips-sony-bsd|mips-sony-newsos4) + + printf "%s\n" "#define NEED_SETPGRP 1" >>confdefs.h diff -ruwN source/defines.h source-new/defines.h --- source/defines.h 2024-07-01 11:36:28.000000000 +0700 -+++ source-new/defines.h 2025-08-20 13:37:45.820728226 +0700 ++++ source-new/defines.h 2025-09-06 21:22:46.327552147 +0700 @@ -52,6 +52,18 @@ #define IPPORT_RESERVED 0 #endif @@ -49,9 +63,14 @@ diff -ruwN source/defines.h source-new/defines.h /* Define this to be the path of the xauth program. */ #ifdef XAUTH_PATH #define _PATH_XAUTH XAUTH_PATH +@@ -943,3 +957,4 @@ + # define USE_SNTRUP761X25519 1 + #endif + #endif /* _DEFINES_H */ ++ diff -ruwN source/hostfile.c source-new/hostfile.c --- source/hostfile.c 2024-07-01 11:36:28.000000000 +0700 -+++ source-new/hostfile.c 2025-08-20 11:51:28.964103232 +0700 ++++ source-new/hostfile.c 2025-09-06 21:09:36.555438339 +0700 @@ -44,7 +44,9 @@ #include @@ -64,7 +83,7 @@ diff -ruwN source/hostfile.c source-new/hostfile.c #include diff -ruwN source/loginrec.c source-new/loginrec.c --- source/loginrec.c 2024-07-01 11:36:28.000000000 +0700 -+++ source-new/loginrec.c 2025-08-20 13:43:02.970560664 +0700 ++++ source-new/loginrec.c 2025-09-06 21:09:36.556438304 +0700 @@ -1033,7 +1033,7 @@ return (0); } @@ -76,7 +95,7 @@ diff -ruwN source/loginrec.c source-new/loginrec.c } diff -ruwN source/loginrec.h source-new/loginrec.h --- source/loginrec.h 2024-07-01 11:36:28.000000000 +0700 -+++ source-new/loginrec.h 2025-08-20 13:39:08.570682776 +0700 ++++ source-new/loginrec.h 2025-09-06 21:09:36.556438304 +0700 @@ -30,6 +30,7 @@ **/ @@ -85,9 +104,56 @@ diff -ruwN source/loginrec.h source-new/loginrec.h struct ssh; +diff -ruwN source/misc.c source-new/misc.c +--- source/misc.c 2024-07-01 11:36:28.000000000 +0700 ++++ source-new/misc.c 2025-09-06 21:09:36.556438304 +0700 +@@ -2843,7 +2843,7 @@ + error("%s: dup2: %s", tag, strerror(errno)); + _exit(1); + } +- closefrom(STDERR_FILENO + 1); ++ // closefrom(STDERR_FILENO + 1); + + if (geteuid() == 0 && + initgroups(pw->pw_name, pw->pw_gid) == -1) { +diff -ruwN source/monitor.c source-new/monitor.c +--- source/monitor.c 2024-07-01 11:36:28.000000000 +0700 ++++ source-new/monitor.c 2025-09-07 00:46:23.435378053 +0700 +@@ -484,18 +484,19 @@ + pfd[0].events = POLLIN; + pfd[1].fd = pmonitor->m_log_recvfd; + pfd[1].events = pfd[1].fd == -1 ? 0 : POLLIN; +- if (poll(pfd, pfd[1].fd == -1 ? 1 : 2, -1) == -1) { ++ // redox can't handle timeout -1 (the poll stuck) ++ if (poll(pfd, pfd[1].fd == -1 ? 1 : 2, 1000) == -1) { + if (errno == EINTR || errno == EAGAIN) + continue; + fatal_f("poll: %s", strerror(errno)); + } + if (pfd[1].revents) { ++ + /* + * Drain all log messages before processing next + * monitor request. + */ + monitor_read_log(pmonitor); +- continue; + } + if (pfd[0].revents) + break; /* Continues below */ +@@ -1577,7 +1578,8 @@ + res = pty_allocate(&s->ptyfd, &s->ttyfd, s->tty, sizeof(s->tty)); + if (res == 0) + goto error; +- pty_setowner(authctxt->pw, s->tty); ++ // non sense in redox ++ // pty_setowner(authctxt->pw, s->tty); + + if ((r = sshbuf_put_u32(m, 1)) != 0 || + (r = sshbuf_put_cstring(m, s->tty)) != 0) diff -ruwN source/openbsd-compat/bsd-statvfs.h source-new/openbsd-compat/bsd-statvfs.h --- source/openbsd-compat/bsd-statvfs.h 2024-07-01 11:36:28.000000000 +0700 -+++ source-new/openbsd-compat/bsd-statvfs.h 2025-08-20 13:37:42.000730245 +0700 ++++ source-new/openbsd-compat/bsd-statvfs.h 2025-09-06 21:09:36.556438304 +0700 @@ -37,13 +37,6 @@ typedef unsigned long fsfilcnt_t; #endif @@ -104,7 +170,7 @@ diff -ruwN source/openbsd-compat/bsd-statvfs.h source-new/openbsd-compat/bsd-sta unsigned long f_bsize; /* File system block size. */ diff -ruwN source/openbsd-compat/getrrsetbyname.c source-new/openbsd-compat/getrrsetbyname.c --- source/openbsd-compat/getrrsetbyname.c 2024-07-01 11:36:28.000000000 +0700 -+++ source-new/openbsd-compat/getrrsetbyname.c 2025-08-20 13:51:15.020299084 +0700 ++++ source-new/openbsd-compat/getrrsetbyname.c 2025-09-06 21:09:36.556438304 +0700 @@ -67,6 +67,52 @@ #endif #define _THREAD_PRIVATE(a,b,c) (c) @@ -232,7 +298,7 @@ diff -ruwN source/openbsd-compat/getrrsetbyname.c source-new/openbsd-compat/getr free_dns_rr(head); diff -ruwN source/openbsd-compat/getrrsetbyname.h source-new/openbsd-compat/getrrsetbyname.h --- source/openbsd-compat/getrrsetbyname.h 2024-07-01 11:36:28.000000000 +0700 -+++ source-new/openbsd-compat/getrrsetbyname.h 2025-08-20 11:51:00.744118526 +0700 ++++ source-new/openbsd-compat/getrrsetbyname.h 2025-09-06 21:09:36.557438268 +0700 @@ -54,9 +54,13 @@ #include @@ -249,7 +315,7 @@ diff -ruwN source/openbsd-compat/getrrsetbyname.h source-new/openbsd-compat/getr #define HFIXEDSZ 12 diff -ruwN source/openbsd-compat/inet_ntop.c source-new/openbsd-compat/inet_ntop.c --- source/openbsd-compat/inet_ntop.c 2024-07-01 11:36:28.000000000 +0700 -+++ source-new/openbsd-compat/inet_ntop.c 2025-08-20 11:39:15.244488902 +0700 ++++ source-new/openbsd-compat/inet_ntop.c 2025-09-06 21:09:36.557438268 +0700 @@ -26,7 +26,9 @@ #include #include @@ -262,7 +328,7 @@ diff -ruwN source/openbsd-compat/inet_ntop.c source-new/openbsd-compat/inet_ntop #include diff -ruwN source/openbsd-compat/openbsd-compat.h source-new/openbsd-compat/openbsd-compat.h --- source/openbsd-compat/openbsd-compat.h 2024-07-01 11:36:28.000000000 +0700 -+++ source-new/openbsd-compat/openbsd-compat.h 2025-08-20 13:15:22.721439992 +0700 ++++ source-new/openbsd-compat/openbsd-compat.h 2025-09-06 21:09:36.557438268 +0700 @@ -36,6 +36,8 @@ #include /* for wchar_t */ @@ -274,7 +340,7 @@ diff -ruwN source/openbsd-compat/openbsd-compat.h source-new/openbsd-compat/open #include "sigact.h" diff -ruwN source/openbsd-compat/utmpx.c source-new/openbsd-compat/utmpx.c --- source/openbsd-compat/utmpx.c 1970-01-01 07:00:00.000000000 +0700 -+++ source-new/openbsd-compat/utmpx.c 2025-08-20 13:13:54.971486065 +0700 ++++ source-new/openbsd-compat/utmpx.c 2025-09-06 21:09:36.557438268 +0700 @@ -0,0 +1,13 @@ +#include "utmpx.h" +#include // For NULL @@ -292,7 +358,7 @@ diff -ruwN source/openbsd-compat/utmpx.c source-new/openbsd-compat/utmpx.c \ No newline at end of file diff -ruwN source/openbsd-compat/utmpx.h source-new/openbsd-compat/utmpx.h --- source/openbsd-compat/utmpx.h 1970-01-01 07:00:00.000000000 +0700 -+++ source-new/openbsd-compat/utmpx.h 2025-08-20 13:13:07.201511825 +0700 ++++ source-new/openbsd-compat/utmpx.h 2025-09-06 21:09:36.557438268 +0700 @@ -0,0 +1,69 @@ +#ifndef _COMPAT_UTMPX_H +#define _COMPAT_UTMPX_H @@ -364,9 +430,54 @@ diff -ruwN source/openbsd-compat/utmpx.h source-new/openbsd-compat/utmpx.h +#endif /* __redox__ */ +#endif /* _COMPAT_UTMPX_H */ \ No newline at end of file +diff -ruwN source/pathnames.h source-new/pathnames.h +--- source/pathnames.h 2024-07-01 11:36:28.000000000 +0700 ++++ source-new/pathnames.h 2025-09-06 21:09:36.557438268 +0700 +@@ -12,7 +12,7 @@ + * called by a name other than "ssh" or "Secure Shell". + */ + +-#define ETCDIR "/etc" ++#define ETCDIR "/usr/etc" + + #ifndef SSHDIR + #define SSHDIR ETCDIR "/ssh" +@@ -166,7 +166,7 @@ + + /* chroot directory for unprivileged user when UsePrivilegeSeparation=yes */ + #ifndef _PATH_PRIVSEP_CHROOT_DIR +-#define _PATH_PRIVSEP_CHROOT_DIR "/var/empty" ++#define _PATH_PRIVSEP_CHROOT_DIR "/usr/var/empty" + #endif + + /* for passwd change */ +diff -ruwN source/readconf.c source-new/readconf.c +--- source/readconf.c 2024-07-01 11:36:28.000000000 +0700 ++++ source-new/readconf.c 2025-09-06 21:09:36.558438233 +0700 +@@ -554,7 +554,7 @@ + + if (stdfd_devnull(1, 1, 0) == -1) + fatal_f("stdfd_devnull failed"); +- closefrom(STDERR_FILENO + 1); ++ // closefrom(STDERR_FILENO + 1); + + argv[0] = shell; + argv[1] = "-c"; +diff -ruwN source/readpass.c source-new/readpass.c +--- source/readpass.c 2024-07-01 11:36:28.000000000 +0700 ++++ source-new/readpass.c 2025-09-06 21:09:36.558438233 +0700 +@@ -278,7 +278,7 @@ + if (pid == 0) { + if (stdfd_devnull(1, 1, 0) == -1) + fatal_f("stdfd_devnull failed"); +- closefrom(STDERR_FILENO + 1); ++ // closefrom(STDERR_FILENO + 1); + setenv("SSH_ASKPASS_PROMPT", "none", 1); /* hint to UI */ + execlp(askpass, askpass, prompt, (char *)NULL); + error_f("exec(%s): %s", askpass, strerror(errno)); diff -ruwN source/regress/netcat.c source-new/regress/netcat.c --- source/regress/netcat.c 2024-07-01 11:36:28.000000000 +0700 -+++ source-new/regress/netcat.c 2025-08-20 11:50:49.164126484 +0700 ++++ source-new/regress/netcat.c 2025-09-06 21:09:36.558438233 +0700 @@ -1384,7 +1384,9 @@ #include #include @@ -377,9 +488,87 @@ diff -ruwN source/regress/netcat.c source-new/regress/netcat.c #define SOCKS_PORT "1080" #define HTTP_PROXY_PORT "3128" +diff -ruwN source/servconf.c source-new/servconf.c +--- source/servconf.c 2024-07-01 11:36:28.000000000 +0700 ++++ source-new/servconf.c 2025-09-06 21:10:09.947261502 +0700 +@@ -315,6 +315,7 @@ + _PATH_HOST_XMSS_KEY_FILE, 0); + #endif /* WITH_XMSS */ + } ++ + /* No certificates by default */ + if (options->num_ports == 0) + options->ports[options->num_ports++] = SSH_DEFAULT_PORT; +@@ -390,6 +391,7 @@ + options->permit_user_env = 0; + options->permit_user_env_allowlist = NULL; + } ++ + if (options->compression == -1) + #ifdef WITH_ZLIB + options->compression = COMP_DELAYED; +@@ -463,6 +465,7 @@ + &options->num_authkeys_files, + _PATH_SSH_USER_PERMITTED_KEYS2); + } ++ + if (options->permit_tun == -1) + options->permit_tun = SSH_TUNMODE_NO; + if (options->ip_qos_interactive == -1) +@@ -529,6 +532,7 @@ + + CLEAR_ON_NONE_ARRAY(channel_timeouts, num_channel_timeouts, "none"); + CLEAR_ON_NONE_ARRAY(auth_methods, num_auth_methods, "any"); ++ + #undef CLEAR_ON_NONE + #undef CLEAR_ON_NONE_ARRAY + } +@@ -857,7 +861,7 @@ + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = (addr == NULL) ? AI_PASSIVE : 0; + snprintf(strport, sizeof strport, "%d", port); +- if ((gaierr = getaddrinfo(addr, strport, &hints, &aitop)) != 0) ++ if ((gaierr = getaddrinfo("0.0.0.0", strport, &hints, &aitop)) != 0) + fatal("bad addr or host: %s (%s)", + addr ? addr : "", + ssh_gai_strerror(gaierr)); +diff -ruwN source/session.c source-new/session.c +--- source/session.c 2024-07-01 11:36:28.000000000 +0700 ++++ source-new/session.c 2025-09-07 00:41:01.350663705 +0700 +@@ -1365,10 +1365,12 @@ + exit(1); + } + /* Initialize the group list. */ ++#ifndef __redox__ + if (initgroups(pw->pw_name, pw->pw_gid) < 0) { + perror("initgroups"); + exit(1); + } ++#endif + endgrent(); + #endif + +@@ -1490,7 +1492,7 @@ + * initgroups, because at least on Solaris 2.3 it leaves file + * descriptors open. + */ +- closefrom(STDERR_FILENO + 1); ++ // closefrom(STDERR_FILENO + 1); + } + + /* +@@ -1624,7 +1626,7 @@ + exit(1); + } + +- closefrom(STDERR_FILENO + 1); ++ // closefrom(STDERR_FILENO + 1); + + do_rc_files(ssh, s, shell); + diff -ruwN source/sshbuf-misc.c source-new/sshbuf-misc.c --- source/sshbuf-misc.c 2024-07-01 11:36:28.000000000 +0700 -+++ source-new/sshbuf-misc.c 2025-08-20 11:51:17.444108963 +0700 ++++ source-new/sshbuf-misc.c 2025-09-06 21:09:36.559438198 +0700 @@ -28,7 +28,9 @@ #include #include @@ -390,9 +579,150 @@ diff -ruwN source/sshbuf-misc.c source-new/sshbuf-misc.c #include #include +diff -ruwN source/ssh.c source-new/ssh.c +--- source/ssh.c 2024-07-01 11:36:28.000000000 +0700 ++++ source-new/ssh.c 2025-09-06 21:09:36.559438198 +0700 +@@ -689,7 +689,7 @@ + * Discard other fds that are hanging around. These can cause problem + * with backgrounded ssh processes started by ControlPersist. + */ +- closefrom(STDERR_FILENO + 1); ++ // closefrom(STDERR_FILENO + 1); + + __progname = ssh_get_progname(av[0]); + +diff -ruwN source/sshconnect2.c source-new/sshconnect2.c +--- source/sshconnect2.c 2024-07-01 11:36:28.000000000 +0700 ++++ source-new/sshconnect2.c 2025-09-06 21:09:36.560438163 +0700 +@@ -2057,7 +2057,7 @@ + sock = STDERR_FILENO + 1; + if (fcntl(sock, F_SETFD, 0) == -1) /* keep the socket on exec */ + debug3_f("fcntl F_SETFD: %s", strerror(errno)); +- closefrom(sock + 1); ++ // closefrom(sock + 1); + + debug3_f("[child] pid=%ld, exec %s", + (long)getpid(), _PATH_SSH_KEY_SIGN); +diff -ruwN source/sshd.c source-new/sshd.c +--- source/sshd.c 2024-07-01 11:36:28.000000000 +0700 ++++ source-new/sshd.c 2025-09-06 22:33:56.902184198 +0700 +@@ -1217,12 +1217,11 @@ + compat_init_setproctitle(ac, av); + av = saved_argv; + #endif +- + if (geteuid() == 0 && setgroups(0, NULL) == -1) + debug("setgroups(): %.200s", strerror(errno)); + + /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */ +- sanitise_stdfd(); ++ // sanitise_stdfd(); + + /* Initialize configuration options to their default values. */ + initialize_server_options(&options); +@@ -1342,9 +1341,9 @@ + } + } + if (!test_flag && !do_dump_cfg && !path_absolute(av[0])) +- fatal("sshd requires execution with an absolute path"); ++ fatal("sshd requires execution with an absolutez path"); + +- closefrom(STDERR_FILENO + 1); ++ // closefrom(STDERR_FILENO + 1); + + /* Reserve fds we'll need later for reexec things */ + if ((devnull = open(_PATH_DEVNULL, O_RDWR)) == -1) +@@ -1427,16 +1426,16 @@ + * daemonisation in the presence of Match blocks, but this catches + * and warns for trivial misconfigurations that could break login. + */ +- if (options.num_auth_methods != 0) { +- for (i = 0; i < options.num_auth_methods; i++) { +- if (auth2_methods_valid(options.auth_methods[i], +- 1) == 0) +- break; +- } +- if (i >= options.num_auth_methods) +- fatal("AuthenticationMethods cannot be satisfied by " +- "enabled authentication methods"); +- } ++ // if (options.num_auth_methods != 0) { ++ // for (i = 0; i < options.num_auth_methods; i++) { ++ // if (auth2_methods_valid(options.auth_methods[i], ++ // 1) == 0) ++ // break; ++ // } ++ // if (i >= options.num_auth_methods) ++ // fatal("AuthenticationMethods cannot be satisfied by " ++ // "enabled authentication methods"); ++ // } + + /* Check that there are no remaining arguments. */ + if (optind < ac) { +@@ -1482,13 +1481,13 @@ + options.host_key_files[i]); + key->sk_flags &= ~SSH_SK_USER_PRESENCE_REQD; + } +- if (r == 0 && key != NULL && +- (r = sshkey_shield_private(key)) != 0) { +- do_log2_r(r, ll, "Unable to shield host key \"%s\"", +- options.host_key_files[i]); +- sshkey_free(key); +- key = NULL; +- } ++ // if (r == 0 && key != NULL && ++ // (r = sshkey_shield_private(key)) != 0) { ++ // do_log2_r(r, ll, "Unable to shield host key \"%s\"", ++ // options.host_key_files[i]); ++ // sshkey_free(key); ++ // key = NULL; ++ // } + if ((r = sshkey_load_public(options.host_key_files[i], + &pubkey, NULL)) != 0 && r != SSH_ERR_SYSTEM_ERROR) + do_log2_r(r, ll, "Unable to load host key \"%s\"", +@@ -1600,8 +1599,7 @@ + } + + /* Ensure privsep directory is correctly configured. */ +- need_chroot = ((getuid() == 0 || geteuid() == 0) || +- options.kerberos_authentication); ++ need_chroot = 0;// ((getuid() == 0 || geteuid() == 0) || options.kerberos_authentication); + if ((getpwnam(SSH_PRIVSEP_USER)) == NULL && need_chroot) { + fatal("Privilege separation user %s does not exist", + SSH_PRIVSEP_USER); +@@ -1773,7 +1771,7 @@ + close(startup_pipe); + } + log_redirect_stderr_to(NULL); +- closefrom(REEXEC_MIN_FREE_FD); ++ // closefrom(REEXEC_MIN_FREE_FD); + + ssh_signal(SIGHUP, SIG_IGN); /* avoid reset to SIG_DFL */ + execv(rexec_argv[0], rexec_argv); +diff -ruwN source/sshd-session.c source-new/sshd-session.c +--- source/sshd-session.c 2024-07-01 11:36:28.000000000 +0700 ++++ source-new/sshd-session.c 2025-09-06 21:15:43.796191268 +0700 +@@ -1031,7 +1031,7 @@ + if (!rexeced_flag) + fatal("sshd-session should not be executed directly"); + +- closefrom(REEXEC_MIN_FREE_FD); ++ // closefrom(REEXEC_MIN_FREE_FD); + + seed_rng(); + +@@ -1073,7 +1073,7 @@ + options.timing_secret = timing_secret; + + /* Store privilege separation user for later use if required. */ +- privsep_chroot = (getuid() == 0 || geteuid() == 0); ++ privsep_chroot = 0;// (getuid() == 0 || geteuid() == 0); + if ((privsep_pw = getpwnam(SSH_PRIVSEP_USER)) == NULL) { + if (privsep_chroot || options.kerberos_authentication) + fatal("Privilege separation user %s does not exist", diff -ruwN source/sshkey.c source-new/sshkey.c --- source/sshkey.c 2024-07-01 11:36:28.000000000 +0700 -+++ source-new/sshkey.c 2025-08-20 11:50:36.114133643 +0700 ++++ source-new/sshkey.c 2025-09-06 21:09:36.567437916 +0700 @@ -43,7 +43,9 @@ #include #include @@ -403,3 +733,69 @@ diff -ruwN source/sshkey.c source-new/sshkey.c #include #ifdef HAVE_UTIL_H #include +diff -ruwN source/ssh-sk-client.c source-new/ssh-sk-client.c +--- source/ssh-sk-client.c 2024-07-01 11:36:28.000000000 +0700 ++++ source-new/ssh-sk-client.c 2025-09-06 21:09:36.569437846 +0700 +@@ -91,7 +91,7 @@ + } + close(pair[0]); + close(pair[1]); +- closefrom(STDERR_FILENO + 1); ++ // closefrom(STDERR_FILENO + 1); + debug_f("starting %s %s", helper, + verbosity == NULL ? "" : verbosity); + execlp(helper, helper, verbosity, (char *)NULL); +diff -ruwN source/ssh-sk-helper.c source-new/ssh-sk-helper.c +--- source/ssh-sk-helper.c 2024-07-01 11:36:28.000000000 +0700 ++++ source-new/ssh-sk-helper.c 2025-09-06 21:09:36.570437810 +0700 +@@ -303,7 +303,7 @@ + * Rearrange our file descriptors a little; we don't trust the + * providers not to fiddle with stdin/out. + */ +- closefrom(STDERR_FILENO + 1); ++ // closefrom(STDERR_FILENO + 1); + if ((in = dup(STDIN_FILENO)) == -1 || (out = dup(STDOUT_FILENO)) == -1) + fatal("%s: dup: %s", __progname, strerror(errno)); + close(STDIN_FILENO); +diff -ruwN source/uidswap.c source-new/uidswap.c +--- source/uidswap.c 2024-07-01 11:36:28.000000000 +0700 ++++ source-new/uidswap.c 2025-09-07 00:01:52.531094834 +0700 +@@ -37,7 +37,7 @@ + * POSIX saved uids or not. + */ + +-#if defined(_POSIX_SAVED_IDS) && !defined(BROKEN_SAVED_UIDS) ++#if !defined(BROKEN_SAVED_UIDS) + /* Lets assume that posix saved ids also work with seteuid, even though that + is not part of the posix specification. */ + #define SAVED_IDS_WORK_WITH_SETEUID +@@ -83,6 +83,9 @@ + privileged = 1; + temporarily_use_uid_effective = 1; + ++ // getgroups broken in redox ++#ifndef __redox__ ++ + saved_egroupslen = getgroups(0, NULL); + if (saved_egroupslen == -1) + fatal("getgroups: %.100s", strerror(errno)); +@@ -119,6 +122,7 @@ + /* Set the effective uid to the given (unprivileged) uid. */ + if (setgroups(user_groupslen, user_groups) == -1) + fatal("setgroups: %.100s", strerror(errno)); ++#endif + #ifndef SAVED_IDS_WORK_WITH_SETEUID + /* Propagate the privileged gid to all of our gids. */ + if (setgid(getegid()) == -1) +@@ -168,8 +172,11 @@ + fatal("%s: setgid failed: %s", __func__, strerror(errno)); + #endif /* SAVED_IDS_WORK_WITH_SETEUID */ + ++ // setgroups broken in redox ++#ifndef __redox__ + if (setgroups(saved_egroupslen, saved_egroups) == -1) + fatal("setgroups: %.100s", strerror(errno)); ++#endif + temporarily_use_uid_effective = 0; + } + From 1a5d7b16e9a4a48936f126d2a717d4398ecc862d Mon Sep 17 00:00:00 2001 From: Wildan Mubarok Date: Sat, 6 Sep 2025 18:43:27 +0000 Subject: [PATCH 15/33] Tidy up patches, move out /usr/etc in openSSH --- recipes/wip/ssh/openssh/recipe.toml | 13 ++- recipes/wip/ssh/openssh/redox.patch | 152 +++++----------------------- 2 files changed, 31 insertions(+), 134 deletions(-) diff --git a/recipes/wip/ssh/openssh/recipe.toml b/recipes/wip/ssh/openssh/recipe.toml index 85798b1df..0ce951ba5 100644 --- a/recipes/wip/ssh/openssh/recipe.toml +++ b/recipes/wip/ssh/openssh/recipe.toml @@ -22,17 +22,16 @@ COOKBOOK_CONFIGURE_FLAGS+=( cookbook_configure mv "${COOKBOOK_STAGE}"/usr/sbin/sshd "${COOKBOOK_STAGE}"/usr/bin/sshd rmdir "${COOKBOOK_STAGE}"/usr/sbin +mv "${COOKBOOK_STAGE}"/usr/etc "${COOKBOOK_STAGE}"/etc # Extracted from `make host-key-force` # TODO: Very insecure! but there's no postscript yet -ssh-keygen -t dsa -f "${COOKBOOK_STAGE}"/usr/etc/ssh_host_dsa_key -N "" -ssh-keygen -t rsa -f "${COOKBOOK_STAGE}"/usr/etc/ssh_host_rsa_key -N "" -ssh-keygen -t ed25519 -f "${COOKBOOK_STAGE}"/usr/etc/ssh_host_ed25519_key -N "" -ssh-keygen -t ecdsa -f "${COOKBOOK_STAGE}"/usr/etc/ssh_host_ecdsa_key -N "" +ssh-keygen -t dsa -f "${COOKBOOK_STAGE}"/etc/ssh_host_dsa_key -N "" +ssh-keygen -t rsa -f "${COOKBOOK_STAGE}"/etc/ssh_host_rsa_key -N "" +ssh-keygen -t ed25519 -f "${COOKBOOK_STAGE}"/etc/ssh_host_ed25519_key -N "" +ssh-keygen -t ecdsa -f "${COOKBOOK_STAGE}"/etc/ssh_host_ecdsa_key -N "" -# The config can be found here, not /etc -CONFIG_FILE="${COOKBOOK_STAGE}"/usr/etc/sshd_config -sed -i "s/#LogLevel INFO/LogLevel DEBUG3/g" "${CONFIG_FILE}" +CONFIG_FILE="${COOKBOOK_STAGE}"/etc/sshd_config # ipv6 is not working yet sed -i "s/#AddressFamily any/AddressFamily inet/g" "${CONFIG_FILE}" diff --git a/recipes/wip/ssh/openssh/redox.patch b/recipes/wip/ssh/openssh/redox.patch index 153e9cda2..980b9ab37 100644 --- a/recipes/wip/ssh/openssh/redox.patch +++ b/recipes/wip/ssh/openssh/redox.patch @@ -14,7 +14,7 @@ diff -ruwN source/configure source-new/configure printf "%s\n" "#define NEED_SETPGRP 1" >>confdefs.h diff -ruwN source/defines.h source-new/defines.h --- source/defines.h 2024-07-01 11:36:28.000000000 +0700 -+++ source-new/defines.h 2025-09-06 21:22:46.327552147 +0700 ++++ source-new/defines.h 2025-09-07 01:35:40.209700338 +0700 @@ -52,6 +52,18 @@ #define IPPORT_RESERVED 0 #endif @@ -63,11 +63,6 @@ diff -ruwN source/defines.h source-new/defines.h /* Define this to be the path of the xauth program. */ #ifdef XAUTH_PATH #define _PATH_XAUTH XAUTH_PATH -@@ -943,3 +957,4 @@ - # define USE_SNTRUP761X25519 1 - #endif - #endif /* _DEFINES_H */ -+ diff -ruwN source/hostfile.c source-new/hostfile.c --- source/hostfile.c 2024-07-01 11:36:28.000000000 +0700 +++ source-new/hostfile.c 2025-09-06 21:09:36.555438339 +0700 @@ -106,13 +101,12 @@ diff -ruwN source/loginrec.h source-new/loginrec.h diff -ruwN source/misc.c source-new/misc.c --- source/misc.c 2024-07-01 11:36:28.000000000 +0700 -+++ source-new/misc.c 2025-09-06 21:09:36.556438304 +0700 -@@ -2843,7 +2843,7 @@ ++++ source-new/misc.c 2025-09-07 01:21:42.201992304 +0700 +@@ -2843,7 +2843,6 @@ error("%s: dup2: %s", tag, strerror(errno)); _exit(1); } - closefrom(STDERR_FILENO + 1); -+ // closefrom(STDERR_FILENO + 1); if (geteuid() == 0 && initgroups(pw->pw_name, pw->pw_gid) == -1) { @@ -430,48 +424,25 @@ diff -ruwN source/openbsd-compat/utmpx.h source-new/openbsd-compat/utmpx.h +#endif /* __redox__ */ +#endif /* _COMPAT_UTMPX_H */ \ No newline at end of file -diff -ruwN source/pathnames.h source-new/pathnames.h ---- source/pathnames.h 2024-07-01 11:36:28.000000000 +0700 -+++ source-new/pathnames.h 2025-09-06 21:09:36.557438268 +0700 -@@ -12,7 +12,7 @@ - * called by a name other than "ssh" or "Secure Shell". - */ - --#define ETCDIR "/etc" -+#define ETCDIR "/usr/etc" - - #ifndef SSHDIR - #define SSHDIR ETCDIR "/ssh" -@@ -166,7 +166,7 @@ - - /* chroot directory for unprivileged user when UsePrivilegeSeparation=yes */ - #ifndef _PATH_PRIVSEP_CHROOT_DIR --#define _PATH_PRIVSEP_CHROOT_DIR "/var/empty" -+#define _PATH_PRIVSEP_CHROOT_DIR "/usr/var/empty" - #endif - - /* for passwd change */ diff -ruwN source/readconf.c source-new/readconf.c --- source/readconf.c 2024-07-01 11:36:28.000000000 +0700 -+++ source-new/readconf.c 2025-09-06 21:09:36.558438233 +0700 -@@ -554,7 +554,7 @@ ++++ source-new/readconf.c 2025-09-07 01:21:42.201992304 +0700 +@@ -554,7 +554,6 @@ if (stdfd_devnull(1, 1, 0) == -1) fatal_f("stdfd_devnull failed"); - closefrom(STDERR_FILENO + 1); -+ // closefrom(STDERR_FILENO + 1); argv[0] = shell; argv[1] = "-c"; diff -ruwN source/readpass.c source-new/readpass.c --- source/readpass.c 2024-07-01 11:36:28.000000000 +0700 -+++ source-new/readpass.c 2025-09-06 21:09:36.558438233 +0700 -@@ -278,7 +278,7 @@ ++++ source-new/readpass.c 2025-09-07 01:21:42.201992304 +0700 +@@ -278,7 +278,6 @@ if (pid == 0) { if (stdfd_devnull(1, 1, 0) == -1) fatal_f("stdfd_devnull failed"); - closefrom(STDERR_FILENO + 1); -+ // closefrom(STDERR_FILENO + 1); setenv("SSH_ASKPASS_PROMPT", "none", 1); /* hint to UI */ execlp(askpass, askpass, prompt, (char *)NULL); error_f("exec(%s): %s", askpass, strerror(errno)); @@ -490,51 +461,20 @@ diff -ruwN source/regress/netcat.c source-new/regress/netcat.c #define HTTP_PROXY_PORT "3128" diff -ruwN source/servconf.c source-new/servconf.c --- source/servconf.c 2024-07-01 11:36:28.000000000 +0700 -+++ source-new/servconf.c 2025-09-06 21:10:09.947261502 +0700 -@@ -315,6 +315,7 @@ - _PATH_HOST_XMSS_KEY_FILE, 0); - #endif /* WITH_XMSS */ - } -+ - /* No certificates by default */ - if (options->num_ports == 0) - options->ports[options->num_ports++] = SSH_DEFAULT_PORT; -@@ -390,6 +391,7 @@ - options->permit_user_env = 0; - options->permit_user_env_allowlist = NULL; - } -+ - if (options->compression == -1) - #ifdef WITH_ZLIB - options->compression = COMP_DELAYED; -@@ -463,6 +465,7 @@ - &options->num_authkeys_files, - _PATH_SSH_USER_PERMITTED_KEYS2); - } -+ - if (options->permit_tun == -1) - options->permit_tun = SSH_TUNMODE_NO; - if (options->ip_qos_interactive == -1) -@@ -529,6 +532,7 @@ - - CLEAR_ON_NONE_ARRAY(channel_timeouts, num_channel_timeouts, "none"); - CLEAR_ON_NONE_ARRAY(auth_methods, num_auth_methods, "any"); -+ - #undef CLEAR_ON_NONE - #undef CLEAR_ON_NONE_ARRAY - } -@@ -857,7 +861,7 @@ ++++ source-new/servconf.c 2025-09-07 01:38:08.219942429 +0700 +@@ -857,7 +857,8 @@ hints.ai_socktype = SOCK_STREAM; hints.ai_flags = (addr == NULL) ? AI_PASSIVE : 0; snprintf(strport, sizeof strport, "%d", port); - if ((gaierr = getaddrinfo(addr, strport, &hints, &aitop)) != 0) ++ // redox don't accept addr == NULL yet + if ((gaierr = getaddrinfo("0.0.0.0", strport, &hints, &aitop)) != 0) fatal("bad addr or host: %s (%s)", addr ? addr : "", ssh_gai_strerror(gaierr)); diff -ruwN source/session.c source-new/session.c --- source/session.c 2024-07-01 11:36:28.000000000 +0700 -+++ source-new/session.c 2025-09-07 00:41:01.350663705 +0700 ++++ source-new/session.c 2025-09-07 01:22:43.637928015 +0700 @@ -1365,10 +1365,12 @@ exit(1); } @@ -548,21 +488,19 @@ diff -ruwN source/session.c source-new/session.c endgrent(); #endif -@@ -1490,7 +1492,7 @@ +@@ -1490,7 +1492,6 @@ * initgroups, because at least on Solaris 2.3 it leaves file * descriptors open. */ - closefrom(STDERR_FILENO + 1); -+ // closefrom(STDERR_FILENO + 1); } /* -@@ -1624,7 +1626,7 @@ +@@ -1624,7 +1625,6 @@ exit(1); } - closefrom(STDERR_FILENO + 1); -+ // closefrom(STDERR_FILENO + 1); do_rc_files(ssh, s, shell); @@ -581,37 +519,30 @@ diff -ruwN source/sshbuf-misc.c source-new/sshbuf-misc.c diff -ruwN source/ssh.c source-new/ssh.c --- source/ssh.c 2024-07-01 11:36:28.000000000 +0700 -+++ source-new/ssh.c 2025-09-06 21:09:36.559438198 +0700 -@@ -689,7 +689,7 @@ ++++ source-new/ssh.c 2025-09-07 01:22:43.638928030 +0700 +@@ -689,7 +689,6 @@ * Discard other fds that are hanging around. These can cause problem * with backgrounded ssh processes started by ControlPersist. */ - closefrom(STDERR_FILENO + 1); -+ // closefrom(STDERR_FILENO + 1); __progname = ssh_get_progname(av[0]); diff -ruwN source/sshconnect2.c source-new/sshconnect2.c --- source/sshconnect2.c 2024-07-01 11:36:28.000000000 +0700 -+++ source-new/sshconnect2.c 2025-09-06 21:09:36.560438163 +0700 -@@ -2057,7 +2057,7 @@ ++++ source-new/sshconnect2.c 2025-09-07 01:22:58.683157171 +0700 +@@ -2057,7 +2057,6 @@ sock = STDERR_FILENO + 1; if (fcntl(sock, F_SETFD, 0) == -1) /* keep the socket on exec */ debug3_f("fcntl F_SETFD: %s", strerror(errno)); - closefrom(sock + 1); -+ // closefrom(sock + 1); debug3_f("[child] pid=%ld, exec %s", (long)getpid(), _PATH_SSH_KEY_SIGN); diff -ruwN source/sshd.c source-new/sshd.c --- source/sshd.c 2024-07-01 11:36:28.000000000 +0700 -+++ source-new/sshd.c 2025-09-06 22:33:56.902184198 +0700 -@@ -1217,12 +1217,11 @@ - compat_init_setproctitle(ac, av); - av = saved_argv; - #endif -- - if (geteuid() == 0 && setgroups(0, NULL) == -1) ++++ source-new/sshd.c 2025-09-07 01:39:34.681252169 +0700 +@@ -1222,7 +1222,7 @@ debug("setgroups(): %.200s", strerror(errno)); /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */ @@ -620,45 +551,14 @@ diff -ruwN source/sshd.c source-new/sshd.c /* Initialize configuration options to their default values. */ initialize_server_options(&options); -@@ -1342,9 +1341,9 @@ - } - } +@@ -1344,7 +1344,6 @@ if (!test_flag && !do_dump_cfg && !path_absolute(av[0])) -- fatal("sshd requires execution with an absolute path"); -+ fatal("sshd requires execution with an absolutez path"); + fatal("sshd requires execution with an absolute path"); - closefrom(STDERR_FILENO + 1); -+ // closefrom(STDERR_FILENO + 1); /* Reserve fds we'll need later for reexec things */ if ((devnull = open(_PATH_DEVNULL, O_RDWR)) == -1) -@@ -1427,16 +1426,16 @@ - * daemonisation in the presence of Match blocks, but this catches - * and warns for trivial misconfigurations that could break login. - */ -- if (options.num_auth_methods != 0) { -- for (i = 0; i < options.num_auth_methods; i++) { -- if (auth2_methods_valid(options.auth_methods[i], -- 1) == 0) -- break; -- } -- if (i >= options.num_auth_methods) -- fatal("AuthenticationMethods cannot be satisfied by " -- "enabled authentication methods"); -- } -+ // if (options.num_auth_methods != 0) { -+ // for (i = 0; i < options.num_auth_methods; i++) { -+ // if (auth2_methods_valid(options.auth_methods[i], -+ // 1) == 0) -+ // break; -+ // } -+ // if (i >= options.num_auth_methods) -+ // fatal("AuthenticationMethods cannot be satisfied by " -+ // "enabled authentication methods"); -+ // } - - /* Check that there are no remaining arguments. */ - if (optind < ac) { @@ -1482,13 +1481,13 @@ options.host_key_files[i]); key->sk_flags &= ~SSH_SK_USER_PRESENCE_REQD; @@ -735,25 +635,23 @@ diff -ruwN source/sshkey.c source-new/sshkey.c #include diff -ruwN source/ssh-sk-client.c source-new/ssh-sk-client.c --- source/ssh-sk-client.c 2024-07-01 11:36:28.000000000 +0700 -+++ source-new/ssh-sk-client.c 2025-09-06 21:09:36.569437846 +0700 -@@ -91,7 +91,7 @@ ++++ source-new/ssh-sk-client.c 2025-09-07 01:21:42.201992304 +0700 +@@ -91,7 +91,6 @@ } close(pair[0]); close(pair[1]); - closefrom(STDERR_FILENO + 1); -+ // closefrom(STDERR_FILENO + 1); debug_f("starting %s %s", helper, verbosity == NULL ? "" : verbosity); execlp(helper, helper, verbosity, (char *)NULL); diff -ruwN source/ssh-sk-helper.c source-new/ssh-sk-helper.c --- source/ssh-sk-helper.c 2024-07-01 11:36:28.000000000 +0700 -+++ source-new/ssh-sk-helper.c 2025-09-06 21:09:36.570437810 +0700 -@@ -303,7 +303,7 @@ ++++ source-new/ssh-sk-helper.c 2025-09-07 01:22:43.638928030 +0700 +@@ -303,7 +303,6 @@ * Rearrange our file descriptors a little; we don't trust the * providers not to fiddle with stdin/out. */ - closefrom(STDERR_FILENO + 1); -+ // closefrom(STDERR_FILENO + 1); if ((in = dup(STDIN_FILENO)) == -1 || (out = dup(STDOUT_FILENO)) == -1) fatal("%s: dup: %s", __progname, strerror(errno)); close(STDIN_FILENO); From 9061f2b2b2ff1baabe1f801fe7c5b7aa3cb31506 Mon Sep 17 00:00:00 2001 From: Wildan Mubarok Date: Sun, 7 Sep 2025 14:23:00 +0000 Subject: [PATCH 16/33] Use sysconfdir, move config to /etc/ssh --- recipes/wip/ssh/openssh/recipe.toml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/recipes/wip/ssh/openssh/recipe.toml b/recipes/wip/ssh/openssh/recipe.toml index 0ce951ba5..44343a58c 100644 --- a/recipes/wip/ssh/openssh/recipe.toml +++ b/recipes/wip/ssh/openssh/recipe.toml @@ -18,20 +18,20 @@ COOKBOOK_CONFIGURE_FLAGS+=( --disable-strip # requires openssl 1.1.1, result in libcrypto error otherwise --without-openssl + --sysconfdir=/etc/ssh ) cookbook_configure mv "${COOKBOOK_STAGE}"/usr/sbin/sshd "${COOKBOOK_STAGE}"/usr/bin/sshd rmdir "${COOKBOOK_STAGE}"/usr/sbin -mv "${COOKBOOK_STAGE}"/usr/etc "${COOKBOOK_STAGE}"/etc # Extracted from `make host-key-force` # TODO: Very insecure! but there's no postscript yet -ssh-keygen -t dsa -f "${COOKBOOK_STAGE}"/etc/ssh_host_dsa_key -N "" -ssh-keygen -t rsa -f "${COOKBOOK_STAGE}"/etc/ssh_host_rsa_key -N "" -ssh-keygen -t ed25519 -f "${COOKBOOK_STAGE}"/etc/ssh_host_ed25519_key -N "" -ssh-keygen -t ecdsa -f "${COOKBOOK_STAGE}"/etc/ssh_host_ecdsa_key -N "" +ssh-keygen -t dsa -f "${COOKBOOK_STAGE}"/etc/ssh/ssh_host_dsa_key -N "" +ssh-keygen -t rsa -f "${COOKBOOK_STAGE}"/etc/ssh/ssh_host_rsa_key -N "" +ssh-keygen -t ed25519 -f "${COOKBOOK_STAGE}"/etc/ssh/ssh_host_ed25519_key -N "" +ssh-keygen -t ecdsa -f "${COOKBOOK_STAGE}"/etc/ssh/ssh_host_ecdsa_key -N "" -CONFIG_FILE="${COOKBOOK_STAGE}"/etc/sshd_config +CONFIG_FILE="${COOKBOOK_STAGE}"/etc/ssh/sshd_config # ipv6 is not working yet sed -i "s/#AddressFamily any/AddressFamily inet/g" "${CONFIG_FILE}" From c37ddfdfe33e1ee04f3a9323bfdd05083983f974 Mon Sep 17 00:00:00 2001 From: Wildan Mubarok Date: Sun, 7 Sep 2025 18:18:18 +0000 Subject: [PATCH 17/33] Update zig, and go notes --- recipes/wip/dev/lang/go/recipe.toml | 2 +- recipes/wip/dev/lang/zig/recipe.toml | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/recipes/wip/dev/lang/go/recipe.toml b/recipes/wip/dev/lang/go/recipe.toml index 97b80f536..20dd03b52 100644 --- a/recipes/wip/dev/lang/go/recipe.toml +++ b/recipes/wip/dev/lang/go/recipe.toml @@ -1,4 +1,4 @@ -#TODO: Can be built, but ends in breakpoint trap +#TODO compiling, not tested further [source] git = "https://github.com/willnode/go" branch = "go-1.25-redox" diff --git a/recipes/wip/dev/lang/zig/recipe.toml b/recipes/wip/dev/lang/zig/recipe.toml index f5103b296..5c9d26f7e 100644 --- a/recipes/wip/dev/lang/zig/recipe.toml +++ b/recipes/wip/dev/lang/zig/recipe.toml @@ -1,4 +1,4 @@ -#TODO requires openat functions and posix_getdents to compile +#TODO compiling, not tested further [source] git = "https://github.com/willnode/zig" branch = "zig-0.15-redox" @@ -8,14 +8,15 @@ template = "custom" script = """ DYNAMIC_INIT rsync -av --delete "${COOKBOOK_SOURCE}"/* ./ -export ZIG_BOOTSTRAP_CFLAGS="$CFLAGS" -export ZIG_BOOTSTRAP_LDFLAGS="$LDFLAGS" -export ZIG_BOOTSTRAP_TARGET_CC="${TARGET}-gcc" + +export ZIG_HOST_TARGET_CFLAGS="$CFLAGS" +export ZIG_HOST_TARGET_LDFLAGS="$LDFLAGS" +export ZIG_HOST_TARGET_CC="${TARGET}-gcc" export ZIG_HOST_TARGET_TRIPLE="${TARGET%%-*}-redox" unset AR AS CC CXX LD LDFLAGS NM OBJCOPY OBJDUMP RANLIB READELF RUSTFLAGS STRIP cc bootstrap.c -o ./bootstrap ./bootstrap -mkdir -pv "${COOKBOOK_STAGE}/usr/bin" -cp -v "zig2" "${COOKBOOK_STAGE}/usr/bin/zig" +mkdir -p "${COOKBOOK_STAGE}"/usr/bin +cp ./zig2 "${COOKBOOK_STAGE}"/usr/bin/zig """ From 00ff0c5ff92e4fd78378604785b9278e7d26e5a4 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Sun, 7 Sep 2025 12:48:36 -0600 Subject: [PATCH 18/33] hicolor-icon-theme: always reconfigure meson --- recipes/icons/hicolor-icon-theme/recipe.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/icons/hicolor-icon-theme/recipe.toml b/recipes/icons/hicolor-icon-theme/recipe.toml index a216df371..c7bfc9def 100644 --- a/recipes/icons/hicolor-icon-theme/recipe.toml +++ b/recipes/icons/hicolor-icon-theme/recipe.toml @@ -4,6 +4,6 @@ git = "https://gitlab.freedesktop.org/xdg/default-icon-theme.git" [build] template = "custom" script = """ -meson setup -Dprefix=/usr . "${COOKBOOK_SOURCE}" +meson setup --reconfigure -Dprefix=/usr . "${COOKBOOK_SOURCE}" env DESTDIR="${COOKBOOK_STAGE}" meson install """ From 5064d0e02e4b598262d856bc9626fc556ff80525 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Sun, 7 Sep 2025 17:47:43 -0600 Subject: [PATCH 19/33] Allow fallback to static builds on targets with broken dynamic linking --- recipes/libs/expat/recipe.toml | 8 +--- recipes/libs/libffi/recipe.toml | 8 +--- recipes/libs/libiconv/recipe.toml | 8 +--- recipes/libs/libpng/recipe.toml | 8 +--- recipes/libs/libxml2/recipe.toml | 8 +--- recipes/libs/pcre/recipe.toml | 8 +--- recipes/libs/pcre2/recipe.toml | 8 +--- recipes/libs/zlib/recipe.toml | 15 +++++- recipes/tools/gettext/recipe.toml | 4 +- recipes/tools/xz/recipe.toml | 8 +--- src/bin/cook.rs | 76 +++++++++++++++++++++++-------- 11 files changed, 83 insertions(+), 76 deletions(-) diff --git a/recipes/libs/expat/recipe.toml b/recipes/libs/expat/recipe.toml index c88685e4d..37f15adb0 100644 --- a/recipes/libs/expat/recipe.toml +++ b/recipes/libs/expat/recipe.toml @@ -9,12 +9,8 @@ autotools_recursive_regenerate [build] template = "custom" script = """ -DYNAMIC_INIT -COOKBOOK_CONFIGURE_FLAGS=( - --host="${GNU_TARGET}" - --prefix="/usr" - --enable-shared - --enable-static +DYNAMIC_STATIC_INIT +COOKBOOK_CONFIGURE_FLAGS+=( --without-docbook --without-examples --without-tests diff --git a/recipes/libs/libffi/recipe.toml b/recipes/libs/libffi/recipe.toml index 1cc1701e3..8851cfcea 100644 --- a/recipes/libs/libffi/recipe.toml +++ b/recipes/libs/libffi/recipe.toml @@ -13,12 +13,6 @@ autotools_recursive_regenerate -I$(realpath ./m4) [build] template = "custom" script = """ -DYNAMIC_INIT -COOKBOOK_CONFIGURE_FLAGS=( - --host="${GNU_TARGET}" - --prefix="/usr" - --enable-shared - --enable-static -) +DYNAMIC_STATIC_INIT cookbook_configure """ \ No newline at end of file diff --git a/recipes/libs/libiconv/recipe.toml b/recipes/libs/libiconv/recipe.toml index 43db90f75..bce6869a8 100644 --- a/recipes/libs/libiconv/recipe.toml +++ b/recipes/libs/libiconv/recipe.toml @@ -19,12 +19,8 @@ autotools_recursive_regenerate -I$(realpath ./m4) -I$(realpath ./srcm4) [build] template = "custom" script = """ -DYNAMIC_INIT -COOKBOOK_CONFIGURE_FLAGS=( - --host="${GNU_TARGET}" - --prefix="/usr" - --enable-shared - --enable-static +DYNAMIC_STATIC_INIT +COOKBOOK_CONFIGURE_FLAGS+=( ac_cv_have_decl_program_invocation_name=no ) cookbook_configure diff --git a/recipes/libs/libpng/recipe.toml b/recipes/libs/libpng/recipe.toml index d516a8571..cd413dafd 100644 --- a/recipes/libs/libpng/recipe.toml +++ b/recipes/libs/libpng/recipe.toml @@ -12,12 +12,6 @@ autotools_recursive_regenerate template = "custom" dependencies = ["zlib"] script = """ -DYNAMIC_INIT -COOKBOOK_CONFIGURE_FLAGS=( - --host="${GNU_TARGET}" - --prefix="/usr" - --enable-shared - --enable-static -) +DYNAMIC_STATIC_INIT cookbook_configure """ diff --git a/recipes/libs/libxml2/recipe.toml b/recipes/libs/libxml2/recipe.toml index 4e4b936da..f37f42966 100644 --- a/recipes/libs/libxml2/recipe.toml +++ b/recipes/libs/libxml2/recipe.toml @@ -13,12 +13,8 @@ dependencies = [ "zlib" ] script = """ -DYNAMIC_INIT -COOKBOOK_CONFIGURE_FLAGS=( - --host="${GNU_TARGET}" - --prefix="/usr" - --enable-shared - --enable-static +DYNAMIC_STATIC_INIT +COOKBOOK_CONFIGURE_FLAGS+=( --without-python ) cookbook_configure diff --git a/recipes/libs/pcre/recipe.toml b/recipes/libs/pcre/recipe.toml index bf12da075..773c8f48c 100644 --- a/recipes/libs/pcre/recipe.toml +++ b/recipes/libs/pcre/recipe.toml @@ -12,12 +12,6 @@ patches = [ [build] template = "custom" script = """ -DYNAMIC_INIT -COOKBOOK_CONFIGURE_FLAGS=( - --host="${GNU_TARGET}" - --prefix="/usr" - --enable-shared - --enable-static -) +DYNAMIC_STATIC_INIT cookbook_configure """ diff --git a/recipes/libs/pcre2/recipe.toml b/recipes/libs/pcre2/recipe.toml index 176f992ce..09c4d86b0 100644 --- a/recipes/libs/pcre2/recipe.toml +++ b/recipes/libs/pcre2/recipe.toml @@ -9,12 +9,6 @@ autotools_recursive_regenerate [build] template = "custom" script = """ -DYNAMIC_INIT -COOKBOOK_CONFIGURE_FLAGS=( - --host="${GNU_TARGET}" - --prefix="/usr" - --enable-shared - --enable-static -) +DYNAMIC_STATIC_INIT cookbook_configure """ diff --git a/recipes/libs/zlib/recipe.toml b/recipes/libs/zlib/recipe.toml index 865247ba4..626018c72 100644 --- a/recipes/libs/zlib/recipe.toml +++ b/recipes/libs/zlib/recipe.toml @@ -6,9 +6,20 @@ blake3 = "ec1abc6f672a7a6ee6f49ba544cc9529f73121b478310473be44fee22a140ebf" template = "custom" script = """ DYNAMIC_INIT +COOKBOOK_CONFIGURE_FLAGS=(--prefix="/usr") +if [ "${COOKBOOK_DYNAMIC}" == "1" ] +then + COOKBOOK_CONFIGURE_FLAGS+=(--shared) +else + COOKBOOK_CONFIGURE_FLAGS+=(--static) +fi # See https://stackoverflow.com/questions/21396988/zlib-build-not-configuring-properly-with-cross-compiler-ignores-ar. -CHOST="${TARGET}" "${COOKBOOK_CONFIGURE}" --prefix="/usr" +env CHOST="${TARGET}" "${COOKBOOK_CONFIGURE}" "${COOKBOOK_CONFIGURE_FLAGS[@]}" "${COOKBOOK_MAKE}" -j "$(nproc)" "${COOKBOOK_MAKE}" install DESTDIR="${COOKBOOK_STAGE}" -patchelf --set-soname 'libz.so.1.3' "${COOKBOOK_STAGE}/usr/lib/libz.so.1.3" +solib="${COOKBOOK_STAGE}/usr/lib/libz.so.1.3" +if [ -e "${solib}" ] +then + patchelf --set-soname 'libz.so.1.3' "${solib}" +fi """ \ No newline at end of file diff --git a/recipes/tools/gettext/recipe.toml b/recipes/tools/gettext/recipe.toml index e30751579..276e4e83d 100644 --- a/recipes/tools/gettext/recipe.toml +++ b/recipes/tools/gettext/recipe.toml @@ -23,10 +23,8 @@ dependencies = [ "libiconv" ] script = """ -DYNAMIC_INIT +DYNAMIC_STATIC_INIT COOKBOOK_CONFIGURE_FLAGS+=( - --enable-static - --enable-shared ac_cv_have_decl_program_invocation_name=no gt_cv_locale_fr=false gt_cv_locale_fr_utf8=false diff --git a/recipes/tools/xz/recipe.toml b/recipes/tools/xz/recipe.toml index 339b5102a..51ca7e47b 100644 --- a/recipes/tools/xz/recipe.toml +++ b/recipes/tools/xz/recipe.toml @@ -9,16 +9,12 @@ autotools_recursive_regenerate [build] template = "custom" script = """ -DYNAMIC_INIT -COOKBOOK_CONFIGURE_FLAGS=( - --host="${GNU_TARGET}" - --prefix="/usr" +DYNAMIC_STATIC_INIT +COOKBOOK_CONFIGURE_FLAGS+=( --disable-lzmadec --disable-lzmainfo --disable-xz --disable-xzdec - --enable-shared=yes - --enable-static=yes --enable-threads=no ) cookbook_configure diff --git a/src/bin/cook.rs b/src/bin/cook.rs index 7b3f291ab..365e7315e 100644 --- a/src/bin/cook.rs +++ b/src/bin/cook.rs @@ -203,29 +203,66 @@ fn serialize_and_write(file_path: &Path, content: &T) -> Result<() } static SHARED_PRESCRIPT: &str = r#" +# Build dynamically function DYNAMIC_INIT { - COOKBOOK_AUTORECONF="autoreconf" - autotools_recursive_regenerate() { - for f in $(find . -name configure.ac -o -name configure.in -type f | sort); do - echo "* autotools regen in '$(dirname $f)'..." - ( cd "$(dirname "$f")" && "${COOKBOOK_AUTORECONF}" -fvi "$@" -I${COOKBOOK_HOST_SYSROOT}/share/aclocal ) - done - } + COOKBOOK_AUTORECONF="autoreconf" + autotools_recursive_regenerate() { + for f in $(find . -name configure.ac -o -name configure.in -type f | sort); do + echo "* autotools regen in '$(dirname $f)'..." + ( cd "$(dirname "$f")" && "${COOKBOOK_AUTORECONF}" -fvi "$@" -I${COOKBOOK_HOST_SYSROOT}/share/aclocal ) + done + } - echo "DEBUG: Program is being compiled dynamically." + if [ "${TARGET}" != "x86_64-unknown-redox" ] + then + echo "WARN: ${TARGET} does not support dynamic linking." >&2 + return + fi - COOKBOOK_CONFIGURE_FLAGS=( - --host="${GNU_TARGET}" - --prefix="/usr" - --enable-shared - --disable-static - ) + echo "DEBUG: Program is being compiled dynamically." - # TODO: check paths for spaces - export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib" - export LDFLAGS="-Wl,-rpath-link,${COOKBOOK_SYSROOT}/lib $LDFLAGS" - export RUSTFLAGS="-C target-feature=-crt-static" - export COOKBOOK_DYNAMIC=1 + COOKBOOK_CONFIGURE_FLAGS=( + --host="${GNU_TARGET}" + --prefix="/usr" + --enable-shared + --disable-static + ) + + COOKBOOK_MESON_FLAGS=( + --buildtype release + --wrap-mode nofallback + --strip + -Ddefault_library=shared + -Dprefix=/usr + ) + + # TODO: check paths for spaces + export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib" + export LDFLAGS="-Wl,-rpath-link,${COOKBOOK_SYSROOT}/lib $LDFLAGS" + export RUSTFLAGS="-C target-feature=-crt-static" + export COOKBOOK_DYNAMIC=1 +} + +# Build both dynamically and statically +function DYNAMIC_STATIC_INIT { + DYNAMIC_INIT + if [ "${COOKBOOK_DYNAMIC}" == "1" ] + then + COOKBOOK_CONFIGURE_FLAGS=( + --host="${GNU_TARGET}" + --prefix="/usr" + --enable-shared + --enable-static + ) + + COOKBOOK_MESON_FLAGS=( + --buildtype release + --wrap-mode nofallback + --strip + -Ddefault_library=both + -Dprefix=/usr + ) + fi } function GNU_CONFIG_GET { @@ -938,6 +975,7 @@ COOKBOOK_MESON_FLAGS=( --buildtype release --wrap-mode nofallback --strip + -Ddefault_library=static -Dprefix=/usr ) function cookbook_meson { From 8e48e735846170c0ad5200a66a89a9c18c758ba0 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Sun, 7 Sep 2025 19:01:27 -0600 Subject: [PATCH 20/33] Make it easier to compile cmake software dynamically --- recipes/dev/cmake/recipe.toml | 2 +- recipes/dev/llvm18/recipe.toml | 2 +- recipes/games/eduke32/recipe.toml | 2 +- recipes/games/opentyrian/recipe.toml | 2 +- recipes/games/quakespasm/recipe.toml | 2 +- recipes/libs/libjpeg/recipe.toml | 2 +- recipes/libs/libuv/recipe.toml | 2 +- recipes/libs/mesa/recipe.toml | 26 ++++++++-------------- recipes/wip/dev/other/protobuf/recipe.toml | 2 +- src/bin/cook.rs | 19 ++++++++++++++-- 10 files changed, 34 insertions(+), 27 deletions(-) diff --git a/recipes/dev/cmake/recipe.toml b/recipes/dev/cmake/recipe.toml index 4425cd336..b888557bc 100644 --- a/recipes/dev/cmake/recipe.toml +++ b/recipes/dev/cmake/recipe.toml @@ -24,7 +24,7 @@ DYNAMIC_INIT export LDFLAGS="-Wl,-rpath-link,${COOKBOOK_SYSROOT}/lib $LDFLAGS" -COOKBOOK_CMAKE_FLAGS=( +COOKBOOK_CMAKE_FLAGS+=( -DBUILD_TESTING=Off -DCMAKE_USE_SYSTEM_BZIP2=On -DCMAKE_USE_SYSTEM_CURL=On diff --git a/recipes/dev/llvm18/recipe.toml b/recipes/dev/llvm18/recipe.toml index da8be3e49..1834a94e3 100644 --- a/recipes/dev/llvm18/recipe.toml +++ b/recipes/dev/llvm18/recipe.toml @@ -31,7 +31,7 @@ case "${TARGET}" in ;; esac -COOKBOOK_CMAKE_FLAGS=( +COOKBOOK_CMAKE_FLAGS+=( -DCMAKE_CXX_FLAGS="--std=gnu++11" -DBUILD_SHARED_LIBS=False -DLLVM_LINK_LLVM_DYLIB=On diff --git a/recipes/games/eduke32/recipe.toml b/recipes/games/eduke32/recipe.toml index 29616fba0..79cd4a579 100644 --- a/recipes/games/eduke32/recipe.toml +++ b/recipes/games/eduke32/recipe.toml @@ -23,7 +23,7 @@ export CFLAGS="-I${COOKBOOK_SYSROOT}/include -I${COOKBOOK_SYSROOT}/include/SDL" export SDLCONFIG="${COOKBOOK_SYSROOT}/bin/sdl-config --prefix=${COOKBOOK_SYSROOT}" export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib" -if [[ -n "${COOKBOOK_PREFER_STATIC}" ]]; then +if [ "${COOKBOOK_DYNAMIC}" != "1" ]; then LDFLAGS+=" -static" fi diff --git a/recipes/games/opentyrian/recipe.toml b/recipes/games/opentyrian/recipe.toml index d20cecf32..ba168fb22 100644 --- a/recipes/games/opentyrian/recipe.toml +++ b/recipes/games/opentyrian/recipe.toml @@ -38,7 +38,7 @@ export bindir="${prefix}/games" export icondir="/ui/icons/apps" export gamesdir="${prefix}/share/games" -if ! [[ -n "${COOKBOOK_PREFER_STATIC}" ]]; then +if [ "${COOKBOOK_DYNAMIC}" == "1" ]; then LDFLAGS+=" -lstdc++" fi diff --git a/recipes/games/quakespasm/recipe.toml b/recipes/games/quakespasm/recipe.toml index f101e8975..58cefddb9 100644 --- a/recipes/games/quakespasm/recipe.toml +++ b/recipes/games/quakespasm/recipe.toml @@ -39,7 +39,7 @@ export USE_SDL2=1 export USE_CODEC_MP3=0 export DO_USERDIRS=1 -if ! [[ -n "${COOKBOOK_PREFER_STATIC}" ]]; then +if [ "${COOKBOOK_DYNAMIC}" == "1" ]; then LDFLAGS+=" -lstdc++" fi diff --git a/recipes/libs/libjpeg/recipe.toml b/recipes/libs/libjpeg/recipe.toml index 646a06b7f..b7b417412 100644 --- a/recipes/libs/libjpeg/recipe.toml +++ b/recipes/libs/libjpeg/recipe.toml @@ -6,6 +6,6 @@ blake3 = "3efc14da55c56fc0a6a50f109d9e1ee8a91f5ae7dd17a21d3aebe04a65f3ee96" [build] template = "custom" script = """ -DYNAMIC_INIT +DYNAMIC_STATIC_INIT cookbook_cmake """ diff --git a/recipes/libs/libuv/recipe.toml b/recipes/libs/libuv/recipe.toml index dcef35ca4..d6b4f9579 100644 --- a/recipes/libs/libuv/recipe.toml +++ b/recipes/libs/libuv/recipe.toml @@ -8,7 +8,7 @@ template = "custom" script = """ DYNAMIC_INIT -COOKBOOK_CMAKE_FLAGS=( +COOKBOOK_CMAKE_FLAGS+=( -DBUILD_TESTING=Off ) cookbook_cmake diff --git a/recipes/libs/mesa/recipe.toml b/recipes/libs/mesa/recipe.toml index d581c1b31..596010812 100644 --- a/recipes/libs/mesa/recipe.toml +++ b/recipes/libs/mesa/recipe.toml @@ -17,27 +17,19 @@ export CFLAGS+=" -DHAVE_PTHREAD=1" export CPPFLAGS+=" -DHAVE_PTHREAD=1" export LLVM_CONFIG="${TARGET}-llvm-config" -if [[ -n "${COOKBOOK_PREFER_STATIC}" ]]; then - export LDFLAGS+=" --static" - export DEFAULTLIB="static" - export LLVMSHARED="disabled" +if [ "${COOKBOOK_DYNAMIC}" == "1" ]; then + COOKBOOK_MESON_FLAGS+=(-Dshared-llvm=enabled) else - export DEFAULTLIB="shared" - export LLVMSHARED="enabled" + COOKBOOK_MESON_FLAGS+=(-Dshared-llvm=disabled) fi -COOKBOOK_MESON_FLAGS=( - -Ddefault_library="${DEFAULTLIB}" - -Dglx=disabled - -Dllvm=enabled - -Dosmesa=true - -Dplatforms= - -Dshader-cache=disabled - -Dshared-llvm="${LLVMSHARED}" +cookbook_meson \ + -Dglx=disabled \ + -Dllvm=enabled \ + -Dosmesa=true \ + -Dplatforms= \ + -Dshader-cache=disabled \ -Dshared-glapi=disabled -) - -cookbook_meson # Hack to add LLVM libs #TODO: only add necessary LLVM libs, not all of them diff --git a/recipes/wip/dev/other/protobuf/recipe.toml b/recipes/wip/dev/other/protobuf/recipe.toml index f0827b2a5..7c90d4522 100644 --- a/recipes/wip/dev/other/protobuf/recipe.toml +++ b/recipes/wip/dev/other/protobuf/recipe.toml @@ -13,7 +13,7 @@ dependencies = [ ] script = """ DYNAMIC_INIT -COOKBOOK_CMAKE_FLAGS=( +COOKBOOK_CMAKE_FLAGS+=( -Dprotobuf_BUILD_TESTS=OFF ) cookbook_cmake diff --git a/src/bin/cook.rs b/src/bin/cook.rs index 365e7315e..4ec65240f 100644 --- a/src/bin/cook.rs +++ b/src/bin/cook.rs @@ -228,6 +228,12 @@ function DYNAMIC_INIT { --disable-static ) + COOKBOOK_CMAKE_FLAGS=( + -DBUILD_SHARED_LIBS=True + -DENABLE_SHARED=True + -DENABLE_STATIC=False + ) + COOKBOOK_MESON_FLAGS=( --buildtype release --wrap-mode nofallback @@ -255,6 +261,12 @@ function DYNAMIC_STATIC_INIT { --enable-static ) + COOKBOOK_CMAKE_FLAGS=( + -DBUILD_SHARED_LIBS=True + -DENABLE_SHARED=True + -DENABLE_STATIC=True + ) + COOKBOOK_MESON_FLAGS=( --buildtype release --wrap-mode nofallback @@ -927,6 +939,11 @@ function cookbook_configure { COOKBOOK_CMAKE="cmake" COOKBOOK_NINJA="ninja" +COOKBOOK_CMAKE_FLAGS=( + -DBUILD_SHARED_LIBS=False + -DENABLE_SHARED=False + -DENABLE_STATIC=True +) function cookbook_cmake { cat > cross_file.cmake < Date: Sun, 7 Sep 2025 19:05:20 -0600 Subject: [PATCH 21/33] freetype2: use DYNAMIC_STATIC_INIT --- recipes/libs/freetype2/recipe.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/libs/freetype2/recipe.toml b/recipes/libs/freetype2/recipe.toml index 12cb960ca..90c12fac1 100644 --- a/recipes/libs/freetype2/recipe.toml +++ b/recipes/libs/freetype2/recipe.toml @@ -9,6 +9,6 @@ dependencies = [ "zlib" ] script = """ -DYNAMIC_INIT -cookbook_meson -Ddefault_library=both +DYNAMIC_STATIC_INIT +cookbook_meson """ From 1b29c1e173b66f9f7832b1ca4d7be8aa40cf996c Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Sun, 7 Sep 2025 20:53:28 -0600 Subject: [PATCH 22/33] Clean up compiler flags --- recipes/demos/cairodemo/recipe.toml | 2 -- recipes/dev/cmake/recipe.toml | 2 -- recipes/dev/git/recipe.toml | 2 -- recipes/emulators/dosbox/recipe.toml | 4 ++-- recipes/emulators/flycast/recipe.toml | 4 ++-- recipes/emulators/rvvm/recipe.toml | 2 +- recipes/games/eduke32/recipe.toml | 7 +------ recipes/games/gigalomania/recipe.toml | 2 -- recipes/games/sopwith/recipe.toml | 3 +-- recipes/libs/liborbital/recipe.toml | 2 +- recipes/libs/sdl-gfx/recipe.toml | 3 --- recipes/libs/sdl1-ttf/recipe.toml | 3 +-- recipes/libs/sdl2/recipe.toml | 2 +- recipes/tools/schismtracker/recipe.toml | 3 +-- recipes/tui/mdp/recipe.toml | 3 +-- recipes/video/sdl-player/recipe.toml | 2 -- recipes/web/netsurf/recipe.toml | 4 ++-- recipes/wip/libs/other/boost/recipe.toml | 4 ---- recipes/wip/libs/other/freeglut/recipe.toml | 5 ----- recipes/wip/x11/xterm/recipe.toml | 2 +- src/bin/cook.rs | 3 +-- 21 files changed, 16 insertions(+), 48 deletions(-) diff --git a/recipes/demos/cairodemo/recipe.toml b/recipes/demos/cairodemo/recipe.toml index c4f58aac3..6538f035d 100755 --- a/recipes/demos/cairodemo/recipe.toml +++ b/recipes/demos/cairodemo/recipe.toml @@ -13,8 +13,6 @@ dependencies = [ ] template = "custom" script = """ -export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib" -export CPPFLAGS="-I${COOKBOOK_SYSROOT}/include" "${CXX}" \ $("${PKG_CONFIG}" --cflags cairo) \ "${COOKBOOK_RECIPE}/cairodemo.c" \ diff --git a/recipes/dev/cmake/recipe.toml b/recipes/dev/cmake/recipe.toml index b888557bc..1cc846152 100644 --- a/recipes/dev/cmake/recipe.toml +++ b/recipes/dev/cmake/recipe.toml @@ -22,8 +22,6 @@ dependencies = [ script = """ DYNAMIC_INIT -export LDFLAGS="-Wl,-rpath-link,${COOKBOOK_SYSROOT}/lib $LDFLAGS" - COOKBOOK_CMAKE_FLAGS+=( -DBUILD_TESTING=Off -DCMAKE_USE_SYSTEM_BZIP2=On diff --git a/recipes/dev/git/recipe.toml b/recipes/dev/git/recipe.toml index 616f7a815..52d5b70cf 100644 --- a/recipes/dev/git/recipe.toml +++ b/recipes/dev/git/recipe.toml @@ -28,8 +28,6 @@ MAKEFLAGS=( BLK_SHA1=1 V=1 ) -export LDFLAGS="-L${COOKBOOK_SYSROOT}/usr/lib" -export CPPFLAGS="-I${COOKBOOK_SYSROOT}/usr/include" export CURL_CONFIG="${COOKBOOK_SYSROOT}/usr/bin/curl-config" ./configure \ --host="${GNU_TARGET}" \ diff --git a/recipes/emulators/dosbox/recipe.toml b/recipes/emulators/dosbox/recipe.toml index c25c50430..61e31fc94 100644 --- a/recipes/emulators/dosbox/recipe.toml +++ b/recipes/emulators/dosbox/recipe.toml @@ -15,8 +15,8 @@ dependencies = [ template = "custom" script = """ DYNAMIC_INIT -export CFLAGS="-I${COOKBOOK_SYSROOT}/include/SDL" -export CPPFLAGS="-I${COOKBOOK_SYSROOT}/include/SDL" +export CFLAGS="${CFLAGS} -I${COOKBOOK_SYSROOT}/include/SDL" +export CPPFLAGS="${CPPFLAGS} -I${COOKBOOK_SYSROOT}/include/SDL" export LDFLAGS+=" -lorbital" COOKBOOK_CONFIGURE_FLAGS+=( --disable-opengl diff --git a/recipes/emulators/flycast/recipe.toml b/recipes/emulators/flycast/recipe.toml index 65e439c73..0c90a4301 100644 --- a/recipes/emulators/flycast/recipe.toml +++ b/recipes/emulators/flycast/recipe.toml @@ -16,8 +16,8 @@ dependencies = [ ] script = """ DYNAMIC_INIT -export CFLAGS="${CFLAGS} -I${COOKBOOK_SYSROOT}/usr/include -I${COOKBOOK_SYSROOT}/usr/include/SDL2" -export CXXFLAGS="${CXXFLAGS} -D_GLIBCXX_USE_C99_MATH_TR1=1 -I${COOKBOOK_SYSROOT}/usr/include -I${COOKBOOK_SYSROOT}/usr/include/SDL2" +export CFLAGS="${CFLAGS} -I${COOKBOOK_SYSROOT}/usr/include/SDL2" +export CXXFLAGS="${CXXFLAGS} -D_GLIBCXX_USE_C99_MATH_TR1=1 -I${COOKBOOK_SYSROOT}/usr/include/SDL2" #TODO: don't use this export SDL_LIBS="-lSDL2 -lorbital $("${TARGET}-pkg-config" --libs osmesa) -lstdc++" #TODO: don't add curl diff --git a/recipes/emulators/rvvm/recipe.toml b/recipes/emulators/rvvm/recipe.toml index d355186ed..c98185fb1 100644 --- a/recipes/emulators/rvvm/recipe.toml +++ b/recipes/emulators/rvvm/recipe.toml @@ -17,7 +17,7 @@ export BUILDDIR="${COOKBOOK_BUILD}" export DESTDIR="${COOKBOOK_STAGE}" # Redox currently doesn't support dynamic library loading -export LDFLAGS="$(pkg-config --libs sdl)" +export LDFLAGS="${LDFLAGS} $(pkg-config --libs sdl)" # Networking is currently broken on Redox (missing setsockopt?) export USE_NET=0 diff --git a/recipes/games/eduke32/recipe.toml b/recipes/games/eduke32/recipe.toml index 79cd4a579..2cc38c167 100644 --- a/recipes/games/eduke32/recipe.toml +++ b/recipes/games/eduke32/recipe.toml @@ -19,14 +19,9 @@ DYNAMIC_INIT # Copy source to build directory rsync -av --delete "${COOKBOOK_SOURCE}/" ./ -export CFLAGS="-I${COOKBOOK_SYSROOT}/include -I${COOKBOOK_SYSROOT}/include/SDL" +export CFLAGS="${CFLAGS} -I${COOKBOOK_SYSROOT}/include/SDL" export SDLCONFIG="${COOKBOOK_SYSROOT}/bin/sdl-config --prefix=${COOKBOOK_SYSROOT}" -export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib" -if [ "${COOKBOOK_DYNAMIC}" != "1" ]; then - LDFLAGS+=" -static" -fi - PLATFORM=REDOX "${COOKBOOK_MAKE}" -j"$($NPROC)" mkdir -pv "${COOKBOOK_STAGE}/usr/games" diff --git a/recipes/games/gigalomania/recipe.toml b/recipes/games/gigalomania/recipe.toml index a39f84fe8..5a000cba2 100644 --- a/recipes/games/gigalomania/recipe.toml +++ b/recipes/games/gigalomania/recipe.toml @@ -21,8 +21,6 @@ DYNAMIC_INIT rsync -av --delete "${COOKBOOK_SOURCE}/" ./ export CPPHOST="${TARGET}-g++" -export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib" -export CPPFLAGS="-I${COOKBOOK_SYSROOT}/include" "${REDOX_MAKE}" all -j"$(${NPROC})" diff --git a/recipes/games/sopwith/recipe.toml b/recipes/games/sopwith/recipe.toml index 60bdad06d..219c5c334 100644 --- a/recipes/games/sopwith/recipe.toml +++ b/recipes/games/sopwith/recipe.toml @@ -10,8 +10,7 @@ dependencies = [ "libiconv", ] script = """ -export CFLAGS="-I${COOKBOOK_SYSROOT}/include -I${COOKBOOK_SYSROOT}/include/SDL" -export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib -static" +export CFLAGS="${CFLAGS} -I${COOKBOOK_SYSROOT}/include/SDL" export LIBS="-lSDL -lorbital" # TODO: Uses sdl-config instead of pkg-config # For some reason, cook_configure breaks spectacularly on this diff --git a/recipes/libs/liborbital/recipe.toml b/recipes/libs/liborbital/recipe.toml index 0276ea61e..a3e0c5fe1 100644 --- a/recipes/libs/liborbital/recipe.toml +++ b/recipes/libs/liborbital/recipe.toml @@ -4,7 +4,7 @@ git = "https://gitlab.redox-os.org/redox-os/liborbital.git" [build] template = "custom" script = """ -DYNAMIC_INIT +DYNAMIC_STATIC_INIT rsync -av --delete "${COOKBOOK_SOURCE}/" ./ "${COOKBOOK_CARGO}" build --release "${COOKBOOK_MAKE}" install HOST="${TARGET}" DESTDIR="${COOKBOOK_STAGE}" diff --git a/recipes/libs/sdl-gfx/recipe.toml b/recipes/libs/sdl-gfx/recipe.toml index 1ba2b3542..540b8d158 100644 --- a/recipes/libs/sdl-gfx/recipe.toml +++ b/recipes/libs/sdl-gfx/recipe.toml @@ -14,9 +14,6 @@ dependencies = [ "libiconv", ] script = """ -export CFLAGS="-I${COOKBOOK_SYSROOT}/include" -export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib" - COOKBOOK_CONFIGURE_FLAGS=( --prefix=/ --build="$(gcc -dumpmachine)" diff --git a/recipes/libs/sdl1-ttf/recipe.toml b/recipes/libs/sdl1-ttf/recipe.toml index 7c335b023..4d0280e6e 100644 --- a/recipes/libs/sdl1-ttf/recipe.toml +++ b/recipes/libs/sdl1-ttf/recipe.toml @@ -16,8 +16,7 @@ dependencies = [ "zlib", ] script = """ -export CFLAGS="-I${COOKBOOK_SYSROOT}/include -I${COOKBOOK_SYSROOT}/include/freetype2" -export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib" +export CFLAGS="${CFLAGS} -I${COOKBOOK_SYSROOT}/include/freetype2" COOKBOOK_CONFIGURE_FLAGS=( --prefix=/ diff --git a/recipes/libs/sdl2/recipe.toml b/recipes/libs/sdl2/recipe.toml index 9cc943ac2..bef94c0a2 100644 --- a/recipes/libs/sdl2/recipe.toml +++ b/recipes/libs/sdl2/recipe.toml @@ -12,7 +12,7 @@ dependencies = [ ] script = """ DYNAMIC_INIT -export LDFLAGS="$LDFLAGS -lorbital -lOSMesa -lstdc++" +export LDFLAGS="${LDFLAGS} -lorbital -lOSMesa -lstdc++" COOKBOOK_CONFIGURE_FLAGS+=( --disable-pulseaudio --disable-video-x11 diff --git a/recipes/tools/schismtracker/recipe.toml b/recipes/tools/schismtracker/recipe.toml index aea391eaf..7d08b5ad5 100644 --- a/recipes/tools/schismtracker/recipe.toml +++ b/recipes/tools/schismtracker/recipe.toml @@ -14,8 +14,7 @@ dependencies = [ "libiconv", ] script = """ -export CFLAGS="-I${COOKBOOK_SYSROOT}/include -I${COOKBOOK_SYSROOT}/include/SDL" -export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib -static" +export CFLAGS="${CFLAGS} -I${COOKBOOK_SYSROOT}/include/SDL" export SDL_CONFIG="${COOKBOOK_SYSROOT}/bin/sdl-config" COOKBOOK_CONFIGURE_FLAGS=( diff --git a/recipes/tui/mdp/recipe.toml b/recipes/tui/mdp/recipe.toml index a78e477fe..ca3be43af 100644 --- a/recipes/tui/mdp/recipe.toml +++ b/recipes/tui/mdp/recipe.toml @@ -10,8 +10,7 @@ dependencies = [ script = """ rsync -av --delete --exclude='.git' "${COOKBOOK_SOURCE}/" ./ -export CFLAGS="-I${COOKBOOK_SYSROOT}/include -I${COOKBOOK_SYSROOT}/include/ncursesw" -export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib" +export CFLAGS="${CFLAGS} -I${COOKBOOK_SYSROOT}/include/ncursesw" "${COOKBOOK_MAKE}" -j"$(${NPROC})" diff --git a/recipes/video/sdl-player/recipe.toml b/recipes/video/sdl-player/recipe.toml index 5f8ee857c..b870523b3 100644 --- a/recipes/video/sdl-player/recipe.toml +++ b/recipes/video/sdl-player/recipe.toml @@ -11,8 +11,6 @@ dependencies = [ ] script = """ rsync -av --delete --exclude='.git' "${COOKBOOK_SOURCE}/" ./ -export CPPFLAGS="-I${COOKBOOK_SYSROOT}/include" -export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib -static" "${COOKBOOK_MAKE}" -j"$(${NPROC})" mkdir -pv "${COOKBOOK_STAGE}/bin" diff --git a/recipes/web/netsurf/recipe.toml b/recipes/web/netsurf/recipe.toml index 5501fa549..fabdc0321 100644 --- a/recipes/web/netsurf/recipe.toml +++ b/recipes/web/netsurf/recipe.toml @@ -27,8 +27,8 @@ DYNAMIC_INIT rsync -av --delete "${COOKBOOK_SOURCE}/" ./ export TARGET="framebuffer" -export CFLAGS="-I${COOKBOOK_SYSROOT}/include -I${PWD}/inst-${TARGET}/include" -export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib -L${PWD}/inst-${TARGET}/lib -Wl,--allow-multiple-definition -Wl,-rpath-link,${COOKBOOK_SYSROOT}/lib" +export CFLAGS="${CFLAGS} -I${PWD}/inst-${TARGET}/include" +export LDFLAGS="${LDFLAGS} -L${COOKBOOK_SYSROOT}/lib -L${PWD}/inst-${TARGET}/lib -Wl,--allow-multiple-definition -Wl,-rpath-link,${COOKBOOK_SYSROOT}/lib" # nghttp2 is not linked for some reason export LDFLAGS="${LDFLAGS} -lcurl -lnghttp2" diff --git a/recipes/wip/libs/other/boost/recipe.toml b/recipes/wip/libs/other/boost/recipe.toml index 8664e7217..d4903267e 100644 --- a/recipes/wip/libs/other/boost/recipe.toml +++ b/recipes/wip/libs/other/boost/recipe.toml @@ -16,10 +16,6 @@ dependencies = [ # "zstd", ] script = """ -export CFLAGS="${CFLAGS} -I${COOKBOOK_SYSROOT}/include" -export CPPFLAGS="${CPPFLAGS} ${CFLAGS}" -export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib --static" - BOOST_ROOT="${COOKBOOK_STAGE}/usr" mkdir -p "${BOOST_ROOT}" diff --git a/recipes/wip/libs/other/freeglut/recipe.toml b/recipes/wip/libs/other/freeglut/recipe.toml index f2b576ad9..dbb525b95 100644 --- a/recipes/wip/libs/other/freeglut/recipe.toml +++ b/recipes/wip/libs/other/freeglut/recipe.toml @@ -9,11 +9,6 @@ dependencies = [ ] template = "custom" script = """ -export CFLAGS="-I${COOKBOOK_SYSROOT}/include" -export CPPFLAGS="-I${COOKBOOK_SYSROOT}/include" -export CXXFLAGS="-I${COOKBOOK_SYSROOT}/include" -export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib" - cat > redox.cmake < Date: Sun, 7 Sep 2025 20:53:56 -0600 Subject: [PATCH 23/33] openssl1: fix target used for compiler --- recipes/libs/openssl1/recipe.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/libs/openssl1/recipe.toml b/recipes/libs/openssl1/recipe.toml index 6b01054b1..b2836cf9f 100644 --- a/recipes/libs/openssl1/recipe.toml +++ b/recipes/libs/openssl1/recipe.toml @@ -14,7 +14,7 @@ COOKBOOK_CONFIGURE_FLAGS=( "redox-${ARCH}" --prefix="/" ) -export CC="${CC_WRAPPER} ${TARGET}-gcc" +export CC="${CC_WRAPPER} ${GNU_TARGET}-gcc" "${COOKBOOK_CONFIGURE}" "${COOKBOOK_CONFIGURE_FLAGS[@]}" "${COOKBOOK_MAKE}" -j"${COOKBOOK_MAKE_JOBS}" "${COOKBOOK_MAKE}" install_sw install_ssldirs DESTDIR="${COOKBOOK_STAGE}" From 554893f862bba7162bda40e34c39e6e8aad87cae Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Sun, 7 Sep 2025 21:28:58 -0600 Subject: [PATCH 24/33] Update pkgar --- pkgar | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgar b/pkgar index 185fe5c33..44677ccbf 160000 --- a/pkgar +++ b/pkgar @@ -1 +1 @@ -Subproject commit 185fe5c3346d9aa552f308cf61c66f7b6e25280a +Subproject commit 44677ccbff9e315ce9de1a85ac5a30cfff1aad30 From abc2c810d0369e4119cdc7b467f3109ac87aa91f Mon Sep 17 00:00:00 2001 From: Wildan M Date: Mon, 8 Sep 2025 13:31:12 +0700 Subject: [PATCH 25/33] Update and promote rsync --- recipes/archives/lz4/recipe.toml | 9 +++----- recipes/archives/zstd/recipe.toml | 1 + recipes/net/rsync/recipe.toml | 12 +++++++++++ recipes/net/rsync/redox.patch | 25 +++++++++++++++++++++++ recipes/wip/libs/other/xxhash/recipe.toml | 9 ++++++-- recipes/wip/net/other/rsync/recipe.toml | 12 ----------- 6 files changed, 48 insertions(+), 20 deletions(-) create mode 100644 recipes/net/rsync/recipe.toml create mode 100644 recipes/net/rsync/redox.patch delete mode 100644 recipes/wip/net/other/rsync/recipe.toml diff --git a/recipes/archives/lz4/recipe.toml b/recipes/archives/lz4/recipe.toml index bd1763e51..1aacf8260 100644 --- a/recipes/archives/lz4/recipe.toml +++ b/recipes/archives/lz4/recipe.toml @@ -6,13 +6,10 @@ patches = ["redox.patch"] [build] template = "custom" script = """ +DYNAMIC_INIT rsync -av --delete "${COOKBOOK_SOURCE}/" ./ - -# No configure provided -COOKBOOK_CONFIGURE="true" -COOKBOOK_CONFIGURE_FLAGS="" - export CPPFLAGS="${CPPFLAGS} -D_REDOX" -cookbook_configure +${COOKBOOK_MAKE} +${COOKBOOK_MAKE} install DESTDIR="${COOKBOOK_STAGE}" prefix="/usr" """ diff --git a/recipes/archives/zstd/recipe.toml b/recipes/archives/zstd/recipe.toml index e42573e07..906848506 100644 --- a/recipes/archives/zstd/recipe.toml +++ b/recipes/archives/zstd/recipe.toml @@ -9,4 +9,5 @@ script = """ DYNAMIC_INIT rsync -av --delete "${COOKBOOK_SOURCE}/" ./ ${COOKBOOK_MAKE} +${COOKBOOK_MAKE} install DESTDIR="${COOKBOOK_STAGE}" prefix="/usr" """ diff --git a/recipes/net/rsync/recipe.toml b/recipes/net/rsync/recipe.toml new file mode 100644 index 000000000..4a967f270 --- /dev/null +++ b/recipes/net/rsync/recipe.toml @@ -0,0 +1,12 @@ +[source] +tar = "https://download.samba.org/pub/rsync/src/rsync-3.4.1.tar.gz" +patches = ["redox.patch"] + +[build] +template = "configure" +dependencies = [ + "zstd", + "lz4", + "openssl1", + "xxhash", +] diff --git a/recipes/net/rsync/redox.patch b/recipes/net/rsync/redox.patch new file mode 100644 index 000000000..07a929b01 --- /dev/null +++ b/recipes/net/rsync/redox.patch @@ -0,0 +1,25 @@ +diff -ruwN source/rsync.h source-new/rsync.h +--- source/rsync.h 2025-01-16 02:21:54.000000000 +0700 ++++ source-new/rsync.h 2025-09-08 12:18:06.427647717 +0700 +@@ -483,6 +483,21 @@ + #include + #endif + ++#ifdef __redox__ ++ ++// no sys/sysmacros.h, probably no problem ++#include ++#define major(dev) (0) ++#define minor(dev) (0) ++#define makedev(maj, min) (0) ++ ++// no openat yet ++#undef O_NOFOLLOW ++#undef O_DIRECTORY ++#undef AT_FDCWD ++ ++#endif ++ + #ifdef MAKEDEV_TAKES_3_ARGS + #define MAKEDEV(devmajor,devminor) makedev(0,devmajor,devminor) + #else diff --git a/recipes/wip/libs/other/xxhash/recipe.toml b/recipes/wip/libs/other/xxhash/recipe.toml index 20f056531..902e13476 100644 --- a/recipes/wip/libs/other/xxhash/recipe.toml +++ b/recipes/wip/libs/other/xxhash/recipe.toml @@ -1,6 +1,11 @@ -#TODO missing script for building, lacking build instructions +#TODO promote [source] git = "https://github.com/Cyan4973/xxHash" -rev = "bbb27a5efb85b92a0486cf361a8635715a53f6ba" +rev = "bab7e27f4c6ae4efbb83dd99ae8a554423571635" # 0.8.3-dev (cmake support) [build] template = "custom" +script = """ +DYNAMIC_INIT +COOKBOOK_SOURCE="${COOKBOOK_SOURCE}"/build/cmake +cookbook_cmake +""" diff --git a/recipes/wip/net/other/rsync/recipe.toml b/recipes/wip/net/other/rsync/recipe.toml deleted file mode 100644 index e5dcf2109..000000000 --- a/recipes/wip/net/other/rsync/recipe.toml +++ /dev/null @@ -1,12 +0,0 @@ -#TODO make all dependencies work -[source] -tar = "https://download.samba.org/pub/rsync/src/rsync-3.2.7.tar.gz" -[build] -template = "configure" -dependencies = [ - "zstd", - "zlib", - "lz4", - "popt", - "xxhash", -] From e56a6212c40ae0569c0ded70db2b514116dbc411 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Mon, 8 Sep 2025 13:43:20 +0700 Subject: [PATCH 26/33] Update cargo lock --- Cargo.lock | 62 +++++++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ce231b233..e1ca99bf6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1538,6 +1538,8 @@ checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "pkgar" version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db98a45d3bdaf7dceeee5716f3eec9af0e67deec64eec9e717536b89de323c22" dependencies = [ "anyhow", "blake3 0.3.8", @@ -1550,29 +1552,17 @@ dependencies = [ [[package]] name = "pkgar" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db98a45d3bdaf7dceeee5716f3eec9af0e67deec64eec9e717536b89de323c22" +version = "0.1.19" dependencies = [ "anyhow", "blake3 0.3.8", "bytemuck", "clap", - "pkgar-core 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", - "pkgar-keys 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", + "pkgar-core 0.1.19", + "pkgar-keys 0.1.19", "thiserror 2.0.12", ] -[[package]] -name = "pkgar-core" -version = "0.1.18" -dependencies = [ - "bitflags 1.3.2", - "blake3 0.3.8", - "bytemuck", - "dryoc", -] - [[package]] name = "pkgar-core" version = "0.1.18" @@ -1585,9 +1575,21 @@ dependencies = [ "dryoc", ] +[[package]] +name = "pkgar-core" +version = "0.1.19" +dependencies = [ + "bitflags 1.3.2", + "blake3 0.3.8", + "bytemuck", + "dryoc", +] + [[package]] name = "pkgar-keys" version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4494325c5c408d718d1df657cceeadc2102f02e7c9298343ce230f557f13e80c" dependencies = [ "anyhow", "clap", @@ -1604,16 +1606,14 @@ dependencies = [ [[package]] name = "pkgar-keys" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4494325c5c408d718d1df657cceeadc2102f02e7c9298343ce230f557f13e80c" +version = "0.1.19" dependencies = [ "anyhow", "clap", "dirs 3.0.2", "hex", "lazy_static", - "pkgar-core 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", + "pkgar-core 0.1.19", "seckey", "serde", "termion", @@ -1838,9 +1838,9 @@ checksum = "70f49b2c29ae3c72ff3a8dbc1c5eefba9093a8c5ceaa8ca5292833816fe931e2" dependencies = [ "anyhow", "indicatif", - "pkgar 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", - "pkgar-core 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", - "pkgar-keys 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", + "pkgar 0.1.18", + "pkgar-core 0.1.18", + "pkgar-keys 0.1.18", "reqwest", "serde", "serde_derive", @@ -1855,9 +1855,9 @@ source = "git+https://gitlab.redox-os.org/redox-os/pkgutils#436c97a0df26bfce24e3 dependencies = [ "anyhow", "ignore", - "pkgar 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", - "pkgar-core 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", - "pkgar-keys 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", + "pkgar 0.1.18", + "pkgar-core 0.1.18", + "pkgar-keys 0.1.18", "reqwest", "serde", "serde_derive", @@ -1883,9 +1883,9 @@ dependencies = [ "ignore", "object", "pbr", - "pkgar 0.1.18", - "pkgar-core 0.1.18", - "pkgar-keys 0.1.18", + "pkgar 0.1.19", + "pkgar-core 0.1.19", + "pkgar-keys 0.1.19", "redox-pkg 0.2.7", "redoxer", "serde", @@ -1908,9 +1908,9 @@ dependencies = [ "fscommon", "gpt", "libc", - "pkgar 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", - "pkgar-core 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", - "pkgar-keys 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", + "pkgar 0.1.18", + "pkgar-core 0.1.18", + "pkgar-keys 0.1.18", "rand 0.8.5", "redox-pkg 0.2.5", "redox_liner", From b8f49078b933add01c45a2869ecd2248a8bc286c Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Mon, 8 Sep 2025 08:02:53 -0600 Subject: [PATCH 27/33] Use GNU_TARGET prefix for cmake cross compiler --- src/bin/cook.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bin/cook.rs b/src/bin/cook.rs index b6f4ed5c4..a5d609976 100644 --- a/src/bin/cook.rs +++ b/src/bin/cook.rs @@ -945,22 +945,22 @@ COOKBOOK_CMAKE_FLAGS=( ) function cookbook_cmake { cat > cross_file.cmake <> cross_file.cmake echo "set(CMAKE_CXX_COMPILER_LAUNCHER ${CC_WRAPPER})" >> cross_file.cmake From a53533d55fe049248c209804cf006b0966864aae Mon Sep 17 00:00:00 2001 From: Wildan M Date: Mon, 8 Sep 2025 22:24:10 +0700 Subject: [PATCH 28/33] Update cargo --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e1ca99bf6..1b8f1fd32 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1850,8 +1850,8 @@ dependencies = [ [[package]] name = "redox-pkg" -version = "0.2.7" -source = "git+https://gitlab.redox-os.org/redox-os/pkgutils#436c97a0df26bfce24e33a5a86a21218aca7591f" +version = "0.2.8" +source = "git+https://gitlab.redox-os.org/redox-os/pkgutils#ea2641126c8b38d7b8997c5c7ebec74999fc9578" dependencies = [ "anyhow", "ignore", @@ -1886,7 +1886,7 @@ dependencies = [ "pkgar 0.1.19", "pkgar-core 0.1.19", "pkgar-keys 0.1.19", - "redox-pkg 0.2.7", + "redox-pkg 0.2.8", "redoxer", "serde", "tempfile", @@ -2923,7 +2923,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.48.0", ] [[package]] From 1806fa3556ae60eabdfbada22f5dd58580a75cfe Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Mon, 8 Sep 2025 15:01:42 -0600 Subject: [PATCH 29/33] glib: workaround partial support of openat --- recipes/libs/glib/redox.patch | 57 ++++++++++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 5 deletions(-) diff --git a/recipes/libs/glib/redox.patch b/recipes/libs/glib/redox.patch index 90b4cdf77..18024068e 100644 --- a/recipes/libs/glib/redox.patch +++ b/recipes/libs/glib/redox.patch @@ -1,6 +1,20 @@ +diff -ruwN '--exclude=subprojects' glib-2.82.5/gio/glocalfile.c source/gio/glocalfile.c +--- glib-2.82.5/gio/glocalfile.c 2025-02-20 06:08:16.000000000 -0700 ++++ source/gio/glocalfile.c 2025-09-08 15:00:09.240010601 -0600 +@@ -77,6 +77,10 @@ + + #include "glib-private.h" + ++#if defined(__redox__) ++#undef AT_FDCWD ++#endif ++ + #ifdef G_OS_WIN32 + #include + #include diff -ruwN '--exclude=subprojects' glib-2.82.5/gio/gnetworking.h.in source/gio/gnetworking.h.in --- glib-2.82.5/gio/gnetworking.h.in 2025-02-20 06:08:16.000000000 -0700 -+++ source/gio/gnetworking.h.in 2025-04-10 14:12:46.307891418 -0600 ++++ source/gio/gnetworking.h.in 2025-04-21 14:36:14.671018625 -0600 @@ -40,13 +40,17 @@ #include #include @@ -19,9 +33,42 @@ diff -ruwN '--exclude=subprojects' glib-2.82.5/gio/gnetworking.h.in source/gio/g @NAMESER_COMPAT_INCLUDE@ #ifndef __GI_SCANNER__ +diff -ruwN '--exclude=subprojects' glib-2.82.5/gio/gsocket.c source/gio/gsocket.c +--- glib-2.82.5/gio/gsocket.c 2025-02-20 06:08:16.000000000 -0700 ++++ source/gio/gsocket.c 2025-06-16 09:52:49.595949295 -0600 +@@ -487,6 +487,7 @@ + if (!g_socket_get_option (socket, SOL_SOCKET, SO_TYPE, &value, NULL)) + { + errsv = get_socket_errno (); ++ fprintf(stderr, "%s:%d\n", __FILE__, __LINE__); + goto err; + } + +@@ -513,6 +514,7 @@ + if (getsockname (fd, &address.sa, &addrlen) != 0) + { + errsv = get_socket_errno (); ++ fprintf(stderr, "%s:%d\n", __FILE__, __LINE__); + goto err; + } + +@@ -531,11 +533,13 @@ + if (!g_socket_get_option (socket, SOL_SOCKET, SO_DOMAIN, &family, NULL)) + { + errsv = get_socket_errno (); ++ fprintf(stderr, "%s:%d\n", __FILE__, __LINE__); + goto err; + } + #else + /* This will translate to G_IO_ERROR_FAILED on either unix or windows */ + errsv = -1; ++ fprintf(stderr, "%s:%d\n", __FILE__, __LINE__); + goto err; + #endif + } diff -ruwN '--exclude=subprojects' glib-2.82.5/gio/gthreadedresolver.c source/gio/gthreadedresolver.c --- glib-2.82.5/gio/gthreadedresolver.c 2025-02-20 06:08:16.000000000 -0700 -+++ source/gio/gthreadedresolver.c 2025-04-10 15:19:32.649611384 -0600 ++++ source/gio/gthreadedresolver.c 2025-04-21 14:36:14.672018626 -0600 @@ -579,8 +579,26 @@ return g_task_propagate_pointer (G_TASK (result), error); } @@ -64,7 +111,7 @@ diff -ruwN '--exclude=subprojects' glib-2.82.5/gio/gthreadedresolver.c source/gi len = res_query (rrname, C_IN, rrtype, answer->data, answer->len); diff -ruwN '--exclude=subprojects' glib-2.82.5/gio/gunixmounts.c source/gio/gunixmounts.c --- glib-2.82.5/gio/gunixmounts.c 2025-02-20 06:08:16.000000000 -0700 -+++ source/gio/gunixmounts.c 2025-04-10 14:57:29.342807607 -0600 ++++ source/gio/gunixmounts.c 2025-04-21 14:36:14.672018626 -0600 @@ -1135,6 +1135,37 @@ return NULL; } @@ -134,7 +181,7 @@ diff -ruwN '--exclude=subprojects' glib-2.82.5/gio/gunixmounts.c source/gio/guni } diff -ruwN '--exclude=subprojects' glib-2.82.5/gio/meson.build source/gio/meson.build --- glib-2.82.5/gio/meson.build 2025-02-20 06:08:16.000000000 -0700 -+++ source/gio/meson.build 2025-04-10 14:06:57.909467382 -0600 ++++ source/gio/meson.build 2025-04-21 14:36:14.672018626 -0600 @@ -18,7 +18,7 @@ gnetworking_h_nameser_compat_include = '' @@ -155,7 +202,7 @@ diff -ruwN '--exclude=subprojects' glib-2.82.5/gio/meson.build source/gio/meson. int main (int argc, char ** argv) { diff -ruwN '--exclude=subprojects' glib-2.82.5/gio/xdgmime/xdgmimecache.c source/gio/xdgmime/xdgmimecache.c --- glib-2.82.5/gio/xdgmime/xdgmimecache.c 2025-02-20 06:08:16.000000000 -0700 -+++ source/gio/xdgmime/xdgmimecache.c 2025-04-10 14:11:44.020815595 -0600 ++++ source/gio/xdgmime/xdgmimecache.c 2025-04-21 14:36:14.673018628 -0600 @@ -22,7 +22,7 @@ #include #include From 9f4b064e76bc0e8ce9ec009b2c35344b7f008ec7 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Mon, 8 Sep 2025 21:01:20 -0600 Subject: [PATCH 30/33] openal: fix dynamic linking and use cookbook_cmake --- recipes/wip/libs/audio/openal/recipe.toml | 47 ++++++----------------- 1 file changed, 11 insertions(+), 36 deletions(-) diff --git a/recipes/wip/libs/audio/openal/recipe.toml b/recipes/wip/libs/audio/openal/recipe.toml index a4c8d94b5..0f1d8352e 100644 --- a/recipes/wip/libs/audio/openal/recipe.toml +++ b/recipes/wip/libs/audio/openal/recipe.toml @@ -1,4 +1,3 @@ -#TODO probably wrong script, see https://openal-soft.org/#installing [source] tar = "https://openal-soft.org/openal-releases/openal-soft-1.24.1.tar.bz2" blake3 = "8aeaa8307d3e14331ad20761c537ffebe70975cb7c3343e8d5c0c0ed7bc16eab" @@ -17,46 +16,22 @@ dependencies = [ "zlib", ] script = """ -export CFLAGS="${CFLAGS} -I${COOKBOOK_SYSROOT}/include -I${COOKBOOK_SYSROOT}/include/SDL2" -export CXXFLAGS="${CXXFLAGS} -I${COOKBOOK_SYSROOT}/include -I${COOKBOOK_SYSROOT}/include/SDL2" - -cat > redox.cmake < Date: Mon, 8 Sep 2025 21:07:26 -0600 Subject: [PATCH 31/33] libogg: update and drop patch --- recipes/libs/libogg/recipe.toml | 8 +- recipes/libs/libogg/redox.patch | 2833 ------------------------------- 2 files changed, 2 insertions(+), 2839 deletions(-) delete mode 100644 recipes/libs/libogg/redox.patch diff --git a/recipes/libs/libogg/recipe.toml b/recipes/libs/libogg/recipe.toml index 4d35c4c05..9e219c87c 100644 --- a/recipes/libs/libogg/recipe.toml +++ b/recipes/libs/libogg/recipe.toml @@ -1,12 +1,8 @@ [source] -tar = "https://github.com/xiph/ogg/releases/download/v1.3.3/libogg-1.3.3.tar.xz" -blake3 = "8220c0e4082fa26c07b10bfe31f641d2e33ebe1d1bb0b20221b7016bc8b78a3a" -patches = [ - "redox.patch" -] +tar = "https://github.com/xiph/ogg/releases/download/v1.3.4/libogg-1.3.4.tar.xz" +blake3 = "1cffbe7c498555ddfdb1390d7a38179c4bead6129ea37b1b1d54f3a76b816304" script = """ DYNAMIC_INIT -GNU_CONFIG_GET config.sub autotools_recursive_regenerate """ diff --git a/recipes/libs/libogg/redox.patch b/recipes/libs/libogg/redox.patch deleted file mode 100644 index c07ab514d..000000000 --- a/recipes/libs/libogg/redox.patch +++ /dev/null @@ -1,2833 +0,0 @@ ---- source/config.sub 2017-11-07 13:38:55.000000000 -0700 -+++ source-new/config.sub 2020-05-20 15:34:35.000000000 -0600 -@@ -1,8 +1,8 @@ - #! /bin/sh - # Configuration validation subroutine script. --# Copyright 1992-2016 Free Software Foundation, Inc. -+# Copyright 1992-2020 Free Software Foundation, Inc. - --timestamp='2016-09-05' -+timestamp='2020-05-04' - - # This file is free software; you can redistribute it and/or modify it - # under the terms of the GNU General Public License as published by -@@ -15,7 +15,7 @@ - # General Public License for more details. - # - # You should have received a copy of the GNU General Public License --# along with this program; if not, see . -+# along with this program; if not, see . - # - # As a special exception to the GNU General Public License, if you - # distribute this file as part of a program that contains a -@@ -33,7 +33,7 @@ - # Otherwise, we print the canonical config type on stdout and succeed. - - # You can get the latest version of this script from: --# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub -+# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub - - # This file is supposed to be the same for all GNU packages - # and recognize all the CPU types, system types and aliases -@@ -57,7 +57,7 @@ - - Canonicalize a configuration name. - --Operation modes: -+Options: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit -@@ -67,7 +67,7 @@ - version="\ - GNU config.sub ($timestamp) - --Copyright 1992-2016 Free Software Foundation, Inc. -+Copyright 1992-2020 Free Software Foundation, Inc. - - This is free software; see the source for copying conditions. There is NO - warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." -@@ -89,12 +89,12 @@ - - ) # Use stdin as input. - break ;; - -* ) -- echo "$me: invalid option $1$help" -+ echo "$me: invalid option $1$help" >&2 - exit 1 ;; - - *local*) - # First pass through any local machine types. -- echo $1 -+ echo "$1" - exit ;; - - * ) -@@ -110,1242 +110,1164 @@ - exit 1;; - esac - --# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). --# Here we must recognize all the valid KERNEL-OS combinations. --maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -+# Split fields of configuration type -+# shellcheck disable=SC2162 -+IFS="-" read field1 field2 field3 field4 <&2 -+ exit 1 -+ ;; -+ *-*-*-*) -+ basic_machine=$field1-$field2 -+ os=$field3-$field4 -+ ;; -+ *-*-*) -+ # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two -+ # parts -+ maybe_os=$field2-$field3 - case $maybe_os in -- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ -- linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ -- knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ -- kopensolaris*-gnu* | cloudabi*-eabi* | \ -- storm-chaos* | os2-emx* | rtmk-nova*) -- os=-$maybe_os -- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` -+ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \ -+ | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \ -+ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ -+ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ -+ | storm-chaos* | os2-emx* | rtmk-nova*) -+ basic_machine=$field1 -+ os=$maybe_os - ;; - android-linux) -- os=-linux-android -- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown -+ basic_machine=$field1-unknown -+ os=linux-android - ;; - *) -- basic_machine=`echo $1 | sed 's/-[^-]*$//'` -- if [ $basic_machine != $1 ] -- then os=`echo $1 | sed 's/.*-/-/'` -- else os=; fi -+ basic_machine=$field1-$field2 -+ os=$field3 - ;; - esac -- --### Let's recognize common machines as not being operating systems so --### that things like config.sub decstation-3100 work. We also --### recognize some manufacturers as not being operating systems, so we --### can provide default operating systems below. --case $os in -- -sun*os*) -- # Prevent following clause from handling this invalid input. - ;; -- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -- -apple | -axis | -knuth | -cray | -microblaze*) -+ *-*) -+ # A lone config we happen to match not fitting any pattern -+ case $field1-$field2 in -+ decstation-3100) -+ basic_machine=mips-dec - os= -- basic_machine=$1 -- ;; -- -bluegene*) -- os=-cnk - ;; -- -sim | -cisco | -oki | -wec | -winbond) -+ *-*) -+ # Second component is usually, but not always the OS -+ case $field2 in -+ # Prevent following clause from handling this valid os -+ sun*os*) -+ basic_machine=$field1 -+ os=$field2 -+ ;; -+ # Manufacturers -+ dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ -+ | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ -+ | unicom* | ibm* | next | hp | isi* | apollo | altos* \ -+ | convergent* | ncr* | news | 32* | 3600* | 3100* \ -+ | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ -+ | ultra | tti* | harris | dolphin | highlevel | gould \ -+ | cbm | ns | masscomp | apple | axis | knuth | cray \ -+ | microblaze* | sim | cisco \ -+ | oki | wec | wrs | winbond) -+ basic_machine=$field1-$field2 - os= -- basic_machine=$1 -- ;; -- -scout) -- ;; -- -wrs) -- os=-vxworks -- basic_machine=$1 -- ;; -- -chorusos*) -- os=-chorusos -- basic_machine=$1 - ;; -- -chorusrdb) -- os=-chorusrdb -- basic_machine=$1 -- ;; -- -hiux*) -- os=-hiuxwe2 -- ;; -- -sco6) -- os=-sco5v6 -- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` -- ;; -- -sco5) -- os=-sco3.2v5 -- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` -- ;; -- -sco4) -- os=-sco3.2v4 -- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` -- ;; -- -sco3.2.[4-9]*) -- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` -- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` -- ;; -- -sco3.2v[4-9]*) -- # Don't forget version if it is 3.2v4 or newer. -- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` -- ;; -- -sco5v6*) -- # Don't forget version if it is 3.2v4 or newer. -- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` -- ;; -- -sco*) -- os=-sco3.2v2 -- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` -- ;; -- -udk*) -- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` -- ;; -- -isc) -- os=-isc2.2 -- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` -- ;; -- -clix*) -- basic_machine=clipper-intergraph -- ;; -- -isc*) -- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` -- ;; -- -lynx*178) -- os=-lynxos178 -- ;; -- -lynx*5) -- os=-lynxos5 -- ;; -- -lynx*) -- os=-lynxos -- ;; -- -ptx*) -- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` -- ;; -- -windowsnt*) -- os=`echo $os | sed -e 's/windowsnt/winnt/'` -- ;; -- -psos*) -- os=-psos -- ;; -- -mint | -mint[0-9]*) -- basic_machine=m68k-atari -- os=-mint -+ *) -+ basic_machine=$field1 -+ os=$field2 - ;; - esac -- --# Decode aliases for certain CPU-COMPANY combinations. --case $basic_machine in -- # Recognize the basic CPU types without company name. -- # Some are omitted here because they have special meanings below. -- 1750a | 580 \ -- | a29k \ -- | aarch64 | aarch64_be \ -- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ -- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ -- | am33_2.0 \ -- | arc | arceb \ -- | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ -- | avr | avr32 \ -- | ba \ -- | be32 | be64 \ -- | bfin \ -- | c4x | c8051 | clipper \ -- | d10v | d30v | dlx | dsp16xx \ -- | e2k | epiphany \ -- | fido | fr30 | frv | ft32 \ -- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ -- | hexagon \ -- | i370 | i860 | i960 | ia64 \ -- | ip2k | iq2000 \ -- | k1om \ -- | le32 | le64 \ -- | lm32 \ -- | m32c | m32r | m32rle | m68000 | m68k | m88k \ -- | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ -- | mips | mipsbe | mipseb | mipsel | mipsle \ -- | mips16 \ -- | mips64 | mips64el \ -- | mips64octeon | mips64octeonel \ -- | mips64orion | mips64orionel \ -- | mips64r5900 | mips64r5900el \ -- | mips64vr | mips64vrel \ -- | mips64vr4100 | mips64vr4100el \ -- | mips64vr4300 | mips64vr4300el \ -- | mips64vr5000 | mips64vr5000el \ -- | mips64vr5900 | mips64vr5900el \ -- | mipsisa32 | mipsisa32el \ -- | mipsisa32r2 | mipsisa32r2el \ -- | mipsisa32r6 | mipsisa32r6el \ -- | mipsisa64 | mipsisa64el \ -- | mipsisa64r2 | mipsisa64r2el \ -- | mipsisa64r6 | mipsisa64r6el \ -- | mipsisa64sb1 | mipsisa64sb1el \ -- | mipsisa64sr71k | mipsisa64sr71kel \ -- | mipsr5900 | mipsr5900el \ -- | mipstx39 | mipstx39el \ -- | mn10200 | mn10300 \ -- | moxie \ -- | mt \ -- | msp430 \ -- | nds32 | nds32le | nds32be \ -- | nios | nios2 | nios2eb | nios2el \ -- | ns16k | ns32k \ -- | open8 | or1k | or1knd | or32 \ -- | pdp10 | pdp11 | pj | pjl \ -- | powerpc | powerpc64 | powerpc64le | powerpcle \ -- | pyramid \ -- | riscv32 | riscv64 \ -- | rl78 | rx \ -- | score \ -- | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ -- | sh64 | sh64le \ -- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ -- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ -- | spu \ -- | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ -- | ubicom32 \ -- | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ -- | visium \ -- | we32k \ -- | x86 | xc16x | xstormy16 | xtensa \ -- | z8k | z80) -- basic_machine=$basic_machine-unknown -- ;; -- c54x) -- basic_machine=tic54x-unknown -- ;; -- c55x) -- basic_machine=tic55x-unknown -- ;; -- c6x) -- basic_machine=tic6x-unknown -- ;; -- leon|leon[3-9]) -- basic_machine=sparc-$basic_machine -- ;; -- m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) -- basic_machine=$basic_machine-unknown -- os=-none -- ;; -- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; -- ms1) -- basic_machine=mt-unknown -- ;; -- -- strongarm | thumb | xscale) -- basic_machine=arm-unknown -- ;; -- xgate) -- basic_machine=$basic_machine-unknown -- os=-none -- ;; -- xscaleeb) -- basic_machine=armeb-unknown -- ;; -- -- xscaleel) -- basic_machine=armel-unknown -- ;; -- -- # We use `pc' rather than `unknown' -- # because (1) that's what they normally are, and -- # (2) the word "unknown" tends to confuse beginning users. -- i*86 | x86_64) -- basic_machine=$basic_machine-pc -- ;; -- # Object if more than one company name word. -- *-*-*) -- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 -- exit 1 -- ;; -- # Recognize the basic CPU types with company name. -- 580-* \ -- | a29k-* \ -- | aarch64-* | aarch64_be-* \ -- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ -- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ -- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ -- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ -- | avr-* | avr32-* \ -- | ba-* \ -- | be32-* | be64-* \ -- | bfin-* | bs2000-* \ -- | c[123]* | c30-* | [cjt]90-* | c4x-* \ -- | c8051-* | clipper-* | craynv-* | cydra-* \ -- | d10v-* | d30v-* | dlx-* \ -- | e2k-* | elxsi-* \ -- | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ -- | h8300-* | h8500-* \ -- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ -- | hexagon-* \ -- | i*86-* | i860-* | i960-* | ia64-* \ -- | ip2k-* | iq2000-* \ -- | k1om-* \ -- | le32-* | le64-* \ -- | lm32-* \ -- | m32c-* | m32r-* | m32rle-* \ -- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ -- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ -- | microblaze-* | microblazeel-* \ -- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ -- | mips16-* \ -- | mips64-* | mips64el-* \ -- | mips64octeon-* | mips64octeonel-* \ -- | mips64orion-* | mips64orionel-* \ -- | mips64r5900-* | mips64r5900el-* \ -- | mips64vr-* | mips64vrel-* \ -- | mips64vr4100-* | mips64vr4100el-* \ -- | mips64vr4300-* | mips64vr4300el-* \ -- | mips64vr5000-* | mips64vr5000el-* \ -- | mips64vr5900-* | mips64vr5900el-* \ -- | mipsisa32-* | mipsisa32el-* \ -- | mipsisa32r2-* | mipsisa32r2el-* \ -- | mipsisa32r6-* | mipsisa32r6el-* \ -- | mipsisa64-* | mipsisa64el-* \ -- | mipsisa64r2-* | mipsisa64r2el-* \ -- | mipsisa64r6-* | mipsisa64r6el-* \ -- | mipsisa64sb1-* | mipsisa64sb1el-* \ -- | mipsisa64sr71k-* | mipsisa64sr71kel-* \ -- | mipsr5900-* | mipsr5900el-* \ -- | mipstx39-* | mipstx39el-* \ -- | mmix-* \ -- | mt-* \ -- | msp430-* \ -- | nds32-* | nds32le-* | nds32be-* \ -- | nios-* | nios2-* | nios2eb-* | nios2el-* \ -- | none-* | np1-* | ns16k-* | ns32k-* \ -- | open8-* \ -- | or1k*-* \ -- | orion-* \ -- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ -- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ -- | pyramid-* \ -- | riscv32-* | riscv64-* \ -- | rl78-* | romp-* | rs6000-* | rx-* \ -- | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ -- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ -- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ -- | sparclite-* \ -- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ -- | tahoe-* \ -- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ -- | tile*-* \ -- | tron-* \ -- | ubicom32-* \ -- | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ -- | vax-* \ -- | visium-* \ -- | we32k-* \ -- | x86-* | x86_64-* | xc16x-* | xps100-* \ -- | xstormy16-* | xtensa*-* \ -- | ymp-* \ -- | z8k-* | z80-*) -- ;; -- # Recognize the basic CPU types without company name, with glob match. -- xtensa*) -- basic_machine=$basic_machine-unknown -+ esac - ;; -- # Recognize the various machine names and aliases which stand -- # for a CPU type and a company and sometimes even an OS. -+ *) -+ # Convert single-component short-hands not valid as part of -+ # multi-component configurations. -+ case $field1 in - 386bsd) -- basic_machine=i386-unknown -- os=-bsd -- ;; -- 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) -- basic_machine=m68000-att -- ;; -- 3b*) -- basic_machine=we32k-att -+ basic_machine=i386-pc -+ os=bsd - ;; - a29khif) - basic_machine=a29k-amd -- os=-udi -- ;; -- abacus) -- basic_machine=abacus-unknown -+ os=udi - ;; - adobe68k) - basic_machine=m68010-adobe -- os=-scout -+ os=scout - ;; -- alliant | fx80) -+ alliant) - basic_machine=fx80-alliant -+ os= - ;; - altos | altos3068) - basic_machine=m68k-altos -+ os= - ;; - am29k) - basic_machine=a29k-none -- os=-bsd -- ;; -- amd64) -- basic_machine=x86_64-pc -- ;; -- amd64-*) -- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` -+ os=bsd - ;; - amdahl) - basic_machine=580-amdahl -- os=-sysv -+ os=sysv - ;; -- amiga | amiga-*) -+ amiga) - basic_machine=m68k-unknown -+ os= - ;; - amigaos | amigados) - basic_machine=m68k-unknown -- os=-amigaos -+ os=amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown -- os=-sysv4 -+ os=sysv4 - ;; - apollo68) - basic_machine=m68k-apollo -- os=-sysv -+ os=sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo -- os=-bsd -+ os=bsd - ;; - aros) - basic_machine=i386-pc -- os=-aros -- ;; -- asmjs) -- basic_machine=asmjs-unknown -+ os=aros - ;; - aux) - basic_machine=m68k-apple -- os=-aux -+ os=aux - ;; - balance) - basic_machine=ns32k-sequent -- os=-dynix -+ os=dynix - ;; - blackfin) - basic_machine=bfin-unknown -- os=-linux -- ;; -- blackfin-*) -- basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` -- os=-linux -- ;; -- bluegene*) -- basic_machine=powerpc-ibm -- os=-cnk -- ;; -- c54x-*) -- basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` -- ;; -- c55x-*) -- basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` -- ;; -- c6x-*) -- basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` -- ;; -- c90) -- basic_machine=c90-cray -- os=-unicos -+ os=linux - ;; - cegcc) - basic_machine=arm-unknown -- os=-cegcc -+ os=cegcc - ;; - convex-c1) - basic_machine=c1-convex -- os=-bsd -+ os=bsd - ;; - convex-c2) - basic_machine=c2-convex -- os=-bsd -+ os=bsd - ;; - convex-c32) - basic_machine=c32-convex -- os=-bsd -+ os=bsd - ;; - convex-c34) - basic_machine=c34-convex -- os=-bsd -+ os=bsd - ;; - convex-c38) - basic_machine=c38-convex -- os=-bsd -+ os=bsd - ;; -- cray | j90) -+ cray) - basic_machine=j90-cray -- os=-unicos -- ;; -- craynv) -- basic_machine=craynv-cray -- os=-unicosmp -- ;; -- cr16 | cr16-*) -- basic_machine=cr16-unknown -- os=-elf -+ os=unicos - ;; - crds | unos) - basic_machine=m68k-crds -+ os= - ;; -- crisv32 | crisv32-* | etraxfs*) -- basic_machine=crisv32-axis -- ;; -- cris | cris-* | etrax*) -- basic_machine=cris-axis -- ;; -- crx) -- basic_machine=crx-unknown -- os=-elf -- ;; -- da30 | da30-*) -+ da30) - basic_machine=m68k-da30 -+ os= - ;; -- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) -+ decstation | pmax | pmin | dec3100 | decstatn) - basic_machine=mips-dec -- ;; -- decsystem10* | dec10*) -- basic_machine=pdp10-dec -- os=-tops10 -- ;; -- decsystem20* | dec20*) -- basic_machine=pdp10-dec -- os=-tops20 -- ;; -- delta | 3300 | motorola-3300 | motorola-delta \ -- | 3300-motorola | delta-motorola) -- basic_machine=m68k-motorola -+ os= - ;; - delta88) - basic_machine=m88k-motorola -- os=-sysv3 -+ os=sysv3 - ;; - dicos) - basic_machine=i686-pc -- os=-dicos -+ os=dicos - ;; - djgpp) - basic_machine=i586-pc -- os=-msdosdjgpp -- ;; -- dpx20 | dpx20-*) -- basic_machine=rs6000-bull -- os=-bosx -- ;; -- dpx2* | dpx2*-bull) -- basic_machine=m68k-bull -- os=-sysv3 -- ;; -- e500v[12]) -- basic_machine=powerpc-unknown -- os=$os"spe" -- ;; -- e500v[12]-*) -- basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` -- os=$os"spe" -+ os=msdosdjgpp - ;; - ebmon29k) - basic_machine=a29k-amd -- os=-ebmon -- ;; -- elxsi) -- basic_machine=elxsi-elxsi -- os=-bsd -- ;; -- encore | umax | mmax) -- basic_machine=ns32k-encore -+ os=ebmon - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson -- os=-ose -- ;; -- fx2800) -- basic_machine=i860-alliant -- ;; -- genix) -- basic_machine=ns32k-ns -+ os=ose - ;; - gmicro) - basic_machine=tron-gmicro -- os=-sysv -+ os=sysv - ;; - go32) - basic_machine=i386-pc -- os=-go32 -- ;; -- h3050r* | hiux*) -- basic_machine=hppa1.1-hitachi -- os=-hiuxwe2 -+ os=go32 - ;; - h8300hms) - basic_machine=h8300-hitachi -- os=-hms -+ os=hms - ;; - h8300xray) - basic_machine=h8300-hitachi -- os=-xray -+ os=xray - ;; - h8500hms) - basic_machine=h8500-hitachi -- os=-hms -+ os=hms - ;; - harris) - basic_machine=m88k-harris -- os=-sysv3 -+ os=sysv3 - ;; -- hp300-*) -+ hp300 | hp300hpux) - basic_machine=m68k-hp -+ os=hpux - ;; - hp300bsd) - basic_machine=m68k-hp -- os=-bsd -- ;; -- hp300hpux) -- basic_machine=m68k-hp -- os=-hpux -- ;; -- hp3k9[0-9][0-9] | hp9[0-9][0-9]) -- basic_machine=hppa1.0-hp -- ;; -- hp9k2[0-9][0-9] | hp9k31[0-9]) -- basic_machine=m68000-hp -- ;; -- hp9k3[2-9][0-9]) -- basic_machine=m68k-hp -- ;; -- hp9k6[0-9][0-9] | hp6[0-9][0-9]) -- basic_machine=hppa1.0-hp -- ;; -- hp9k7[0-79][0-9] | hp7[0-79][0-9]) -- basic_machine=hppa1.1-hp -- ;; -- hp9k78[0-9] | hp78[0-9]) -- # FIXME: really hppa2.0-hp -- basic_machine=hppa1.1-hp -- ;; -- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) -- # FIXME: really hppa2.0-hp -- basic_machine=hppa1.1-hp -- ;; -- hp9k8[0-9][13679] | hp8[0-9][13679]) -- basic_machine=hppa1.1-hp -- ;; -- hp9k8[0-9][0-9] | hp8[0-9][0-9]) -- basic_machine=hppa1.0-hp -- ;; -- hppa-next) -- os=-nextstep3 -+ os=bsd - ;; - hppaosf) - basic_machine=hppa1.1-hp -- os=-osf -+ os=osf - ;; - hppro) - basic_machine=hppa1.1-hp -- os=-proelf -- ;; -- i370-ibm* | ibm*) -- basic_machine=i370-ibm -- ;; -- i*86v32) -- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` -- os=-sysv32 -- ;; -- i*86v4*) -- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` -- os=-sysv4 -- ;; -- i*86v) -- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` -- os=-sysv -- ;; -- i*86sol2) -- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` -- os=-solaris2 -+ os=proelf - ;; - i386mach) - basic_machine=i386-mach -- os=-mach -- ;; -- i386-vsta | vsta) -- basic_machine=i386-unknown -- os=-vsta -- ;; -- iris | iris4d) -- basic_machine=mips-sgi -- case $os in -- -irix*) -- ;; -- *) -- os=-irix4 -- ;; -- esac -+ os=mach - ;; - isi68 | isi) - basic_machine=m68k-isi -- os=-sysv -- ;; -- leon-*|leon[3-9]-*) -- basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` -+ os=sysv - ;; - m68knommu) - basic_machine=m68k-unknown -- os=-linux -- ;; -- m68knommu-*) -- basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` -- os=-linux -- ;; -- m88k-omron*) -- basic_machine=m88k-omron -+ os=linux - ;; - magnum | m3230) - basic_machine=mips-mips -- os=-sysv -+ os=sysv - ;; - merlin) - basic_machine=ns32k-utek -- os=-sysv -- ;; -- microblaze*) -- basic_machine=microblaze-xilinx -+ os=sysv - ;; - mingw64) - basic_machine=x86_64-pc -- os=-mingw64 -+ os=mingw64 - ;; - mingw32) - basic_machine=i686-pc -- os=-mingw32 -+ os=mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown -- os=-mingw32ce -- ;; -- miniframe) -- basic_machine=m68000-convergent -- ;; -- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) -- basic_machine=m68k-atari -- os=-mint -- ;; -- mips3*-*) -- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` -- ;; -- mips3*) -- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown -+ os=mingw32ce - ;; - monitor) - basic_machine=m68k-rom68k -- os=-coff -+ os=coff - ;; - morphos) - basic_machine=powerpc-unknown -- os=-morphos -+ os=morphos - ;; - moxiebox) - basic_machine=moxie-unknown -- os=-moxiebox -+ os=moxiebox - ;; - msdos) - basic_machine=i386-pc -- os=-msdos -- ;; -- ms1-*) -- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` -+ os=msdos - ;; - msys) - basic_machine=i686-pc -- os=-msys -+ os=msys - ;; - mvs) - basic_machine=i370-ibm -- os=-mvs -+ os=mvs - ;; - nacl) - basic_machine=le32-unknown -- os=-nacl -+ os=nacl - ;; - ncr3000) - basic_machine=i486-ncr -- os=-sysv4 -+ os=sysv4 - ;; - netbsd386) -- basic_machine=i386-unknown -- os=-netbsd -+ basic_machine=i386-pc -+ os=netbsd - ;; - netwinder) - basic_machine=armv4l-rebel -- os=-linux -+ os=linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony -- os=-newsos -+ os=newsos - ;; - news1000) - basic_machine=m68030-sony -- os=-newsos -- ;; -- news-3600 | risc-news) -- basic_machine=mips-sony -- os=-newsos -+ os=newsos - ;; - necv70) - basic_machine=v70-nec -- os=-sysv -- ;; -- next | m*-next ) -- basic_machine=m68k-next -- case $os in -- -nextstep* ) -- ;; -- -ns2*) -- os=-nextstep2 -- ;; -- *) -- os=-nextstep3 -- ;; -- esac -+ os=sysv - ;; - nh3000) - basic_machine=m68k-harris -- os=-cxux -+ os=cxux - ;; - nh[45]000) - basic_machine=m88k-harris -- os=-cxux -+ os=cxux - ;; - nindy960) - basic_machine=i960-intel -- os=-nindy -+ os=nindy - ;; - mon960) - basic_machine=i960-intel -- os=-mon960 -+ os=mon960 - ;; - nonstopux) - basic_machine=mips-compaq -- os=-nonstopux -- ;; -- np1) -- basic_machine=np1-gould -- ;; -- neo-tandem) -- basic_machine=neo-tandem -- ;; -- nse-tandem) -- basic_machine=nse-tandem -- ;; -- nsr-tandem) -- basic_machine=nsr-tandem -- ;; -- op50n-* | op60c-*) -- basic_machine=hppa1.1-oki -- os=-proelf -- ;; -- openrisc | openrisc-*) -- basic_machine=or32-unknown -+ os=nonstopux - ;; - os400) - basic_machine=powerpc-ibm -- os=-os400 -+ os=os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson -- os=-ose -+ os=ose - ;; - os68k) - basic_machine=m68k-none -- os=-os68k -- ;; -- pa-hitachi) -- basic_machine=hppa1.1-hitachi -- os=-hiuxwe2 -+ os=os68k - ;; - paragon) - basic_machine=i860-intel -- os=-osf -+ os=osf - ;; - parisc) - basic_machine=hppa-unknown -- os=-linux -- ;; -- parisc-*) -- basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` -- os=-linux -- ;; -- pbd) -- basic_machine=sparc-tti -- ;; -- pbb) -- basic_machine=m68k-tti -- ;; -- pc532 | pc532-*) -- basic_machine=ns32k-pc532 -- ;; -- pc98) -- basic_machine=i386-pc -- ;; -- pc98-*) -- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` -- ;; -- pentium | p5 | k5 | k6 | nexgen | viac3) -- basic_machine=i586-pc -- ;; -- pentiumpro | p6 | 6x86 | athlon | athlon_*) -- basic_machine=i686-pc -- ;; -- pentiumii | pentium2 | pentiumiii | pentium3) -- basic_machine=i686-pc -- ;; -- pentium4) -- basic_machine=i786-pc -- ;; -- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) -- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` -- ;; -- pentiumpro-* | p6-* | 6x86-* | athlon-*) -- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` -- ;; -- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) -- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` -- ;; -- pentium4-*) -- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` -- ;; -- pn) -- basic_machine=pn-gould -- ;; -- power) basic_machine=power-ibm -- ;; -- ppc | ppcbe) basic_machine=powerpc-unknown -- ;; -- ppc-* | ppcbe-*) -- basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` -- ;; -- ppcle | powerpclittle) -- basic_machine=powerpcle-unknown -- ;; -- ppcle-* | powerpclittle-*) -- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` -- ;; -- ppc64) basic_machine=powerpc64-unknown -- ;; -- ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` -- ;; -- ppc64le | powerpc64little) -- basic_machine=powerpc64le-unknown -- ;; -- ppc64le-* | powerpc64little-*) -- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` -- ;; -- ps2) -- basic_machine=i386-ibm -+ os=linux - ;; - pw32) - basic_machine=i586-unknown -- os=-pw32 -+ os=pw32 - ;; - rdos | rdos64) - basic_machine=x86_64-pc -- os=-rdos -+ os=rdos - ;; - rdos32) - basic_machine=i386-pc -- os=-rdos -+ os=rdos - ;; - rom68k) - basic_machine=m68k-rom68k -- os=-coff -- ;; -- rm[46]00) -- basic_machine=mips-siemens -- ;; -- rtpc | rtpc-*) -- basic_machine=romp-ibm -- ;; -- s390 | s390-*) -- basic_machine=s390-ibm -- ;; -- s390x | s390x-*) -- basic_machine=s390x-ibm -+ os=coff - ;; - sa29200) - basic_machine=a29k-amd -- os=-udi -- ;; -- sb1) -- basic_machine=mipsisa64sb1-unknown -- ;; -- sb1el) -- basic_machine=mipsisa64sb1el-unknown -- ;; -- sde) -- basic_machine=mipsisa32-sde -- os=-elf -+ os=udi - ;; - sei) - basic_machine=mips-sei -- os=-seiux -+ os=seiux - ;; - sequent) - basic_machine=i386-sequent -- ;; -- sh) -- basic_machine=sh-hitachi -- os=-hms -- ;; -- sh5el) -- basic_machine=sh5le-unknown -- ;; -- sh64) -- basic_machine=sh64-unknown -- ;; -- sparclite-wrs | simso-wrs) -- basic_machine=sparclite-wrs -- os=-vxworks -+ os= - ;; - sps7) - basic_machine=m68k-bull -- os=-sysv2 -- ;; -- spur) -- basic_machine=spur-unknown -+ os=sysv2 - ;; - st2000) - basic_machine=m68k-tandem -+ os= - ;; - stratus) - basic_machine=i860-stratus -- os=-sysv4 -- ;; -- strongarm-* | thumb-*) -- basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` -+ os=sysv4 - ;; - sun2) - basic_machine=m68000-sun -+ os= - ;; - sun2os3) - basic_machine=m68000-sun -- os=-sunos3 -+ os=sunos3 - ;; - sun2os4) - basic_machine=m68000-sun -- os=-sunos4 -+ os=sunos4 -+ ;; -+ sun3) -+ basic_machine=m68k-sun -+ os= - ;; - sun3os3) - basic_machine=m68k-sun -- os=-sunos3 -+ os=sunos3 - ;; - sun3os4) - basic_machine=m68k-sun -- os=-sunos4 -+ os=sunos4 -+ ;; -+ sun4) -+ basic_machine=sparc-sun -+ os= - ;; - sun4os3) - basic_machine=sparc-sun -- os=-sunos3 -+ os=sunos3 - ;; - sun4os4) - basic_machine=sparc-sun -- os=-sunos4 -+ os=sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun -- os=-solaris2 -- ;; -- sun3 | sun3-*) -- basic_machine=m68k-sun -- ;; -- sun4) -- basic_machine=sparc-sun -+ os=solaris2 - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun -+ os= - ;; - sv1) - basic_machine=sv1-cray -- os=-unicos -+ os=unicos - ;; - symmetry) - basic_machine=i386-sequent -- os=-dynix -+ os=dynix - ;; - t3e) - basic_machine=alphaev5-cray -- os=-unicos -+ os=unicos - ;; - t90) - basic_machine=t90-cray -- os=-unicos -- ;; -- tile*) -- basic_machine=$basic_machine-unknown -- os=-linux-gnu -- ;; -- tx39) -- basic_machine=mipstx39-unknown -- ;; -- tx39el) -- basic_machine=mipstx39el-unknown -+ os=unicos - ;; - toad1) - basic_machine=pdp10-xkl -- os=-tops20 -- ;; -- tower | tower-32) -- basic_machine=m68k-ncr -+ os=tops20 - ;; - tpf) - basic_machine=s390x-ibm -- os=-tpf -+ os=tpf - ;; - udi29k) - basic_machine=a29k-amd -- os=-udi -+ os=udi - ;; - ultra3) - basic_machine=a29k-nyu -- os=-sym1 -+ os=sym1 - ;; - v810 | necv810) - basic_machine=v810-nec -- os=-none -+ os=none - ;; - vaxv) - basic_machine=vax-dec -- os=-sysv -+ os=sysv - ;; - vms) - basic_machine=vax-dec -- os=-vms -+ os=vms - ;; -- vpp*|vx|vx-*) -- basic_machine=f301-fujitsu -+ vsta) -+ basic_machine=i386-pc -+ os=vsta - ;; - vxworks960) - basic_machine=i960-wrs -- os=-vxworks -+ os=vxworks - ;; - vxworks68) - basic_machine=m68k-wrs -- os=-vxworks -+ os=vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs -- os=-vxworks -- ;; -- w65*) -- basic_machine=w65-wdc -- os=-none -- ;; -- w89k-*) -- basic_machine=hppa1.1-winbond -- os=-proelf -+ os=vxworks - ;; - xbox) - basic_machine=i686-pc -- os=-mingw32 -- ;; -- xps | xps100) -- basic_machine=xps100-honeywell -- ;; -- xscale-* | xscalee[bl]-*) -- basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` -+ os=mingw32 - ;; - ymp) - basic_machine=ymp-cray -- os=-unicos -+ os=unicos - ;; -- z8k-*-coff) -- basic_machine=z8k-unknown -- os=-sim -- ;; -- z80-*-coff) -- basic_machine=z80-unknown -- os=-sim -+ *) -+ basic_machine=$1 -+ os= - ;; -- none) -- basic_machine=none-none -- os=-none -+ esac - ;; -+esac - -+# Decode 1-component or ad-hoc basic machines -+case $basic_machine in - # Here we handle the default manufacturer of certain CPU types. It is in - # some cases the only manufacturer, in others, it is the most popular. - w89k) -- basic_machine=hppa1.1-winbond -+ cpu=hppa1.1 -+ vendor=winbond - ;; - op50n) -- basic_machine=hppa1.1-oki -+ cpu=hppa1.1 -+ vendor=oki - ;; - op60c) -- basic_machine=hppa1.1-oki -+ cpu=hppa1.1 -+ vendor=oki - ;; -- romp) -- basic_machine=romp-ibm -+ ibm*) -+ cpu=i370 -+ vendor=ibm - ;; -- mmix) -- basic_machine=mmix-knuth -+ orion105) -+ cpu=clipper -+ vendor=highlevel - ;; -- rs6000) -- basic_machine=rs6000-ibm -+ mac | mpw | mac-mpw) -+ cpu=m68k -+ vendor=apple - ;; -- vax) -- basic_machine=vax-dec -+ pmac | pmac-mpw) -+ cpu=powerpc -+ vendor=apple - ;; -- pdp10) -- # there are many clones, so DEC is not a safe bet -- basic_machine=pdp10-unknown -+ -+ # Recognize the various machine names and aliases which stand -+ # for a CPU type and a company and sometimes even an OS. -+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) -+ cpu=m68000 -+ vendor=att - ;; -- pdp11) -- basic_machine=pdp11-dec -+ 3b*) -+ cpu=we32k -+ vendor=att - ;; -- we32k) -- basic_machine=we32k-att -+ bluegene*) -+ cpu=powerpc -+ vendor=ibm -+ os=cnk - ;; -- sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) -- basic_machine=sh-unknown -+ decsystem10* | dec10*) -+ cpu=pdp10 -+ vendor=dec -+ os=tops10 - ;; -- sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) -- basic_machine=sparc-sun -+ decsystem20* | dec20*) -+ cpu=pdp10 -+ vendor=dec -+ os=tops20 - ;; -- cydra) -- basic_machine=cydra-cydrome -+ delta | 3300 | motorola-3300 | motorola-delta \ -+ | 3300-motorola | delta-motorola) -+ cpu=m68k -+ vendor=motorola - ;; -- orion) -- basic_machine=orion-highlevel -+ dpx2*) -+ cpu=m68k -+ vendor=bull -+ os=sysv3 - ;; -- orion105) -- basic_machine=clipper-highlevel -+ encore | umax | mmax) -+ cpu=ns32k -+ vendor=encore - ;; -- mac | mpw | mac-mpw) -- basic_machine=m68k-apple -+ elxsi) -+ cpu=elxsi -+ vendor=elxsi -+ os=${os:-bsd} - ;; -- pmac | pmac-mpw) -- basic_machine=powerpc-apple -+ fx2800) -+ cpu=i860 -+ vendor=alliant -+ ;; -+ genix) -+ cpu=ns32k -+ vendor=ns -+ ;; -+ h3050r* | hiux*) -+ cpu=hppa1.1 -+ vendor=hitachi -+ os=hiuxwe2 -+ ;; -+ hp3k9[0-9][0-9] | hp9[0-9][0-9]) -+ cpu=hppa1.0 -+ vendor=hp -+ ;; -+ hp9k2[0-9][0-9] | hp9k31[0-9]) -+ cpu=m68000 -+ vendor=hp -+ ;; -+ hp9k3[2-9][0-9]) -+ cpu=m68k -+ vendor=hp -+ ;; -+ hp9k6[0-9][0-9] | hp6[0-9][0-9]) -+ cpu=hppa1.0 -+ vendor=hp -+ ;; -+ hp9k7[0-79][0-9] | hp7[0-79][0-9]) -+ cpu=hppa1.1 -+ vendor=hp -+ ;; -+ hp9k78[0-9] | hp78[0-9]) -+ # FIXME: really hppa2.0-hp -+ cpu=hppa1.1 -+ vendor=hp -+ ;; -+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) -+ # FIXME: really hppa2.0-hp -+ cpu=hppa1.1 -+ vendor=hp -+ ;; -+ hp9k8[0-9][13679] | hp8[0-9][13679]) -+ cpu=hppa1.1 -+ vendor=hp -+ ;; -+ hp9k8[0-9][0-9] | hp8[0-9][0-9]) -+ cpu=hppa1.0 -+ vendor=hp -+ ;; -+ i*86v32) -+ cpu=`echo "$1" | sed -e 's/86.*/86/'` -+ vendor=pc -+ os=sysv32 -+ ;; -+ i*86v4*) -+ cpu=`echo "$1" | sed -e 's/86.*/86/'` -+ vendor=pc -+ os=sysv4 -+ ;; -+ i*86v) -+ cpu=`echo "$1" | sed -e 's/86.*/86/'` -+ vendor=pc -+ os=sysv -+ ;; -+ i*86sol2) -+ cpu=`echo "$1" | sed -e 's/86.*/86/'` -+ vendor=pc -+ os=solaris2 -+ ;; -+ j90 | j90-cray) -+ cpu=j90 -+ vendor=cray -+ os=${os:-unicos} -+ ;; -+ iris | iris4d) -+ cpu=mips -+ vendor=sgi -+ case $os in -+ irix*) -+ ;; -+ *) -+ os=irix4 -+ ;; -+ esac -+ ;; -+ miniframe) -+ cpu=m68000 -+ vendor=convergent -+ ;; -+ *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) -+ cpu=m68k -+ vendor=atari -+ os=mint -+ ;; -+ news-3600 | risc-news) -+ cpu=mips -+ vendor=sony -+ os=newsos -+ ;; -+ next | m*-next) -+ cpu=m68k -+ vendor=next -+ case $os in -+ openstep*) -+ ;; -+ nextstep*) - ;; -- *-unknown) -- # Make sure to match an already-canonicalized machine name. -+ ns2*) -+ os=nextstep2 - ;; - *) -- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 -+ os=nextstep3 -+ ;; -+ esac -+ ;; -+ np1) -+ cpu=np1 -+ vendor=gould -+ ;; -+ op50n-* | op60c-*) -+ cpu=hppa1.1 -+ vendor=oki -+ os=proelf -+ ;; -+ pa-hitachi) -+ cpu=hppa1.1 -+ vendor=hitachi -+ os=hiuxwe2 -+ ;; -+ pbd) -+ cpu=sparc -+ vendor=tti -+ ;; -+ pbb) -+ cpu=m68k -+ vendor=tti -+ ;; -+ pc532) -+ cpu=ns32k -+ vendor=pc532 -+ ;; -+ pn) -+ cpu=pn -+ vendor=gould -+ ;; -+ power) -+ cpu=power -+ vendor=ibm -+ ;; -+ ps2) -+ cpu=i386 -+ vendor=ibm -+ ;; -+ rm[46]00) -+ cpu=mips -+ vendor=siemens -+ ;; -+ rtpc | rtpc-*) -+ cpu=romp -+ vendor=ibm -+ ;; -+ sde) -+ cpu=mipsisa32 -+ vendor=sde -+ os=${os:-elf} -+ ;; -+ simso-wrs) -+ cpu=sparclite -+ vendor=wrs -+ os=vxworks -+ ;; -+ tower | tower-32) -+ cpu=m68k -+ vendor=ncr -+ ;; -+ vpp*|vx|vx-*) -+ cpu=f301 -+ vendor=fujitsu -+ ;; -+ w65) -+ cpu=w65 -+ vendor=wdc -+ ;; -+ w89k-*) -+ cpu=hppa1.1 -+ vendor=winbond -+ os=proelf -+ ;; -+ none) -+ cpu=none -+ vendor=none -+ ;; -+ leon|leon[3-9]) -+ cpu=sparc -+ vendor=$basic_machine -+ ;; -+ leon-*|leon[3-9]-*) -+ cpu=sparc -+ vendor=`echo "$basic_machine" | sed 's/-.*//'` -+ ;; -+ -+ *-*) -+ # shellcheck disable=SC2162 -+ IFS="-" read cpu vendor <&2 - exit 1 - ;; - esac -+ ;; -+esac - - # Here we canonicalize certain aliases for manufacturers. --case $basic_machine in -- *-digital*) -- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` -+case $vendor in -+ digital*) -+ vendor=dec - ;; -- *-commodore*) -- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` -+ commodore*) -+ vendor=cbm - ;; - *) - ;; -@@ -1353,200 +1275,244 @@ - - # Decode manufacturer-specific aliases for certain operating systems. - --if [ x"$os" != x"" ] -+if [ x$os != x ] - then - case $os in -- # First match some system type aliases -- # that might get confused with valid system types. -- # -solaris* is a basic system type, with this one exception. -- -auroraux) -- os=-auroraux -+ # First match some system type aliases that might get confused -+ # with valid system types. -+ # solaris* is a basic system type, with this one exception. -+ auroraux) -+ os=auroraux - ;; -- -solaris1 | -solaris1.*) -- os=`echo $os | sed -e 's|solaris1|sunos4|'` -+ bluegene*) -+ os=cnk - ;; -- -solaris) -- os=-solaris2 -+ solaris1 | solaris1.*) -+ os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; -- -svr4*) -- os=-sysv4 -+ solaris) -+ os=solaris2 - ;; -- -unixware*) -- os=-sysv4.2uw -+ unixware*) -+ os=sysv4.2uw - ;; -- -gnu/linux*) -+ gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; -- # First accept the basic system types. -+ # es1800 is here to avoid being matched by es* (a different OS) -+ es1800*) -+ os=ose -+ ;; -+ # Some version numbers need modification -+ chorusos*) -+ os=chorusos -+ ;; -+ isc) -+ os=isc2.2 -+ ;; -+ sco6) -+ os=sco5v6 -+ ;; -+ sco5) -+ os=sco3.2v5 -+ ;; -+ sco4) -+ os=sco3.2v4 -+ ;; -+ sco3.2.[4-9]*) -+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` -+ ;; -+ sco3.2v[4-9]* | sco5v6*) -+ # Don't forget version if it is 3.2v4 or newer. -+ ;; -+ scout) -+ # Don't match below -+ ;; -+ sco*) -+ os=sco3.2v2 -+ ;; -+ psos*) -+ os=psos -+ ;; -+ # Now accept the basic system types. - # The portable systems comes first. -- # Each alternative MUST END IN A *, to match a version number. -- # -sysv* is not here because it comes later, after sysvr4. -- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ -- | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ -- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ -- | -sym* | -kopensolaris* | -plan9* \ -- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ -- | -aos* | -aros* | -cloudabi* | -sortix* \ -- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ -- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ -- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ -- | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ -- | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ -- | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ -- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ -- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ -- | -chorusos* | -chorusrdb* | -cegcc* \ -- | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ -- | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ -- | -linux-newlib* | -linux-musl* | -linux-uclibc* \ -- | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ -- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ -- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ -- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ -- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ -- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ -- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ -- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ -- | -onefs* | -tirtos* | -phoenix*) -+ # Each alternative MUST end in a * to match a version number. -+ # sysv* is not here because it comes later, after sysvr4. -+ gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ -+ | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\ -+ | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ -+ | sym* | kopensolaris* | plan9* \ -+ | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ -+ | aos* | aros* | cloudabi* | sortix* | twizzler* \ -+ | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ -+ | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ -+ | knetbsd* | mirbsd* | netbsd* \ -+ | bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \ -+ | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \ -+ | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ -+ | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ -+ | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \ -+ | chorusrdb* | cegcc* | glidix* \ -+ | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ -+ | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \ -+ | linux-newlib* | linux-musl* | linux-uclibc* \ -+ | uxpv* | beos* | mpeix* | udk* | moxiebox* \ -+ | interix* | uwin* | mks* | rhapsody* | darwin* \ -+ | openstep* | oskit* | conix* | pw32* | nonstopux* \ -+ | storm-chaos* | tops10* | tenex* | tops20* | its* \ -+ | os2* | vos* | palmos* | uclinux* | nucleus* \ -+ | morphos* | superux* | rtmk* | windiss* \ -+ | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ -+ | skyos* | haiku* | rdos* | toppers* | drops* | es* \ -+ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ -+ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ -+ | nsk* | powerunix* | genode*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; -- -qnx*) -- case $basic_machine in -- x86-* | i*86-*) -+ qnx*) -+ case $cpu in -+ x86 | i*86) - ;; - *) -- os=-nto$os -+ os=nto-$os - ;; - esac - ;; -- -nto-qnx*) -+ hiux*) -+ os=hiuxwe2 - ;; -- -nto*) -- os=`echo $os | sed -e 's|nto|nto-qnx|'` -+ nto-qnx*) - ;; -- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ -- | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ -- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) -+ nto*) -+ os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; -- -mac*) -- os=`echo $os | sed -e 's|mac|macos|'` -+ sim | xray | os68k* | v88r* \ -+ | windows* | osx | abug | netware* | os9* \ -+ | macos* | mpw* | magic* | mmixware* | mon960* | lnews*) - ;; -- -linux-dietlibc) -- os=-linux-dietlibc -+ linux-dietlibc) -+ os=linux-dietlibc - ;; -- -linux*) -+ linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; -- -sunos5*) -- os=`echo $os | sed -e 's|sunos5|solaris2|'` -+ lynx*178) -+ os=lynxos178 - ;; -- -sunos6*) -- os=`echo $os | sed -e 's|sunos6|solaris3|'` -+ lynx*5) -+ os=lynxos5 - ;; -- -opened*) -- os=-openedition -+ lynx*) -+ os=lynxos - ;; -- -os400*) -- os=-os400 -+ mac*) -+ os=`echo "$os" | sed -e 's|mac|macos|'` - ;; -- -wince*) -- os=-wince -+ opened*) -+ os=openedition - ;; -- -osfrose*) -- os=-osfrose -+ os400*) -+ os=os400 - ;; -- -osf*) -- os=-osf -+ sunos5*) -+ os=`echo "$os" | sed -e 's|sunos5|solaris2|'` - ;; -- -utek*) -- os=-bsd -+ sunos6*) -+ os=`echo "$os" | sed -e 's|sunos6|solaris3|'` - ;; -- -dynix*) -- os=-bsd -+ wince*) -+ os=wince - ;; -- -acis*) -- os=-aos -+ utek*) -+ os=bsd - ;; -- -atheos*) -- os=-atheos -+ dynix*) -+ os=bsd - ;; -- -syllable*) -- os=-syllable -+ acis*) -+ os=aos - ;; -- -386bsd) -- os=-bsd -+ atheos*) -+ os=atheos - ;; -- -ctix* | -uts*) -- os=-sysv -+ syllable*) -+ os=syllable - ;; -- -nova*) -- os=-rtmk-nova -+ 386bsd) -+ os=bsd - ;; -- -ns2 ) -- os=-nextstep2 -+ ctix* | uts*) -+ os=sysv - ;; -- -nsk*) -- os=-nsk -+ nova*) -+ os=rtmk-nova -+ ;; -+ ns2) -+ os=nextstep2 - ;; - # Preserve the version number of sinix5. -- -sinix5.*) -+ sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; -- -sinix*) -- os=-sysv4 -+ sinix*) -+ os=sysv4 - ;; -- -tpf*) -- os=-tpf -+ tpf*) -+ os=tpf - ;; -- -triton*) -- os=-sysv3 -+ triton*) -+ os=sysv3 - ;; -- -oss*) -- os=-sysv3 -+ oss*) -+ os=sysv3 - ;; -- -svr4) -- os=-sysv4 -+ svr4*) -+ os=sysv4 - ;; -- -svr3) -- os=-sysv3 -+ svr3) -+ os=sysv3 - ;; -- -sysvr4) -- os=-sysv4 -+ sysvr4) -+ os=sysv4 - ;; -- # This must come after -sysvr4. -- -sysv*) -+ # This must come after sysvr4. -+ sysv*) - ;; -- -ose*) -- os=-ose -+ ose*) -+ os=ose - ;; -- -es1800*) -- os=-ose -+ *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) -+ os=mint - ;; -- -xenix) -- os=-xenix -+ zvmoe) -+ os=zvmoe - ;; -- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) -- os=-mint -+ dicos*) -+ os=dicos - ;; -- -aros*) -- os=-aros -+ pikeos*) -+ # Until real need of OS specific support for -+ # particular features comes up, bare metal -+ # configurations are quite functional. -+ case $cpu in -+ arm*) -+ os=eabi - ;; -- -zvmoe) -- os=-zvmoe -+ *) -+ os=elf - ;; -- -dicos*) -- os=-dicos -+ esac - ;; -- -nacl*) -+ nacl*) - ;; -- -ios) -+ ios) -+ ;; -+ none) - ;; -- -none) -+ *-eabi) - ;; - *) -- # Get rid of the `-' at the beginning of $os. -- os=`echo $os | sed 's/[^-]*-//'` -- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 -+ echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 - exit 1 - ;; - esac -@@ -1562,261 +1528,265 @@ - # will signal an error saying that MANUFACTURER isn't an operating - # system, and we'll never get to this point. - --case $basic_machine in -+case $cpu-$vendor in - score-*) -- os=-elf -+ os=elf - ;; - spu-*) -- os=-elf -+ os=elf - ;; - *-acorn) -- os=-riscix1.2 -+ os=riscix1.2 - ;; - arm*-rebel) -- os=-linux -+ os=linux - ;; - arm*-semi) -- os=-aout -+ os=aout - ;; - c4x-* | tic4x-*) -- os=-coff -+ os=coff - ;; - c8051-*) -- os=-elf -+ os=elf -+ ;; -+ clipper-intergraph) -+ os=clix - ;; - hexagon-*) -- os=-elf -+ os=elf - ;; - tic54x-*) -- os=-coff -+ os=coff - ;; - tic55x-*) -- os=-coff -+ os=coff - ;; - tic6x-*) -- os=-coff -+ os=coff - ;; - # This must come before the *-dec entry. - pdp10-*) -- os=-tops20 -+ os=tops20 - ;; - pdp11-*) -- os=-none -+ os=none - ;; - *-dec | vax-*) -- os=-ultrix4.2 -+ os=ultrix4.2 - ;; - m68*-apollo) -- os=-domain -+ os=domain - ;; - i386-sun) -- os=-sunos4.0.2 -+ os=sunos4.0.2 - ;; - m68000-sun) -- os=-sunos3 -+ os=sunos3 - ;; - m68*-cisco) -- os=-aout -+ os=aout - ;; - mep-*) -- os=-elf -+ os=elf - ;; - mips*-cisco) -- os=-elf -+ os=elf - ;; - mips*-*) -- os=-elf -+ os=elf - ;; - or32-*) -- os=-coff -+ os=coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. -- os=-sysv3 -+ os=sysv3 - ;; - sparc-* | *-sun) -- os=-sunos4.1.1 -+ os=sunos4.1.1 - ;; -- *-be) -- os=-beos -+ pru-*) -+ os=elf - ;; -- *-haiku) -- os=-haiku -+ *-be) -+ os=beos - ;; - *-ibm) -- os=-aix -+ os=aix - ;; - *-knuth) -- os=-mmixware -+ os=mmixware - ;; - *-wec) -- os=-proelf -+ os=proelf - ;; - *-winbond) -- os=-proelf -+ os=proelf - ;; - *-oki) -- os=-proelf -+ os=proelf - ;; - *-hp) -- os=-hpux -+ os=hpux - ;; - *-hitachi) -- os=-hiux -+ os=hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) -- os=-sysv -+ os=sysv - ;; - *-cbm) -- os=-amigaos -+ os=amigaos - ;; - *-dg) -- os=-dgux -+ os=dgux - ;; - *-dolphin) -- os=-sysv3 -+ os=sysv3 - ;; - m68k-ccur) -- os=-rtu -+ os=rtu - ;; - m88k-omron*) -- os=-luna -+ os=luna - ;; - *-next ) -- os=-nextstep -+ os=nextstep - ;; - *-sequent) -- os=-ptx -+ os=ptx - ;; - *-crds) -- os=-unos -+ os=unos - ;; - *-ns) -- os=-genix -+ os=genix - ;; - i370-*) -- os=-mvs -- ;; -- *-next) -- os=-nextstep3 -+ os=mvs - ;; - *-gould) -- os=-sysv -+ os=sysv - ;; - *-highlevel) -- os=-bsd -+ os=bsd - ;; - *-encore) -- os=-bsd -+ os=bsd - ;; - *-sgi) -- os=-irix -+ os=irix - ;; - *-siemens) -- os=-sysv4 -+ os=sysv4 - ;; - *-masscomp) -- os=-rtu -+ os=rtu - ;; - f30[01]-fujitsu | f700-fujitsu) -- os=-uxpv -+ os=uxpv - ;; - *-rom68k) -- os=-coff -+ os=coff - ;; - *-*bug) -- os=-coff -+ os=coff - ;; - *-apple) -- os=-macos -+ os=macos - ;; - *-atari*) -- os=-mint -+ os=mint -+ ;; -+ *-wrs) -+ os=vxworks - ;; - *) -- os=-none -+ os=none - ;; - esac - fi - - # Here we handle the case where we know the os, and the CPU type, but not the - # manufacturer. We pick the logical manufacturer. --vendor=unknown --case $basic_machine in -- *-unknown) -+case $vendor in -+ unknown) - case $os in -- -riscix*) -+ riscix*) - vendor=acorn - ;; -- -sunos*) -+ sunos*) - vendor=sun - ;; -- -cnk*|-aix*) -+ cnk*|-aix*) - vendor=ibm - ;; -- -beos*) -+ beos*) - vendor=be - ;; -- -hpux*) -+ hpux*) - vendor=hp - ;; -- -mpeix*) -+ mpeix*) - vendor=hp - ;; -- -hiux*) -+ hiux*) - vendor=hitachi - ;; -- -unos*) -+ unos*) - vendor=crds - ;; -- -dgux*) -+ dgux*) - vendor=dg - ;; -- -luna*) -+ luna*) - vendor=omron - ;; -- -genix*) -+ genix*) - vendor=ns - ;; -- -mvs* | -opened*) -+ clix*) -+ vendor=intergraph -+ ;; -+ mvs* | opened*) - vendor=ibm - ;; -- -os400*) -+ os400*) - vendor=ibm - ;; -- -ptx*) -+ ptx*) - vendor=sequent - ;; -- -tpf*) -+ tpf*) - vendor=ibm - ;; -- -vxsim* | -vxworks* | -windiss*) -+ vxsim* | vxworks* | windiss*) - vendor=wrs - ;; -- -aux*) -+ aux*) - vendor=apple - ;; -- -hms*) -+ hms*) - vendor=hitachi - ;; -- -mpw* | -macos*) -+ mpw* | macos*) - vendor=apple - ;; -- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) -+ *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) - vendor=atari - ;; -- -vos*) -+ vos*) - vendor=stratus - ;; - esac -- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; - esac - --echo $basic_machine$os -+echo "$cpu-$vendor-$os" - exit - - # Local variables: --# eval: (add-hook 'write-file-hooks 'time-stamp) -+# eval: (add-hook 'before-save-hook 'time-stamp) - # time-stamp-start: "timestamp='" - # time-stamp-format: "%:y-%02m-%02d" - # time-stamp-end: "'" From 52ad8afab036872e862748e9b116822f83403387 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Mon, 8 Sep 2025 21:08:21 -0600 Subject: [PATCH 32/33] libtheora: update and fix dnamic linking --- recipes/wip/libs/other/libtheora/recipe.toml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/recipes/wip/libs/other/libtheora/recipe.toml b/recipes/wip/libs/other/libtheora/recipe.toml index 95db350e5..12f2579bb 100644 --- a/recipes/wip/libs/other/libtheora/recipe.toml +++ b/recipes/wip/libs/other/libtheora/recipe.toml @@ -1,13 +1,18 @@ -#TODO the redox target is not supported on the configure script [source] -tar = "http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2" +tar = "http://downloads.xiph.org/releases/theora/libtheora-1.2.0.tar.gz" +blake3 = "b2413d6a29669063c30679eb46e09bd55b47d51e1516282bd1f5a752a8ecae91" script = """ -GNU_CONFIG_GET config.sub +DYNAMIC_INIT +autotools_recursive_regenerate """ [build] -template = "configure" +template = "custom" dependencies = [ "libogg", "libvorbis", ] +script = """ +DYNAMIC_INIT +cookbook_configure +""" From 0e3209c1ad973df2c985569562d4d5bc8aa07f79 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Mon, 8 Sep 2025 21:11:04 -0600 Subject: [PATCH 33/33] mpg123: update and fix dynamic linking --- recipes/wip/libs/audio/mpg123/recipe.toml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/recipes/wip/libs/audio/mpg123/recipe.toml b/recipes/wip/libs/audio/mpg123/recipe.toml index d092711f4..f88873ab4 100644 --- a/recipes/wip/libs/audio/mpg123/recipe.toml +++ b/recipes/wip/libs/audio/mpg123/recipe.toml @@ -1,5 +1,11 @@ #TODO compilation error [source] -tar = "https://mpg123.de/download/mpg123-1.31.3.tar.bz2" +tar = "https://mpg123.de/download/mpg123-1.33.2.tar.bz2" +blake3 = "1e604dc14160a8852ef6b880643e3534f44e410af1fd5ba29a80ff960a54e834" +script = """ +DYNAMIC_INIT +autotools_recursive_regenerate +""" + [build] template = "configure"