diff --git a/recipes/xz/01-no-poll.patch b/recipes/xz/01-no-poll.patch new file mode 100644 index 0000000000000000000000000000000000000000..3c36484fec4a58f46555a09484d8088eb55d1638 --- /dev/null +++ b/recipes/xz/01-no-poll.patch @@ -0,0 +1,55 @@ +diff -ru source/src/xz/file_io.c source-new/src/xz/file_io.c +--- source/src/xz/file_io.c 2016-12-30 03:13:57.000000000 -0800 ++++ source-new/src/xz/file_io.c 2017-08-08 12:34:08.453700076 -0700 +@@ -17,7 +17,7 @@ + #ifdef TUKLIB_DOSLIKE + # include <io.h> + #else +-# include <poll.h> ++//# include <poll.h> + static bool warn_fchown; + #endif + +@@ -222,7 +222,7 @@ + #endif // ENABLE_SANDBOX + + +-#ifndef TUKLIB_DOSLIKE ++#if 0 + /// \brief Waits for input or output to become available or for a signal + /// + /// This uses the self-pipe trick to avoid a race condition that can occur +@@ -704,6 +704,7 @@ + // If it is something else than a regular file, wait until + // there is input available. This way reading from FIFOs + // will work when open() is used with O_NONBLOCK. ++#if 0 + if (!S_ISREG(pair->src_st.st_mode)) { + signals_unblock(); + const io_wait_ret ret = io_wait(pair, -1, true); +@@ -713,6 +714,7 @@ + goto error; + } + #endif ++#endif + + #ifdef HAVE_POSIX_FADVISE + // It will fail with some special files like FIFOs but that is fine. +@@ -1127,7 +1129,7 @@ + continue; + } + +-#ifndef TUKLIB_DOSLIKE ++#if 0 + if (IS_EAGAIN_OR_EWOULDBLOCK(errno)) { + const io_wait_ret ret = io_wait(pair, + mytime_get_flush_timeout(), +@@ -1215,7 +1217,7 @@ + continue; + } + +-#ifndef TUKLIB_DOSLIKE ++#if 0 + if (IS_EAGAIN_OR_EWOULDBLOCK(errno)) { + if (io_wait(pair, -1, false) == IO_WAIT_MORE) + continue; diff --git a/recipes/xz/02-o_noctty.patch b/recipes/xz/02-o_noctty.patch new file mode 100644 index 0000000000000000000000000000000000000000..2ad56398fde29b6c775466b17dc529b57d3958ec --- /dev/null +++ b/recipes/xz/02-o_noctty.patch @@ -0,0 +1,14 @@ +diff -ru source/src/common/tuklib_open_stdxxx.c source-new/src/common/tuklib_open_stdxxx.c +--- source/src/common/tuklib_open_stdxxx.c 2016-12-30 03:08:20.000000000 -0800 ++++ source-new/src/common/tuklib_open_stdxxx.c 2017-08-08 12:38:10.703829409 -0700 +@@ -35,8 +35,8 @@ + // writing to stdin would fail. However, /dev/full + // is Linux specific, and if the program tries to + // write to stdin, there's already a problem anyway. +- const int fd = open("/dev/null", O_NOCTTY +- | (i == 0 ? O_WRONLY : O_RDONLY)); ++ const int fd = open("/dev/null", ++ (i == 0 ? O_WRONLY : O_RDONLY)); + + if (fd != i) { + if (fd != -1) diff --git a/recipes/xz/03-no-signals.patch b/recipes/xz/03-no-signals.patch new file mode 100644 index 0000000000000000000000000000000000000000..5fce80eaa49edc5d38e51a9eafaeb6f329c0200c --- /dev/null +++ b/recipes/xz/03-no-signals.patch @@ -0,0 +1,47 @@ +diff -ru source/src/xz/message.c source-new/src/xz/message.c +--- source/src/xz/message.c 2016-12-30 03:08:20.000000000 -0800 ++++ source-new/src/xz/message.c 2017-08-08 12:44:30.584447139 -0700 +@@ -135,7 +135,7 @@ + } + */ + +-#ifdef SIGALRM ++#if 0 + // Establish the signal handlers which set a flag to tell us that + // progress info should be updated. + struct sigaction sa; +diff -ru source/src/xz/signals.c source-new/src/xz/signals.c +--- source/src/xz/signals.c 2016-12-30 03:08:20.000000000 -0800 ++++ source-new/src/xz/signals.c 2017-08-08 12:41:59.624111395 -0700 +@@ -53,6 +53,7 @@ + extern void + signals_init(void) + { ++#if 0 + // List of signals for which we establish the signal handler. + static const int sigs[] = { + SIGINT, +@@ -112,6 +113,7 @@ + signals_are_initialized = true; + + return; ++#endif + } + + +@@ -152,6 +154,7 @@ + extern void + signals_exit(void) + { ++#if 0 + const int sig = exit_signal; + + if (sig != 0) { +@@ -171,6 +174,7 @@ + } + + return; ++#endif + } + + #else diff --git a/recipes/xz/04-no-fchown-fchmod.patch b/recipes/xz/04-no-fchown-fchmod.patch new file mode 100644 index 0000000000000000000000000000000000000000..d4b69e1d18c9c58bc9ffaf10774b4f7e54389f87 --- /dev/null +++ b/recipes/xz/04-no-fchown-fchmod.patch @@ -0,0 +1,12 @@ +diff -ru source/src/xz/file_io.c source-new/src/xz/file_io.c +--- source/src/xz/file_io.c 2016-12-30 03:13:57.000000000 -0800 ++++ source-new/src/xz/file_io.c 2017-08-08 12:49:15.225290972 -0700 +@@ -351,7 +351,7 @@ + io_copy_attrs(const file_pair *pair) + { + // Skip chown and chmod on Windows. +-#ifndef TUKLIB_DOSLIKE ++#if 0 + // This function is more tricky than you may think at first. + // Blindly copying permissions may permit users to access the + // destination file who didn't have permission to access the diff --git a/recipes/xz/recipe.sh b/recipes/xz/recipe.sh new file mode 100644 index 0000000000000000000000000000000000000000..0c70d7bbee11c9e8b7c2af8b7bbe0c7a80fb43d7 --- /dev/null +++ b/recipes/xz/recipe.sh @@ -0,0 +1,36 @@ +VERSION=5.2.3 +TAR=https://tukaani.org/xz/xz-$VERSION.tar.gz + +function recipe_version { + echo "$VERSION" + skip=1 +} + +function recipe_update { + echo "skipping update" + skip=1 +} + +function recipe_build { + wget -O build-aux/config.sub http://git.savannah.gnu.org/cgit/config.git/plain/config.sub + ./configure --host=${HOST} --prefix=/ --enable-threads=no + make + skip=1 +} + +function recipe_test { + echo "skipping test" + skip=1 +} + +function recipe_clean { + make clean + skip=1 +} + +function recipe_stage { + dest="$(realpath $1)" + make DESTDIR="$dest" install + rm -rf "$dest/share" + skip=1 +}