pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel add libepoll-shim 0.0.20210418 small library tha...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/97c346eb377c
branches:  trunk
changeset: 451896:97c346eb377c
user:      jdolecek <jdolecek%pkgsrc.org@localhost>
date:      Mon May 03 17:17:17 2021 +0000

description:
add libepoll-shim 0.0.20210418 small library that implements epoll with kqueue

will be used for net/xfreerdp2

diffstat:

 devel/Makefile                    |   3 +-
 devel/libepoll-shim/DESCR         |  48 +++++++++++++++++++++++++++++++++++++++
 devel/libepoll-shim/Makefile      |  24 +++++++++++++++++++
 devel/libepoll-shim/PLIST         |  15 ++++++++++++
 devel/libepoll-shim/buildlink3.mk |  14 +++++++++++
 devel/libepoll-shim/distinfo      |   6 ++++
 6 files changed, 109 insertions(+), 1 deletions(-)

diffs (144 lines):

diff -r f04e431b082e -r 97c346eb377c devel/Makefile
--- a/devel/Makefile    Mon May 03 17:15:22 2021 +0000
+++ b/devel/Makefile    Mon May 03 17:17:17 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3370 2021/05/02 13:43:15 pho Exp $
+# $NetBSD: Makefile,v 1.3371 2021/05/03 17:17:17 jdolecek Exp $
 #
 
 COMMENT=       Development utilities
@@ -765,6 +765,7 @@
 SUBDIR+=       libdwarf
 SUBDIR+=       libebml
 SUBDIR+=       libelf
+SUBDIR+=       libepoll-shim
 SUBDIR+=       libestr
 SUBDIR+=       libetm
 SUBDIR+=       libev
diff -r f04e431b082e -r 97c346eb377c devel/libepoll-shim/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/libepoll-shim/DESCR Mon May 03 17:17:17 2021 +0000
@@ -0,0 +1,48 @@
+This is a small library that implements epoll on top of kqueue. It
+has been successfully used to port libinput, libevdev, Wayland and
+more software to FreeBSD: https://www.freshports.org/devel/libepoll-shim/
+
+It may be useful for porting other software that uses epoll as well.
+
+The library provides implementation of Linux timerfd_create(2) related
+APIs, eventfd(2), signalfd(2).
+
+However, this library contains some very ugly hacks and workarounds.
+For example:
+
+- When using timerfd, signalfd or eventfd, the system calls read,
+  write and close are redefined as macros to internal helper
+  functions.  This is needed as there is some internal context that
+  has to be free'd properly. This means that you shouldn't create
+  a timerfd/signalfd in one part of a program and close it in a
+  different part where sys/timerfd.h isn't included. The context
+  would leak. Luckily, software such as libinput behaves very nicely
+  and puts all timerfd related code in a single source file.
+
+- There is limited support for file descriptors that lack support
+  for kqueue but are supported by poll(2). This includes graphics
+  or sound devices under /dev. Those descriptors are handled in an
+  outer poll(2) loop. Edge triggering using EPOLLET will not work.
+
+- Shimmed file descriptors cannot be shared between processes. On
+  fork() those fds are closed. When trying to pass a shimmed fd to
+  another process the sendmsg call will return EOPNOTSUPP. In most
+  cases sharing epoll/timerfd/signalfd is a bad idea anyway, but
+  there are some legitimate use cases (for example sharing semaphore
+  eventfds, issue #23). When the OS natively supports eventfds (as
+  is the case for FreeBSD >= 13) this library won't provide eventfd
+  shims or the sys/eventfd.h header.
+
+- There is no proper notification mechanism for changes to the
+  system CLOCK_REALTIME clock on BSD systems. Also, kevent
+  EVFILT_TIMERs use the system monotonic clock as reference.
+  Therefore, in order to implement absolute (TFD_TIMER_ABSTIME)
+  CLOCK_REALTIME timerfds or cancellation support
+  (TFD_TIMER_CANCEL_ON_SET), a thread is spawned that periodically
+  polls the system boot time for changes to the realtime clock.
+
+The following operating systems are supported:
+
+FreeBSD >= 11.4, >= 12.2, >= 13.0
+NetBSD >= 9.1
+OpenBSD >= 6.7
diff -r f04e431b082e -r 97c346eb377c devel/libepoll-shim/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/libepoll-shim/Makefile      Mon May 03 17:17:17 2021 +0000
@@ -0,0 +1,24 @@
+# $NetBSD: Makefile,v 1.1 2021/05/03 17:17:17 jdolecek Exp $
+
+GITHUB_PROJECT=        epoll-shim
+GITHUB_TAG=    refs/tags/v${PKGVERSION_NOREV}
+DISTNAME=      ${GITHUB_PROJECT}-0.0.20210418
+PKGNAME=       lib${DISTNAME}
+PKGREVISION=   # empty
+CATEGORIES=    devel
+MASTER_SITES=  ${MASTER_SITE_GITHUB:=jiixyj/}
+
+MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=      https://github.com/jiixyj/epoll-shim
+COMMENT=       Small epoll implemented using kevent
+LICENSE=       mit
+
+USE_CMAKE=     yes
+USE_TOOLS+=    pkg-config
+USE_LANGUAGES= c c++
+
+CMAKE_ARGS+=   -DBUILD_TESTING=OFF
+
+WRKSRC=                ${WRKDIR}/${DISTNAME}
+
+.include "../../mk/bsd.pkg.mk"
diff -r f04e431b082e -r 97c346eb377c devel/libepoll-shim/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/libepoll-shim/PLIST Mon May 03 17:17:17 2021 +0000
@@ -0,0 +1,15 @@
+@comment $NetBSD: PLIST,v 1.1 2021/05/03 17:17:17 jdolecek Exp $
+include/libepoll-shim/epoll-shim/detail/common.h
+include/libepoll-shim/epoll-shim/detail/poll.h
+include/libepoll-shim/epoll-shim/detail/read.h
+include/libepoll-shim/epoll-shim/detail/write.h
+include/libepoll-shim/sys/epoll.h
+include/libepoll-shim/sys/eventfd.h
+include/libepoll-shim/sys/signalfd.h
+include/libepoll-shim/sys/timerfd.h
+lib/cmake/epoll-shim/epoll-shim-config.cmake
+lib/cmake/epoll-shim/epoll-shim-targets-noconfig.cmake
+lib/cmake/epoll-shim/epoll-shim-targets.cmake
+lib/libepoll-shim.so
+lib/libepoll-shim.so.0
+libdata/pkgconfig/epoll-shim.pc
diff -r f04e431b082e -r 97c346eb377c devel/libepoll-shim/buildlink3.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/libepoll-shim/buildlink3.mk Mon May 03 17:17:17 2021 +0000
@@ -0,0 +1,14 @@
+# $NetBSD: buildlink3.mk,v 1.1 2021/05/03 17:17:17 jdolecek Exp $
+
+BUILDLINK_TREE+=       libepoll-shim
+
+.if !defined(LIBEPOLL_SHIM_BUILDLINK3_MK)
+LIBEPOLL_SHIM_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.libepoll-shim+=  libepoll-shim>=0.0.20210418
+BUILDLINK_PKGSRCDIR.libepoll-shim?=    ../../devel/libepoll-shim
+BUILDLINK_INCDIRS.libepoll-shim=       include/libepoll-shim
+
+.endif # LIBEPOLL_SHIM_BUILDLINK3_MK
+
+BUILDLINK_TREE+=       -libepoll-shim
diff -r f04e431b082e -r 97c346eb377c devel/libepoll-shim/distinfo
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/libepoll-shim/distinfo      Mon May 03 17:17:17 2021 +0000
@@ -0,0 +1,6 @@
+$NetBSD: distinfo,v 1.1 2021/05/03 17:17:17 jdolecek Exp $
+
+SHA1 (epoll-shim-0.0.20210418.tar.gz) = 91d34e8a3e07afc1bfbca4575894f31bc7d3aa70
+RMD160 (epoll-shim-0.0.20210418.tar.gz) = 0e8a136b1b3716eaa4f7b1c7b52219d36522b09d
+SHA512 (epoll-shim-0.0.20210418.tar.gz) = 34272a694165bfb47f8a103d18aec304f7a72b36491b83268ff63dd696f5103ab53dc9e32173ed20ddd7baa36b9d7ca2b3ec6236eef8dc2f02a101819b75eb7b
+Size (epoll-shim-0.0.20210418.tar.gz) = 91936 bytes



Home | Main Index | Thread Index | Old Index