pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/devel/libuv Apply MacPorts patch-libuv-legacy.diff for...
details: https://anonhg.NetBSD.org/pkgsrc/rev/f583f6f99db2
branches: trunk
changeset: 372691:f583f6f99db2
user: schmonz <schmonz%pkgsrc.org@localhost>
date: Fri Jan 28 21:13:10 2022 +0000
description:
Apply MacPorts patch-libuv-legacy.diff for pre-10.7 platforms, and
MacPorts patch-libuv-unix-core-close-nocancel.diff for:
- older gcc versions to not error on pragmas
- 32bit code to link correctly
- Tiger to work around not having a non-cancellable close function
Fixes build on Snow Leopard. For other platforms, NFCI.
diffstat:
devel/libuv/distinfo | 9 ++-
devel/libuv/patches/patch-src_unix_core.c | 48 +++++++++++++++++++
devel/libuv/patches/patch-src_unix_darwin-proctitle.c | 18 +++++++
devel/libuv/patches/patch-src_unix_fs.c | 20 +++++-
devel/libuv/patches/patch-src_unix_tty.c | 15 +++++
devel/libuv/patches/patch-src_unix_udp.c | 26 ++++++++++
devel/libuv/patches/patch-test_test-fs.c | 24 +++++++++
7 files changed, 153 insertions(+), 7 deletions(-)
diffs (216 lines):
diff -r 6c0c2fbfe4cf -r f583f6f99db2 devel/libuv/distinfo
--- a/devel/libuv/distinfo Fri Jan 28 20:39:20 2022 +0000
+++ b/devel/libuv/distinfo Fri Jan 28 21:13:10 2022 +0000
@@ -1,9 +1,14 @@
-$NetBSD: distinfo,v 1.70 2022/01/17 10:12:54 tnn Exp $
+$NetBSD: distinfo,v 1.71 2022/01/28 21:13:10 schmonz Exp $
BLAKE2s (libuv-1.43.0.tar.gz) = d058d220ac448170de1c2dd554e0ef0e6c362fddf181509ba8d3d416398ae715
SHA512 (libuv-1.43.0.tar.gz) = 66ee11f8f6fc1313c432858572789cf67acd6364b29a06c73323ab20626e2d6e3d3dcea748cf5d9d4368b40ad7fe0d5fd35e9369c22e531db523703f005248d3
Size (libuv-1.43.0.tar.gz) = 1295972 bytes
SHA1 (patch-autogen.sh) = a5f48189bfb17624c545a80626ea311b7755d232
SHA1 (patch-src_unix_bsd-proctitle.c) = 8643762602af6537589b935baae48ff2a0541a2f
-SHA1 (patch-src_unix_fs.c) = d5afe699254210d9724bf2d02ea4563a92666d4f
+SHA1 (patch-src_unix_core.c) = fb2d24e7d842f6739f14c191ee30c71f56113081
+SHA1 (patch-src_unix_darwin-proctitle.c) = e726550cdd884a1fa73f6ea79592df643f954e97
+SHA1 (patch-src_unix_fs.c) = 80529332f27a4faa2733448169d24436901b601a
SHA1 (patch-src_unix_netbsd.c) = 071a2a853f9a73dc72e24d63316aa21b28669469
+SHA1 (patch-src_unix_tty.c) = 157be1b1272dc38b3605a9822316e6cb2ddb6f22
+SHA1 (patch-src_unix_udp.c) = c1a17b81bda4fcee5deee932fb0f59bf086f0c47
+SHA1 (patch-test_test-fs.c) = dece47eedc727d1a19d0edf75cc913ed2b5eaa0f
diff -r 6c0c2fbfe4cf -r f583f6f99db2 devel/libuv/patches/patch-src_unix_core.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/libuv/patches/patch-src_unix_core.c Fri Jan 28 21:13:10 2022 +0000
@@ -0,0 +1,48 @@
+$NetBSD: patch-src_unix_core.c,v 1.1 2022/01/28 21:13:10 schmonz Exp $
+
+Apply MacPorts patch-libuv-unix-core-close-nocancel.diff for
+- older gcc versions to not error on pragmas
+- 32bit code to link correctly
+- Tiger to work around not having a non-cancellable close function
+
+--- src/unix/core.c.orig 2022-01-04 14:18:00.000000000 +0000
++++ src/unix/core.c
+@@ -531,18 +531,31 @@ int uv__accept(int sockfd) {
+ * will unwind the thread when it's in the cancel state. Work around that
+ * by making the system call directly. Musl libc is unaffected.
+ */
++
++#if defined(__GNUC__)
++# define GCC_VERSION \
++ (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
++#endif
++#if defined(__clang__) || (defined(GCC_VERSION) && (GCC_VERSION >= 40500))
++/* gcc diagnostic pragmas available */
++# define GCC_DIAGNOSTIC_AVAILABLE
++#endif
+ int uv__close_nocancel(int fd) {
+-#if defined(__APPLE__)
+-#pragma GCC diagnostic push
+-#pragma GCC diagnostic ignored "-Wdollar-in-identifier-extension"
+-#if defined(__LP64__) || TARGET_OS_IPHONE
++#if defined(__APPLE__) && (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050)
++# if defined(GCC_DIAGNOSTIC_AVAILABLE)
++# pragma GCC diagnostic push
++# pragma GCC diagnostic ignored "-Wdollar-in-identifier-extension"
++# endif
++# if defined(__LP64__) || __LP64__ || (defined(TARGET_OS_IPHONE) && (TARGET_OS_IPHONE > 0))
+ extern int close$NOCANCEL(int);
+ return close$NOCANCEL(fd);
+-#else
++# else
+ extern int close$NOCANCEL$UNIX2003(int);
+ return close$NOCANCEL$UNIX2003(fd);
+-#endif
+-#pragma GCC diagnostic pop
++# endif
++# if defined(GCC_DIAGNOSTIC_AVAILABLE)
++# pragma GCC diagnostic pop
++# endif
+ #elif defined(__linux__) && defined(__SANITIZE_THREAD__) && defined(__clang__)
+ long rc;
+ __sanitizer_syscall_pre_close(fd);
diff -r 6c0c2fbfe4cf -r f583f6f99db2 devel/libuv/patches/patch-src_unix_darwin-proctitle.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/libuv/patches/patch-src_unix_darwin-proctitle.c Fri Jan 28 21:13:10 2022 +0000
@@ -0,0 +1,18 @@
+$NetBSD: patch-src_unix_darwin-proctitle.c,v 1.1 2022/01/28 21:13:10 schmonz Exp $
+
+Apply MacPorts patch-libuv-legacy.diff for pre-10.7 platforms.
+
+--- src/unix/darwin-proctitle.c.orig 2022-01-04 14:18:00.000000000 +0000
++++ src/unix/darwin-proctitle.c
+@@ -41,9 +41,11 @@ static int uv__pthread_setname_np(const
+ strncpy(namebuf, name, sizeof(namebuf) - 1);
+ namebuf[sizeof(namebuf) - 1] = '\0';
+
++#if TARGET_OS_IPHONE || MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
+ err = pthread_setname_np(namebuf);
+ if (err)
+ return UV__ERR(err);
++#endif
+
+ return 0;
+ }
diff -r 6c0c2fbfe4cf -r f583f6f99db2 devel/libuv/patches/patch-src_unix_fs.c
--- a/devel/libuv/patches/patch-src_unix_fs.c Fri Jan 28 20:39:20 2022 +0000
+++ b/devel/libuv/patches/patch-src_unix_fs.c Fri Jan 28 21:13:10 2022 +0000
@@ -1,10 +1,20 @@
-$NetBSD: patch-src_unix_fs.c,v 1.5 2020/07/29 10:20:56 wiz Exp $
+$NetBSD: patch-src_unix_fs.c,v 1.6 2022/01/28 21:13:10 schmonz Exp $
Fix portability on NetBSD.
+Apply MacPorts patch-libuv-legacy.diff for pre-10.7 platforms.
---- src/unix/fs.c.orig 2019-10-19 21:32:27.000000000 +0000
+--- src/unix/fs.c.orig 2022-01-04 14:18:00.000000000 +0000
+++ src/unix/fs.c
-@@ -1138,7 +1138,7 @@ static void uv__to_stat(struct stat* src
+@@ -1060,7 +1060,7 @@ static ssize_t uv__fs_sendfile(uv_fs_t*
+
+ return -1;
+ }
+-#elif defined(__APPLE__) || \
++#elif (defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1050) || \
+ defined(__DragonFly__) || \
+ defined(__FreeBSD__) || \
+ defined(__FreeBSD_kernel__)
+@@ -1427,7 +1427,7 @@ static void uv__to_stat(struct stat* src
dst->st_blksize = src->st_blksize;
dst->st_blocks = src->st_blocks;
@@ -13,7 +23,7 @@
dst->st_atim.tv_sec = src->st_atimespec.tv_sec;
dst->st_atim.tv_nsec = src->st_atimespec.tv_nsec;
dst->st_mtim.tv_sec = src->st_mtimespec.tv_sec;
-@@ -1164,7 +1164,6 @@ static void uv__to_stat(struct stat* src
+@@ -1454,7 +1454,6 @@ static void uv__to_stat(struct stat* src
defined(__DragonFly__) || \
defined(__FreeBSD__) || \
defined(__OpenBSD__) || \
@@ -21,7 +31,7 @@
defined(_GNU_SOURCE) || \
defined(_BSD_SOURCE) || \
defined(_SVID_SOURCE) || \
-@@ -1176,8 +1175,7 @@ static void uv__to_stat(struct stat* src
+@@ -1466,8 +1465,7 @@ static void uv__to_stat(struct stat* src
dst->st_mtim.tv_nsec = src->st_mtim.tv_nsec;
dst->st_ctim.tv_sec = src->st_ctim.tv_sec;
dst->st_ctim.tv_nsec = src->st_ctim.tv_nsec;
diff -r 6c0c2fbfe4cf -r f583f6f99db2 devel/libuv/patches/patch-src_unix_tty.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/libuv/patches/patch-src_unix_tty.c Fri Jan 28 21:13:10 2022 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_unix_tty.c,v 1.1 2022/01/28 21:13:10 schmonz Exp $
+
+Apply MacPorts patch-libuv-legacy.diff for pre-10.7 platforms.
+
+--- src/unix/tty.c.orig 2022-01-04 14:18:00.000000000 +0000
++++ src/unix/tty.c
+@@ -72,7 +72,7 @@ static int uv__tty_is_slave(const int fd
+ int dummy;
+
+ result = ioctl(fd, TIOCGPTN, &dummy) != 0;
+-#elif defined(__APPLE__)
++#elif defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
+ char dummy[256];
+
+ result = ioctl(fd, TIOCPTYGNAME, &dummy) != 0;
diff -r 6c0c2fbfe4cf -r f583f6f99db2 devel/libuv/patches/patch-src_unix_udp.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/libuv/patches/patch-src_unix_udp.c Fri Jan 28 21:13:10 2022 +0000
@@ -0,0 +1,26 @@
+$NetBSD: patch-src_unix_udp.c,v 1.5 2022/01/28 21:13:10 schmonz Exp $
+
+Apply MacPorts patch-libuv-legacy.diff for pre-10.7 platforms.
+
+--- src/unix/udp.c.orig 2022-01-04 14:18:00.000000000 +0000
++++ src/unix/udp.c
+@@ -927,7 +927,8 @@ static int uv__udp_set_membership6(uv_ud
+ !defined(__NetBSD__) && \
+ !defined(__ANDROID__) && \
+ !defined(__DragonFly__) && \
+- !defined(__QNX__)
++ !defined(__QNX__) && \
++ (!defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070)
+ static int uv__udp_set_source_membership4(uv_udp_t* handle,
+ const struct sockaddr_in* multicast_addr,
+ const char* interface_addr,
+@@ -1119,7 +1120,8 @@ int uv_udp_set_source_membership(uv_udp_
+ !defined(__NetBSD__) && \
+ !defined(__ANDROID__) && \
+ !defined(__DragonFly__) && \
+- !defined(__QNX__)
++ !defined(__QNX__) && \
++ (!defined(__APPLE__) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070)
+ int err;
+ union uv__sockaddr mcast_addr;
+ union uv__sockaddr src_addr;
diff -r 6c0c2fbfe4cf -r f583f6f99db2 devel/libuv/patches/patch-test_test-fs.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/libuv/patches/patch-test_test-fs.c Fri Jan 28 21:13:10 2022 +0000
@@ -0,0 +1,24 @@
+$NetBSD: patch-test_test-fs.c,v 1.3 2022/01/28 21:13:10 schmonz Exp $
+
+Apply MacPorts patch-libuv-legacy.diff for pre-10.7 platforms.
+
+--- test/test-fs.c.orig 2022-01-04 14:18:00.000000000 +0000
++++ test/test-fs.c
+@@ -1405,7 +1405,7 @@ TEST_IMPL(fs_fstat) {
+ ASSERT(0 == uv_fs_fstat(NULL, &req, file, NULL));
+ ASSERT(req.result == 0);
+ s = req.ptr;
+-# if defined(__APPLE__)
++# if defined(__APPLE__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050
+ ASSERT(s->st_birthtim.tv_sec == t.st_birthtimespec.tv_sec);
+ ASSERT(s->st_birthtim.tv_nsec == t.st_birthtimespec.tv_nsec);
+ # elif defined(__linux__)
+@@ -1446,7 +1446,7 @@ TEST_IMPL(fs_fstat) {
+ ASSERT(s->st_size == (uint64_t) t.st_size);
+ ASSERT(s->st_blksize == (uint64_t) t.st_blksize);
+ ASSERT(s->st_blocks == (uint64_t) t.st_blocks);
+-#if defined(__APPLE__)
++#if defined(__APPLE__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050
+ ASSERT(s->st_atim.tv_sec == t.st_atimespec.tv_sec);
+ ASSERT(s->st_atim.tv_nsec == t.st_atimespec.tv_nsec);
+ ASSERT(s->st_mtim.tv_sec == t.st_mtimespec.tv_sec);
Home |
Main Index |
Thread Index |
Old Index