pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/devel/objfw objfw: Fix build and tests under NetBSD
details: https://anonhg.NetBSD.org/pkgsrc/rev/7ed482735b0a
branches: trunk
changeset: 383225:7ed482735b0a
user: ryoon <ryoon%pkgsrc.org@localhost>
date: Mon Aug 15 14:56:04 2022 +0000
description:
objfw: Fix build and tests under NetBSD
diffstat:
devel/objfw/distinfo | 4 +-
devel/objfw/patches/patch-src_OFKernelEventObserver__kqueue.m | 24 +++++++
devel/objfw/patches/patch-src_threading__pthread.m | 36 +++++++++++
3 files changed, 63 insertions(+), 1 deletions(-)
diffs (80 lines):
diff -r 3fb0e6bc7d78 -r 7ed482735b0a devel/objfw/distinfo
--- a/devel/objfw/distinfo Mon Aug 15 14:48:34 2022 +0000
+++ b/devel/objfw/distinfo Mon Aug 15 14:56:04 2022 +0000
@@ -1,5 +1,7 @@
-$NetBSD: distinfo,v 1.4 2021/10/26 10:15:44 nia Exp $
+$NetBSD: distinfo,v 1.5 2022/08/15 14:56:04 ryoon Exp $
BLAKE2s (objfw-0.90.2.tar.gz) = 4fe99a0a775aed1270bbd549b1bef0eb23170022b897c5e6f9566caf1b3720a2
SHA512 (objfw-0.90.2.tar.gz) = c894befe9388a5fce9c0e18fbd737f995af9923d52cfb3c8c1faca8879121cd68654d8e262f6a9fdb1578073dd70e5364737ad5ffaa483d9553d6a549af2ec67
Size (objfw-0.90.2.tar.gz) = 650744 bytes
+SHA1 (patch-src_OFKernelEventObserver__kqueue.m) = 4dc82606f5db15bf109cdf6bdf5ed886212a1d22
+SHA1 (patch-src_threading__pthread.m) = 3bc4948a25bfc261e83984524539e49066a6a59c
diff -r 3fb0e6bc7d78 -r 7ed482735b0a devel/objfw/patches/patch-src_OFKernelEventObserver__kqueue.m
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/objfw/patches/patch-src_OFKernelEventObserver__kqueue.m Mon Aug 15 14:56:04 2022 +0000
@@ -0,0 +1,24 @@
+$NetBSD: patch-src_OFKernelEventObserver__kqueue.m,v 1.1 2022/08/15 14:56:04 ryoon Exp $
+
+* Fix build for kqueue under NetBSD.
+
+--- src/OFKernelEventObserver_kqueue.m.orig 2017-10-23 21:05:22.000000000 +0000
++++ src/OFKernelEventObserver_kqueue.m
+@@ -97,7 +97,7 @@
+ #ifndef OF_NETBSD
+ event.udata = object;
+ #else
+- event.udata = (intptr_t)object;
++ event.udata = (__typeof__(event.udata))object;
+ #endif
+
+ if (kevent(_kernelQueue, &event, 1, NULL, 0, NULL) != 0)
+@@ -116,7 +116,7 @@
+ #ifndef OF_NETBSD
+ event.udata = object;
+ #else
+- event.udata = (intptr_t)object;
++ event.udata = (__typeof__(event.udata))object;
+ #endif
+
+ if (kevent(_kernelQueue, &event, 1, NULL, 0, NULL) != 0)
diff -r 3fb0e6bc7d78 -r 7ed482735b0a devel/objfw/patches/patch-src_threading__pthread.m
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/objfw/patches/patch-src_threading__pthread.m Mon Aug 15 14:56:04 2022 +0000
@@ -0,0 +1,36 @@
+$NetBSD: patch-src_threading__pthread.m,v 1.1 2022/08/15 14:56:04 ryoon Exp $
+
+* Do not fail under NetBSD.
+
+--- src/threading_pthread.m.orig 2017-10-23 21:05:22.000000000 +0000
++++ src/threading_pthread.m
+@@ -40,16 +40,28 @@ struct thread_ctx {
+ OF_CONSTRUCTOR()
+ {
+ pthread_attr_t pattr;
++
++ OF_ENSURE(pthread_attr_init(&pattr) == 0);
++/*
++ * NetBSD's default policy, SCHED_OTHER, does not support priority.
++ * And sched_get_priority_min() and sched_get_priority_max()
++ * return (-1) in SCHED_OTHER case.
++ */
++#if !defined(OF_NETBSD)
+ int policy;
+ struct sched_param param;
+
+- OF_ENSURE(pthread_attr_init(&pattr) == 0);
+ OF_ENSURE(pthread_attr_getschedpolicy(&pattr, &policy) == 0);
+ OF_ENSURE((minPrio = sched_get_priority_min(policy)) != -1);
+ OF_ENSURE((maxPrio = sched_get_priority_max(policy)) != -1);
+ OF_ENSURE(pthread_attr_getschedparam(&pattr, ¶m) == 0);
+
+ normalPrio = param.sched_priority;
++#else
++ minPrio = 0;
++ maxPrio = 0;
++ normalPrio = 0;
++#endif
+
+ pthread_attr_destroy(&pattr);
+ }
Home |
Main Index |
Thread Index |
Old Index