ports: Add libuv port
This commit is contained in:
21
ports/libuv/patches/0001-dont-use-cfmakeraw.patch
Normal file
21
ports/libuv/patches/0001-dont-use-cfmakeraw.patch
Normal file
@@ -0,0 +1,21 @@
|
||||
diff -ruN libuv-v1.51.0/src/unix/tty.c libuv-1.51.0-x86_64/src/unix/tty.c
|
||||
--- libuv-v1.51.0/src/unix/tty.c 2025-04-25 12:50:27.000000000 +0300
|
||||
+++ libuv-1.51.0-x86_64/src/unix/tty.c 2025-07-23 17:12:21.857957334 +0300
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <errno.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
-#if defined(__MVS__) && !defined(IMAXBEL)
|
||||
+#if (defined(__MVS__) || defined(__banan_os__)) && !defined(IMAXBEL)
|
||||
#define IMAXBEL 0
|
||||
#endif
|
||||
|
||||
@@ -244,7 +244,7 @@
|
||||
static void uv__tty_make_raw(struct termios* tio) {
|
||||
assert(tio != NULL);
|
||||
|
||||
-#if defined __sun || defined __MVS__
|
||||
+#if defined __sun || defined __MVS__ || defined(__banan_os__)
|
||||
/*
|
||||
* This implementation of cfmakeraw for Solaris and derivatives is taken from
|
||||
* http://www.perkin.org.uk/posts/solaris-portability-cfmakeraw.html.
|
||||
12
ports/libuv/patches/0002-use-simplified-rusage.patch
Normal file
12
ports/libuv/patches/0002-use-simplified-rusage.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff -ruN libuv-v1.51.0/src/unix/core.c libuv-1.51.0-x86_64/src/unix/core.c
|
||||
--- libuv-v1.51.0/src/unix/core.c 2025-04-25 12:50:27.000000000 +0300
|
||||
+++ libuv-1.51.0-x86_64/src/unix/core.c 2025-07-23 17:11:06.844349261 +0300
|
||||
@@ -1036,7 +1036,7 @@
|
||||
rusage->ru_stime.tv_sec = usage.ru_stime.tv_sec;
|
||||
rusage->ru_stime.tv_usec = usage.ru_stime.tv_usec;
|
||||
|
||||
-#if !defined(__MVS__) && !defined(__HAIKU__)
|
||||
+#if !defined(__MVS__) && !defined(__HAIKU__) && !defined(__banan_os__)
|
||||
rusage->ru_maxrss = usage.ru_maxrss;
|
||||
rusage->ru_ixrss = usage.ru_ixrss;
|
||||
rusage->ru_idrss = usage.ru_idrss;
|
||||
33
ports/libuv/patches/0003-use-statvfs.patch
Normal file
33
ports/libuv/patches/0003-use-statvfs.patch
Normal file
@@ -0,0 +1,33 @@
|
||||
diff -ruN libuv-v1.51.0/src/unix/fs.c libuv-1.51.0-x86_64/src/unix/fs.c
|
||||
--- libuv-v1.51.0/src/unix/fs.c 2025-04-25 12:50:27.000000000 +0300
|
||||
+++ libuv-1.51.0-x86_64/src/unix/fs.c 2025-07-23 17:14:28.118310214 +0300
|
||||
@@ -77,7 +77,8 @@
|
||||
defined(__MVS__) || \
|
||||
defined(__NetBSD__) || \
|
||||
defined(__HAIKU__) || \
|
||||
- defined(__QNX__)
|
||||
+ defined(__QNX__) || \
|
||||
+ defined(__banan_os__)
|
||||
# include <sys/statvfs.h>
|
||||
#else
|
||||
# include <sys/statfs.h>
|
||||
@@ -683,7 +684,8 @@
|
||||
defined(__MVS__) || \
|
||||
defined(__NetBSD__) || \
|
||||
defined(__HAIKU__) || \
|
||||
- defined(__QNX__)
|
||||
+ defined(__QNX__) || \
|
||||
+ defined(__banan_os__)
|
||||
struct statvfs buf;
|
||||
|
||||
if (0 != statvfs(req->path, &buf))
|
||||
@@ -705,7 +707,8 @@
|
||||
defined(__OpenBSD__) || \
|
||||
defined(__NetBSD__) || \
|
||||
defined(__HAIKU__) || \
|
||||
- defined(__QNX__)
|
||||
+ defined(__QNX__) || \
|
||||
+ defined(__banan_os__)
|
||||
stat_fs->f_type = 0; /* f_type is not supported. */
|
||||
#else
|
||||
stat_fs->f_type = buf.f_type;
|
||||
13
ports/libuv/patches/0004-dont-use-setgroups.patch
Normal file
13
ports/libuv/patches/0004-dont-use-setgroups.patch
Normal file
@@ -0,0 +1,13 @@
|
||||
diff -ruN libuv-v1.51.0/src/unix/process.c libuv-1.51.0-x86_64/src/unix/process.c
|
||||
--- libuv-v1.51.0/src/unix/process.c 2025-04-25 12:50:27.000000000 +0300
|
||||
+++ libuv-1.51.0-x86_64/src/unix/process.c 2025-07-23 17:16:04.548824726 +0300
|
||||
@@ -390,7 +390,9 @@
|
||||
* aren't root, so don't bother checking the return value, this
|
||||
* is just done as an optimistic privilege dropping function.
|
||||
*/
|
||||
+ #if !defined(__banan_os__)
|
||||
SAVE_ERRNO(setgroups(0, NULL));
|
||||
+ #endif
|
||||
}
|
||||
|
||||
if ((options->flags & UV_PROCESS_SETGID) && setgid(options->gid))
|
||||
22
ports/libuv/patches/0005-dont-use-thread-names.patch
Normal file
22
ports/libuv/patches/0005-dont-use-thread-names.patch
Normal file
@@ -0,0 +1,22 @@
|
||||
diff -ruN libuv-v1.51.0/src/unix/thread.c libuv-1.51.0-x86_64/src/unix/thread.c
|
||||
--- libuv-v1.51.0/src/unix/thread.c 2025-04-25 12:50:27.000000000 +0300
|
||||
+++ libuv-1.51.0-x86_64/src/unix/thread.c 2025-07-23 17:16:19.619749435 +0300
|
||||
@@ -897,7 +897,7 @@
|
||||
abort();
|
||||
}
|
||||
|
||||
-#if defined(_AIX) || defined(__MVS__) || defined(__PASE__)
|
||||
+#if defined(_AIX) || defined(__MVS__) || defined(__PASE__) || defined(__banan_os__)
|
||||
int uv__thread_setname(const char* name) {
|
||||
return UV_ENOSYS;
|
||||
}
|
||||
@@ -938,7 +938,8 @@
|
||||
#if (defined(__ANDROID_API__) && __ANDROID_API__ < 26) || \
|
||||
defined(_AIX) || \
|
||||
defined(__MVS__) || \
|
||||
- defined(__PASE__)
|
||||
+ defined(__PASE__) || \
|
||||
+ defined(__banan_os__)
|
||||
int uv__thread_getname(uv_thread_t* tid, char* name, size_t size) {
|
||||
return UV_ENOSYS;
|
||||
}
|
||||
23
ports/libuv/patches/0006-use-simple-udp.patch
Normal file
23
ports/libuv/patches/0006-use-simple-udp.patch
Normal file
@@ -0,0 +1,23 @@
|
||||
diff -ruN libuv-v1.51.0/src/unix/udp.c libuv-1.51.0-x86_64/src/unix/udp.c
|
||||
--- libuv-v1.51.0/src/unix/udp.c 2025-04-25 12:50:27.000000000 +0300
|
||||
+++ libuv-1.51.0-x86_64/src/unix/udp.c 2025-07-23 17:15:38.986952773 +0300
|
||||
@@ -767,7 +767,8 @@
|
||||
!defined(__ANDROID__) && \
|
||||
!defined(__DragonFly__) && \
|
||||
!defined(__QNX__) && \
|
||||
- !defined(__GNU__)
|
||||
+ !defined(__GNU__) && \
|
||||
+ !defined(__banan_os__)
|
||||
static int uv__udp_set_source_membership4(uv_udp_t* handle,
|
||||
const struct sockaddr_in* multicast_addr,
|
||||
const char* interface_addr,
|
||||
@@ -958,7 +959,8 @@
|
||||
!defined(__ANDROID__) && \
|
||||
!defined(__DragonFly__) && \
|
||||
!defined(__QNX__) && \
|
||||
- !defined(__GNU__)
|
||||
+ !defined(__GNU__) && \
|
||||
+ !defined(__banan_os__)
|
||||
int err;
|
||||
union uv__sockaddr mcast_addr;
|
||||
union uv__sockaddr src_addr;
|
||||
32
ports/libuv/patches/0007-use-posix-functions.patch
Normal file
32
ports/libuv/patches/0007-use-posix-functions.patch
Normal file
@@ -0,0 +1,32 @@
|
||||
diff -ruN libuv-v1.51.0/include/uv/unix.h libuv-1.51.0-x86_64/include/uv/unix.h
|
||||
--- libuv-v1.51.0/include/uv/unix.h 2025-04-25 12:50:27.000000000 +0300
|
||||
+++ libuv-1.51.0-x86_64/include/uv/unix.h 2025-07-28 14:06:18.220856588 +0300
|
||||
@@ -66,7 +66,8 @@
|
||||
defined(__MSYS__) || \
|
||||
defined(__HAIKU__) || \
|
||||
defined(__QNX__) || \
|
||||
- defined(__GNU__)
|
||||
+ defined(__GNU__) || \
|
||||
+ defined(__banan_os__)
|
||||
# include "uv/posix.h"
|
||||
#endif
|
||||
|
||||
diff -ruN libuv-v1.51.0/CMakeLists.txt libuv-1.51.0-x86_64/CMakeLists.txt
|
||||
--- libuv-v1.51.0/CMakeLists.txt 2025-04-25 12:50:27.000000000 +0300
|
||||
+++ libuv-1.51.0-x86_64/CMakeLists.txt 2025-07-28 13:57:21.518563402 +0300
|
||||
@@ -283,6 +283,15 @@
|
||||
list(APPEND uv_sources src/unix/proctitle.c)
|
||||
endif()
|
||||
|
||||
+if(CMAKE_SYSTEM_NAME STREQUAL "banan-os")
|
||||
+ list(APPEND uv_sources
|
||||
+ src/unix/no-fsevents.c
|
||||
+ src/unix/no-proctitle.c
|
||||
+ src/unix/posix-hrtime.c
|
||||
+ src/unix/posix-poll.c
|
||||
+ )
|
||||
+endif()
|
||||
+
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD")
|
||||
list(APPEND uv_sources src/unix/freebsd.c)
|
||||
endif()
|
||||
Reference in New Issue
Block a user