diff --git a/dev-libs/libuv/libuv-1.29.1.recipe b/dev-libs/libuv/libuv-1.33.1.recipe similarity index 94% rename from dev-libs/libuv/libuv-1.29.1.recipe rename to dev-libs/libuv/libuv-1.33.1.recipe index 2a13dca62..335f7d383 100644 --- a/dev-libs/libuv/libuv-1.29.1.recipe +++ b/dev-libs/libuv/libuv-1.33.1.recipe @@ -5,9 +5,9 @@ used by Luvit, Julia, pyuv, and others." HOMEPAGE="https://libuv.org/" COPYRIGHT="2015-present libuv project contributors" LICENSE="MIT" -REVISION="4" +REVISION="1" SOURCE_URI="https://github.com/libuv/libuv/archive/v$portVersion/libuv-$portVersion.tar.gz" -CHECKSUM_SHA256="bdde1140087ce97080ea323c3598553ece00a24ae63ac568be78bef3e97f3e25" +CHECKSUM_SHA256="63794499bf5da1720e249d3fc14ff396b70b8736effe6ce5b4e47e0f3d476467" PATCHES="libuv-$portVersion.patchset" ARCHITECTURES="!x86_gcc2 ?x86 x86_64" diff --git a/dev-libs/libuv/patches/libuv-1.29.1.patchset b/dev-libs/libuv/patches/libuv-1.29.1.patchset deleted file mode 100644 index b54cd466f..000000000 --- a/dev-libs/libuv/patches/libuv-1.29.1.patchset +++ /dev/null @@ -1,482 +0,0 @@ -From 0e6de315574e7a263b601ad572f14e5c8466e8f4 Mon Sep 17 00:00:00 2001 -From: Leorize -Date: Fri, 4 Jan 2019 23:45:20 +0700 -Subject: build, core, unix: add support for Haiku - -This commit add support for Haiku, an open-source operating system -inspired by BeOS. - -diff --git a/Makefile.am b/Makefile.am -index 07224f3..32f4db7 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -409,6 +409,17 @@ libuv_la_SOURCES += src/unix/bsd-ifaddrs.c \ - test_run_tests_LDFLAGS += -lutil - endif - -+if HAIKU -+uvinclude_HEADERS += include/uv/posix.h -+libuv_la_CFLAGS += -D_BSD_SOURCE -+libuv_la_SOURCES += src/unix/bsd-ifaddrs.c \ -+ src/unix/haiku.c \ -+ src/unix/no-fsevents.c \ -+ src/unix/no-proctitle.c \ -+ src/unix/posix-hrtime.c \ -+ src/unix/posix-poll.c -+endif -+ - if HURD - uvinclude_HEADERS += include/uv/posix.h - libuv_la_SOURCES += src/unix/no-fsevents.c \ -diff --git a/configure.ac b/configure.ac -index ad99f9a..5ab75b8 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -56,6 +56,7 @@ AM_CONDITIONAL([CYGWIN], [AS_CASE([$host_os],[cygwin*], [true], [false]) - AM_CONDITIONAL([DARWIN], [AS_CASE([$host_os],[darwin*], [true], [false])]) - AM_CONDITIONAL([DRAGONFLY],[AS_CASE([$host_os],[dragonfly*], [true], [false])]) - AM_CONDITIONAL([FREEBSD], [AS_CASE([$host_os],[*freebsd*], [true], [false])]) -+AM_CONDITIONAL([HAIKU], [AS_CASE([$host_os],[haiku], [true], [false])]) - AM_CONDITIONAL([HURD], [AS_CASE([$host_os],[gnu*], [true], [false])]) - AM_CONDITIONAL([LINUX], [AS_CASE([$host_os],[linux*], [true], [false])]) - AM_CONDITIONAL([MSYS], [AS_CASE([$host_os],[msys*], [true], [false])]) -@@ -71,6 +72,9 @@ AS_CASE([$host_os], [netbsd*], [AC_CHECK_LIB([kvm], [kvm_open])]) - AS_CASE([$host_os], [kfreebsd*], [ - LIBS="$LIBS -lfreebsd-glue" - ]) -+AS_CASE([$host_os], [haiku], [ -+ LIBS="$LIBS -lnetwork" -+]) - AC_CHECK_HEADERS([sys/ahafs_evProds.h]) - AC_CONFIG_FILES([Makefile libuv.pc]) - AC_CONFIG_LINKS([test/fixtures/empty_file:test/fixtures/empty_file]) -diff --git a/include/uv/unix.h b/include/uv/unix.h -index f73b7b0..6c93ee9 100644 ---- a/include/uv/unix.h -+++ b/include/uv/unix.h -@@ -66,6 +66,8 @@ - defined(__MSYS__) || \ - defined(__GNU__) - # include "uv/posix.h" -+#elif defined(__HAIKU__) -+# include "uv/posix.h" - #endif - - #ifndef NI_MAXHOST -diff --git a/src/unix/bsd-ifaddrs.c b/src/unix/bsd-ifaddrs.c -index a4c6bf9..0d7bbe6 100644 ---- a/src/unix/bsd-ifaddrs.c -+++ b/src/unix/bsd-ifaddrs.c -@@ -31,6 +31,10 @@ - #include - #endif - -+#if defined(__HAIKU__) -+#define IFF_RUNNING IFF_LINK -+#endif -+ - static int uv__ifaddr_exclude(struct ifaddrs *ent, int exclude_type) { - if (!((ent->ifa_flags & IFF_UP) && (ent->ifa_flags & IFF_RUNNING))) - return 1; -@@ -45,7 +49,8 @@ static int uv__ifaddr_exclude(struct ifaddrs *ent, int exclude_type) { - if (exclude_type == UV__EXCLUDE_IFPHYS) - return (ent->ifa_addr->sa_family != AF_LINK); - #endif --#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__DragonFly__) -+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__DragonFly__) || \ -+ defined(__HAIKU__) - /* - * On BSD getifaddrs returns information related to the raw underlying - * devices. We're not interested in this information. -diff --git a/src/unix/core.c b/src/unix/core.c -index 3bada90..1b3de43 100644 ---- a/src/unix/core.c -+++ b/src/unix/core.c -@@ -579,7 +579,7 @@ int uv__nonblock_ioctl(int fd, int set) { - } - - --#if !defined(__CYGWIN__) && !defined(__MSYS__) -+#if !defined(__CYGWIN__) && !defined(__MSYS__) && !defined(__HAIKU__) - int uv__cloexec_ioctl(int fd, int set) { - int r; - -@@ -947,7 +947,7 @@ int uv_getrusage(uv_rusage_t* rusage) { - rusage->ru_stime.tv_sec = usage.ru_stime.tv_sec; - rusage->ru_stime.tv_usec = usage.ru_stime.tv_usec; - --#if !defined(__MVS__) -+#if !defined(__MVS__) && !defined(__HAIKU__) - rusage->ru_maxrss = usage.ru_maxrss; - rusage->ru_ixrss = usage.ru_ixrss; - rusage->ru_idrss = usage.ru_idrss; -diff --git a/src/unix/haiku.c b/src/unix/haiku.c -new file mode 100644 -index 0000000..6f40365 ---- /dev/null -+++ b/src/unix/haiku.c -@@ -0,0 +1,171 @@ -+/* Copyright libuv project contributors. All rights reserved. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a copy -+ * of this software and associated documentation files (the "Software"), to -+ * deal in the Software without restriction, including without limitation the -+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the Software is -+ * furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be included in -+ * all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -+ * IN THE SOFTWARE. -+ */ -+ -+#include "uv.h" -+#include "internal.h" -+ -+#include /* find_path() */ -+#include -+ -+ -+void uv_loadavg(double avg[3]) { -+ avg[0] = 0; -+ avg[1] = 0; -+ avg[2] = 0; -+} -+ -+ -+int uv_exepath(char* buffer, size_t* size) { -+ char abspath[B_PATH_NAME_LENGTH]; -+ status_t status; -+ ssize_t abspath_len; -+ -+ if (buffer == NULL || size == NULL || *size == 0) -+ return UV_EINVAL; -+ -+ status = find_path(B_APP_IMAGE_SYMBOL, B_FIND_PATH_IMAGE_PATH, NULL, abspath, -+ sizeof(abspath)); -+ if (status != B_OK) -+ return UV__ERR(status); -+ -+ abspath_len = uv__strscpy(buffer, abspath, *size); -+ *size -= 1; -+ if (abspath_len >= 0 && *size > (size_t)abspath_len) -+ *size = (size_t)abspath_len; -+ -+ return 0; -+} -+ -+ -+uint64_t uv_get_free_memory(void) { -+ status_t status; -+ system_info sinfo; -+ -+ status = get_system_info(&sinfo); -+ if (status != B_OK) -+ return 0; -+ -+ return (sinfo.max_pages - sinfo.used_pages) * B_PAGE_SIZE; -+} -+ -+ -+uint64_t uv_get_total_memory(void) { -+ status_t status; -+ system_info sinfo; -+ -+ status = get_system_info(&sinfo); -+ if (status != B_OK) -+ return 0; -+ -+ return sinfo.max_pages * B_PAGE_SIZE; -+} -+ -+ -+int uv_resident_set_memory(size_t* rss) { -+ area_info area; -+ ssize_t cookie; -+ status_t status; -+ thread_info thread; -+ -+ status = get_thread_info(find_thread(NULL), &thread); -+ if (status != B_OK) -+ return UV__ERR(status); -+ -+ cookie = 0; -+ *rss = 0; -+ while (get_next_area_info(thread.team, &cookie, &area) == B_OK) -+ *rss += area.ram_size; -+ -+ return 0; -+} -+ -+ -+int uv_uptime(double* uptime) { -+ /* system_time() returns time since booting in microseconds */ -+ *uptime = (double)system_time() / 1000000; -+ return 0; -+} -+ -+ -+int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) { -+ cpu_topology_node_info* topology_infos; -+ int i; -+ status_t status; -+ system_info system; -+ uint32_t topology_count; -+ uint64_t cpuspeed; -+ uv_cpu_info_t* cpu_info; -+ -+ if (cpu_infos == NULL || count == NULL) -+ return UV_EINVAL; -+ -+ status = get_cpu_topology_info(NULL, &topology_count); -+ if (status != B_OK) -+ return UV__ERR(status); -+ -+ topology_infos = uv__malloc(topology_count * sizeof(*topology_infos)); -+ if (topology_infos == NULL) -+ return UV_ENOMEM; -+ -+ status = get_cpu_topology_info(topology_infos, &topology_count); -+ if (status != B_OK) { -+ uv__free(topology_infos); -+ return UV__ERR(status); -+ } -+ -+ cpuspeed = 0; -+ for (i = 0; i < (int)topology_count; i++) { -+ if (topology_infos[i].type == B_TOPOLOGY_CORE) { -+ cpuspeed = topology_infos[i].data.core.default_frequency; -+ break; -+ } -+ } -+ -+ uv__free(topology_infos); -+ -+ status = get_system_info(&system); -+ if (status != B_OK) -+ return UV__ERR(status); -+ -+ *cpu_infos = uv__calloc(system.cpu_count, sizeof(**cpu_infos)); -+ if (*cpu_infos == NULL) -+ return UV_ENOMEM; -+ -+ /* CPU time and model are not exposed by Haiku. */ -+ cpu_info = *cpu_infos; -+ for (i = 0; i < (int)system.cpu_count; i++) { -+ cpu_info->model = uv__strdup("unknown"); -+ cpu_info->speed = (int)(cpuspeed / 1000000); -+ cpu_info++; -+ } -+ *count = system.cpu_count; -+ -+ return 0; -+} -+ -+void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count) { -+ int i; -+ -+ for (i = 0; i < count; i++) -+ uv__free(cpu_infos[i].model); -+ -+ uv__free(cpu_infos); -+} -diff --git a/src/unix/process.c b/src/unix/process.c -index b284308..e29bf15 100644 ---- a/src/unix/process.c -+++ b/src/unix/process.c -@@ -385,6 +385,11 @@ static void uv__process_child_init(const uv_process_options_t* options, - if (n == SIGKILL || n == SIGSTOP) - continue; /* Can't be changed. */ - -+#if defined(__HAIKU__) -+ if (n == SIGKILLTHR) -+ continue; /* Can't be changed. */ -+#endif -+ - if (SIG_ERR != signal(n, SIG_DFL)) - continue; - --- -2.21.0 - - -From 6e819a35bf5382a3eb85df91296d5a31c1af74e6 Mon Sep 17 00:00:00 2001 -From: Leorize -Date: Sat, 5 Jan 2019 01:15:42 +0700 -Subject: test: add Haiku support - - -diff --git a/Makefile.am b/Makefile.am -index 32f4db7..d143d08 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -320,6 +320,10 @@ test_run_tests_CFLAGS += -D_ALL_SOURCE \ - -D_LINUX_SOURCE_COMPAT - endif - -+if HAIKU -+test_run_tests_CFLAGS += -D_BSD_SOURCE -+endif -+ - if LINUX - test_run_tests_CFLAGS += -D_GNU_SOURCE - endif -diff --git a/test/test-fs-copyfile.c b/test/test-fs-copyfile.c -index cd8a2ea..918c086 100644 ---- a/test/test-fs-copyfile.c -+++ b/test/test-fs-copyfile.c -@@ -24,7 +24,8 @@ - - #if defined(__unix__) || defined(__POSIX__) || \ - defined(__APPLE__) || defined(__sun) || \ -- defined(_AIX) || defined(__MVS__) -+ defined(_AIX) || defined(__MVS__) || \ -+ defined(__HAIKU__) - #include /* unlink, etc. */ - #else - # include -diff --git a/test/test-fs.c b/test/test-fs.c -index c3153c7..6cc2257 100644 ---- a/test/test-fs.c -+++ b/test/test-fs.c -@@ -31,7 +31,8 @@ - /* FIXME we shouldn't need to branch in this file */ - #if defined(__unix__) || defined(__POSIX__) || \ - defined(__APPLE__) || defined(__sun) || \ -- defined(_AIX) || defined(__MVS__) -+ defined(_AIX) || defined(__MVS__) || \ -+ defined(__HAIKU__) - #include /* unlink, rmdir, etc. */ - #else - # include -@@ -1653,6 +1654,8 @@ TEST_IMPL(fs_chown) { - uv_run(loop, UV_RUN_DEFAULT); - ASSERT(fchown_cb_count == 1); - -+#ifndef __HAIKU__ -+ /* Haiku doesn't support hardlink */ - /* sync link */ - r = uv_fs_link(NULL, &req, "test_file", "test_file_link", NULL); - ASSERT(r == 0); -@@ -1670,6 +1673,7 @@ TEST_IMPL(fs_chown) { - ASSERT(r == 0); - uv_run(loop, UV_RUN_DEFAULT); - ASSERT(lchown_cb_count == 1); -+#endif - - /* Close file */ - r = uv_fs_close(NULL, &req, file, NULL); --- -2.21.0 - - -From 762fdaa050ebf11087a4ac88fe7bfcb1438ae330 Mon Sep 17 00:00:00 2001 -From: Calvin Hill -Date: Mon, 3 Jun 2019 10:22:50 +0700 -Subject: unix/fs: implement uv_fs_utime and uv_fs_futime for Haiku - - -diff --git a/src/unix/fs.c b/src/unix/fs.c -index 24a130f..bc2f8f3 100644 ---- a/src/unix/fs.c -+++ b/src/unix/fs.c -@@ -189,7 +189,8 @@ static ssize_t uv__fs_fdatasync(uv_fs_t* req) { - - static ssize_t uv__fs_futime(uv_fs_t* req) { - #if defined(__linux__) \ -- || defined(_AIX71) -+ || defined(_AIX71) \ -+ || defined(__HAIKU__) - /* utimesat() has nanosecond resolution but we stick to microseconds - * for the sake of consistency with other platforms. - */ -@@ -796,7 +797,8 @@ static ssize_t uv__fs_sendfile(uv_fs_t* req) { - static ssize_t uv__fs_utime(uv_fs_t* req) { - #if defined(__linux__) \ - || defined(_AIX71) \ -- || defined(__sun) -+ || defined(__sun) \ -+ || defined(__HAIKU__) - /* utimesat() has nanosecond resolution but we stick to microseconds - * for the sake of consistency with other platforms. - */ --- -2.21.0 - - -From a48289363d99e6df8c0388ec6b1484a1f42c7885 Mon Sep 17 00:00:00 2001 -From: Leorize -Date: Mon, 3 Jun 2019 11:14:48 +0700 -Subject: haiku: add uv_get_constrained_memory() stub - -Haiku doesn't have memory limits. - -diff --git a/src/unix/haiku.c b/src/unix/haiku.c -index 6f40365..7708851 100644 ---- a/src/unix/haiku.c -+++ b/src/unix/haiku.c -@@ -79,6 +79,11 @@ uint64_t uv_get_total_memory(void) { - } - - -+uint64_t uv_get_constrained_memory(void) { -+ return 0; /* Memory constraints are unknown. */ -+} -+ -+ - int uv_resident_set_memory(size_t* rss) { - area_info area; - ssize_t cookie; --- -2.21.0 - - -From 1a50968382a5e483ed9d10ba8b3f27f7ba9d3271 Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Sun, 8 Sep 2019 12:42:17 +0200 -Subject: disable setpriority/getpriority for R1B1. - - -diff --git a/src/unix/core.c b/src/unix/core.c -index 1b3de43..62eebb6 100644 ---- a/src/unix/core.c -+++ b/src/unix/core.c -@@ -1359,6 +1359,9 @@ int uv_os_getpriority(uv_pid_t pid, int* priority) { - if (priority == NULL) - return UV_EINVAL; - -+#ifdef __HAIKU__ -+ return UV__ERR(ENOSYS); -+#else - errno = 0; - r = getpriority(PRIO_PROCESS, (int) pid); - -@@ -1367,6 +1370,7 @@ int uv_os_getpriority(uv_pid_t pid, int* priority) { - - *priority = r; - return 0; -+#endif - } - - -@@ -1374,8 +1378,10 @@ int uv_os_setpriority(uv_pid_t pid, int priority) { - if (priority < UV_PRIORITY_HIGHEST || priority > UV_PRIORITY_LOW) - return UV_EINVAL; - -+#ifndef __HAIKU__ - if (setpriority(PRIO_PROCESS, (int) pid, priority) != 0) - return UV__ERR(errno); -+#endif - - return 0; - } --- -2.21.0 - diff --git a/dev-libs/libuv/patches/libuv-1.33.1.patchset b/dev-libs/libuv/patches/libuv-1.33.1.patchset new file mode 100644 index 000000000..27585a0ed --- /dev/null +++ b/dev-libs/libuv/patches/libuv-1.33.1.patchset @@ -0,0 +1,42 @@ +From 7670c98857baba2789aeb3a8edf5431db07acea9 Mon Sep 17 00:00:00 2001 +From: Jerome Duval +Date: Sun, 8 Sep 2019 12:42:17 +0200 +Subject: disable setpriority/getpriority for R1B1. + + +diff --git a/src/unix/core.c b/src/unix/core.c +index ffce948..d261962 100644 +--- a/src/unix/core.c ++++ b/src/unix/core.c +@@ -1443,6 +1443,9 @@ int uv_os_getpriority(uv_pid_t pid, int* priority) { + if (priority == NULL) + return UV_EINVAL; + ++#ifdef __HAIKU__ ++ return UV__ERR(ENOSYS); ++#else + errno = 0; + r = getpriority(PRIO_PROCESS, (int) pid); + +@@ -1451,6 +1454,7 @@ int uv_os_getpriority(uv_pid_t pid, int* priority) { + + *priority = r; + return 0; ++#endif + } + + +@@ -1458,8 +1462,10 @@ int uv_os_setpriority(uv_pid_t pid, int priority) { + if (priority < UV_PRIORITY_HIGHEST || priority > UV_PRIORITY_LOW) + return UV_EINVAL; + ++#ifndef __HAIKU__ + if (setpriority(PRIO_PROCESS, (int) pid, priority) != 0) + return UV__ERR(errno); ++#endif + + return 0; + } +-- +2.23.0 +