void-packages/srcpkgs/tsocks/patches/fix-musl.patch
Đoàn Trần Công Danh 4f75cf25fd srcpkgs/t*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

31 lines
1,013 B
Diff

--- a/configure.in 2015-08-21 23:38:47.726879936 +0200
+++ b/configure.in 2015-08-21 23:39:13.031879310 +0200
@@ -68,7 +68,7 @@ dnl Check for the fcntl header
AC_CHECK_HEADER(fcntl.h,,AC_MSG_ERROR("fcntl.h not found"))
dnl Check for the poll header
-AC_CHECK_HEADER(sys/poll.h,,AC_MSG_ERROR("sys/poll.h not found"))
+AC_CHECK_HEADER(poll.h,,AC_MSG_ERROR("poll.h not found"))
dnl Other headers we're interested in
AC_CHECK_HEADERS(unistd.h)
@@ -316,7 +316,7 @@ for testproto in 'struct pollfd *ufds, u
do
if test "${PROTO}" = ""; then
AC_TRY_COMPILE([
- #include <sys/poll.h>
+ #include <poll.h>
int poll($testproto);
],,[PROTO="$testproto";],)
fi
--- a/tsocks.c 2015-08-21 23:39:34.644878775 +0200
+++ b/tsocks.c 2015-08-21 23:39:49.338878412 +0200
@@ -41,7 +41,7 @@ char *progname = "libtsocks";
#include <strings.h>
#include <netinet/in.h>
#include <arpa/inet.h>
-#include <sys/poll.h>
+#include <poll.h>
#include <sys/time.h>
#include <pwd.h>
#include <errno.h>