diff --git a/recipes/archives/lz4/recipe.toml b/recipes/archives/lz4/recipe.toml new file mode 100644 index 0000000000000000000000000000000000000000..bd1763e512485c8b597e433ac9ab21850f1ad52c --- /dev/null +++ b/recipes/archives/lz4/recipe.toml @@ -0,0 +1,18 @@ +[source] +tar = "https://github.com/lz4/lz4/releases/download/v1.10.0/lz4-1.10.0.tar.gz" +blake3 = "3e69fd475e7852e17594985528b5232afeba7d3d56cfebe2e89071768b2ab36a" +patches = ["redox.patch"] + +[build] +template = "custom" +script = """ +rsync -av --delete "${COOKBOOK_SOURCE}/" ./ + +# No configure provided +COOKBOOK_CONFIGURE="true" +COOKBOOK_CONFIGURE_FLAGS="" + +export CPPFLAGS="${CPPFLAGS} -D_REDOX" + +cookbook_configure +""" diff --git a/recipes/archives/lz4/redox.patch b/recipes/archives/lz4/redox.patch new file mode 100644 index 0000000000000000000000000000000000000000..095ae277d219b1b51ceed90d0c8c6aa122c2b4f8 --- /dev/null +++ b/recipes/archives/lz4/redox.patch @@ -0,0 +1,34 @@ +diff '--color=auto' -ruwN source/programs/util.h source-new/programs/util.h +--- source/programs/util.h 2024-07-21 13:29:49.000000000 -0400 ++++ source-new/programs/util.h 2024-12-13 02:21:03.032769559 -0500 +@@ -52,6 +52,9 @@ + #include <time.h> /* time */ + #include <limits.h> /* INT_MAX */ + #include <errno.h> ++#if defined(_REDOX) ++# include <sys/time.h> /* utimes */ ++#endif + + + +@@ -239,12 +242,20 @@ + timebuf.modtime = statbuf->st_mtime; + res += utime(filename, &timebuf); /* set access and modification times */ + #else ++ #if defined(_REDOX) ++ struct timeval timebuf[2]; ++ memset(timebuf, 0, sizeof(timebuf)); ++ timebuf[0].tv_usec = UTIME_NOW; ++ timebuf[1].tv_sec = statbuf->st_mtime; ++ res += utimes(filename, timebuf); ++ #else + struct timespec timebuf[2]; + memset(timebuf, 0, sizeof(timebuf)); + timebuf[0].tv_nsec = UTIME_NOW; + timebuf[1].tv_sec = statbuf->st_mtime; + res += utimensat(AT_FDCWD, filename, timebuf, 0); /* set access and modification times */ + #endif ++#endif + } + + #if !defined(_WIN32) diff --git a/recipes/wip/archives/lz4/recipe.toml b/recipes/wip/archives/lz4/recipe.toml deleted file mode 100644 index c3a62ca5612adca2743ca7efa9d7791d78f40ebf..0000000000000000000000000000000000000000 --- a/recipes/wip/archives/lz4/recipe.toml +++ /dev/null @@ -1,6 +0,0 @@ -#TODO missing script for "make", see https://github.com/lz4/lz4#installation -[source] -git = "https://github.com/lz4/lz4" -rev = "5ff839680134437dbf4678f3d0c7b371d84f4964" -[build] -template = "custom"