From 50d43548cd053898af4c56cb2f46411e1767d947 Mon Sep 17 00:00:00 2001 From: Wildan Mubarok Date: Mon, 21 Jul 2025 15:58:32 +0000 Subject: [PATCH] Fix and promote zstd --- recipes/archives/zstd/01_redox.patch | 15 +++++++++++++++ recipes/archives/zstd/recipe.toml | 12 ++++++++++++ recipes/wip/archives/zstd/recipe.toml | 15 --------------- 3 files changed, 27 insertions(+), 15 deletions(-) create mode 100644 recipes/archives/zstd/01_redox.patch create mode 100644 recipes/archives/zstd/recipe.toml delete mode 100644 recipes/wip/archives/zstd/recipe.toml diff --git a/recipes/archives/zstd/01_redox.patch b/recipes/archives/zstd/01_redox.patch new file mode 100644 index 00000000..0cff8dc9 --- /dev/null +++ b/recipes/archives/zstd/01_redox.patch @@ -0,0 +1,15 @@ +diff -ruwN source/programs/platform.h source-new/programs/platform.h +--- source/programs/platform.h 2025-02-19 07:04:24.000000000 +0700 ++++ source-new/programs/platform.h 2025-07-21 22:52:07.716447723 +0700 +@@ -109,6 +109,11 @@ + #endif /* PLATFORM_POSIX_VERSION */ + + ++#if defined(__redox__) ++/* TODO: AT_FDCWD && utimensat must be defined to conform _POSIX_VERSION */ ++# define PLATFORM_POSIX_VERSION 1 ++#endif ++ + #if PLATFORM_POSIX_VERSION > 1 + /* glibc < 2.26 may not expose struct timespec def without this. + * See issue #1920. */ diff --git a/recipes/archives/zstd/recipe.toml b/recipes/archives/zstd/recipe.toml new file mode 100644 index 00000000..e42573e0 --- /dev/null +++ b/recipes/archives/zstd/recipe.toml @@ -0,0 +1,12 @@ +[source] +tar = "https://github.com/facebook/zstd/releases/download/v1.5.7/zstd-1.5.7.tar.gz" +patches = [ + "01_redox.patch" +] +[build] +template = "custom" +script = """ +DYNAMIC_INIT +rsync -av --delete "${COOKBOOK_SOURCE}/" ./ +${COOKBOOK_MAKE} +""" diff --git a/recipes/wip/archives/zstd/recipe.toml b/recipes/wip/archives/zstd/recipe.toml deleted file mode 100644 index b7bc0a79..00000000 --- a/recipes/wip/archives/zstd/recipe.toml +++ /dev/null @@ -1,15 +0,0 @@ -#TODO waiting for openat implementation, building without openat fails -#NOTE although project supports building without openat, but the corresponding #if check -# checks for the presence of st_mtime, and if it exists it falsely assumes that AT_FDCWD is supported too -# for more info see starting from programs/util.c line 262: #if (PLATFORM_POSIX_VERSION >= 200809L) && defined(st_mtime) - -[source] -tar = "https://github.com/facebook/zstd/releases/download/v1.5.5/zstd-1.5.5.tar.gz" - -[build] -template = "custom" -script = """ -rsync -av --delete "${COOKBOOK_SOURCE}/" ./ -${COOKBOOK_MAKE} -""" -