pkgsrc-WIP-changes archive

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

libepoll-shim: add version 0.0.20161220



Module Name:	pkgsrc-wip
Committed By:	Mark Davies <mark%ecs.vuw.ac.nz@localhost>
Pushed By:	markd
Date:		Mon Jan 22 15:26:16 2018 +1300
Changeset:	62cb48b7ef9e525cb30d4e55c2badf1a34cd4058

Modified Files:
	Makefile
Added Files:
	libepoll-shim/DESCR
	libepoll-shim/Makefile
	libepoll-shim/PLIST
	libepoll-shim/buildlink3.mk
	libepoll-shim/distinfo
	libepoll-shim/patches/patch-src_epoll.c
	libepoll-shim/patches/patch-src_signalfd.c
	libepoll-shim/patches/patch-src_timerfd.c

Log Message:
libepoll-shim: add version 0.0.20161220

epoll shim implemented using kevent

Not currently functional on NetBSD

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=62cb48b7ef9e525cb30d4e55c2badf1a34cd4058

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 Makefile                                   |  1 +
 libepoll-shim/DESCR                        |  1 +
 libepoll-shim/Makefile                     | 36 +++++++++++++++++
 libepoll-shim/PLIST                        |  8 ++++
 libepoll-shim/buildlink3.mk                | 22 +++++++++++
 libepoll-shim/distinfo                     |  9 +++++
 libepoll-shim/patches/patch-src_epoll.c    | 62 ++++++++++++++++++++++++++++++
 libepoll-shim/patches/patch-src_signalfd.c | 15 ++++++++
 libepoll-shim/patches/patch-src_timerfd.c  | 51 ++++++++++++++++++++++++
 9 files changed, 205 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index 8f7de743cb..dae4d7b17d 100644
--- a/Makefile
+++ b/Makefile
@@ -1673,6 +1673,7 @@ SUBDIR+=	libee
 SUBDIR+=	libeio
 SUBDIR+=	libeio-cvs
 SUBDIR+=	libepc
+SUBDIR+=	libepoll-shim
 SUBDIR+=	libeps
 SUBDIR+=	libevhtp
 SUBDIR+=	libffi-git
diff --git a/libepoll-shim/DESCR b/libepoll-shim/DESCR
new file mode 100644
index 0000000000..04c69ee928
--- /dev/null
+++ b/libepoll-shim/DESCR
@@ -0,0 +1 @@
+epoll shim implemented using kevent.
diff --git a/libepoll-shim/Makefile b/libepoll-shim/Makefile
new file mode 100644
index 0000000000..674ccf2ae9
--- /dev/null
+++ b/libepoll-shim/Makefile
@@ -0,0 +1,36 @@
+# $NetBSD: Makefile,v 1.1 2015/10/07 12:33:16 adam Exp $
+
+DISTNAME=	libepoll-shim-0.0.20161220
+CATEGORIES=	devel
+MASTER_SITES=	${MASTER_SITE_GITHUB:=FreeBSDDesktop/}
+GITHUB_PROJECT=	epoll-shim
+GITHUB_TAG=	c04b26b
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://github.com/FreeBSDDesktop/libepoll-shim
+COMMENT=	epoll shim implemented using kevent
+LICENSE=	mit
+
+USE_LANGUAGES=	c
+NO_CONFIGURE=	yes
+
+WRKSRC=		${WRKDIR}/epoll-shim-c04b26bc60b0520e80a41b8ac0165d0ed9ef595b/
+
+MAKE_FLAGS+=	INCSDIR=${PREFIX}/include/libepoll-shim/sys
+MAKE_FLAGS+=	LIBDIR=${PREFIX}/lib
+MAKE_FLAGS+=	WITHOUT_PROFILE=yes
+MAKE_FLAGS+=	MKPROFILE=no
+
+.include "../../mk/compiler.mk"
+.if !empty(PKGSRC_COMPILER:Mgcc)
+BUILDLINK_TRANSFORM+=	opt:-Weverything:-Wall
+BUILDLINK_TRANSFORM+=	opt:-Wno-missing-variable-declarations:-Wno-missing-declarations
+BUILDLINK_TRANSFORM+=	rm:-Wno-thread-safety-analysis
+.endif
+
+INSTALLATION_DIRS= lib include/libepoll-shim/sys
+
+post-install:
+	cp ${WRKSRC}/include/sys/*.h ${DESTDIR}${PREFIX}/include/libepoll-shim/sys
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/libepoll-shim/PLIST b/libepoll-shim/PLIST
new file mode 100644
index 0000000000..56aa094888
--- /dev/null
+++ b/libepoll-shim/PLIST
@@ -0,0 +1,8 @@
+@comment $NetBSD$
+include/libepoll-shim/sys/epoll.h
+include/libepoll-shim/sys/signalfd.h
+include/libepoll-shim/sys/timerfd.h
+lib/libepoll-shim.a
+lib/libepoll-shim.so
+lib/libepoll-shim.so.0
+lib/libepoll-shim_pic.a
diff --git a/libepoll-shim/buildlink3.mk b/libepoll-shim/buildlink3.mk
new file mode 100644
index 0000000000..58c57ceb29
--- /dev/null
+++ b/libepoll-shim/buildlink3.mk
@@ -0,0 +1,22 @@
+# $NetBSD$
+# XXX
+# XXX This file was created automatically using createbuildlink-3.17.
+# XXX After this file has been verified as correct, the comment lines
+# XXX beginning with "XXX" should be removed.  Please do not commit
+# XXX unverified buildlink3.mk files.
+# XXX
+# XXX Packages that only install static libraries or headers should
+# XXX include the following line:
+# XXX
+# XXX	BUILDLINK_DEPMETHOD.libepoll-shim?=	build
+
+BUILDLINK_TREE+=	libepoll-shim
+
+.if !defined(LIBEPOLL_SHIM_BUILDLINK3_MK)
+LIBEPOLL_SHIM_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.libepoll-shim+=	libepoll-shim>=0.0.20161220
+BUILDLINK_PKGSRCDIR.libepoll-shim?=	../../wip/libepoll-shim
+.endif	# LIBEPOLL_SHIM_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-libepoll-shim
diff --git a/libepoll-shim/distinfo b/libepoll-shim/distinfo
new file mode 100644
index 0000000000..6362024fd7
--- /dev/null
+++ b/libepoll-shim/distinfo
@@ -0,0 +1,9 @@
+$NetBSD$
+
+SHA1 (libepoll-shim-0.0.20161220-c04b26b.tar.gz) = e4681edbbe6b882c264405bb0742dc1f5811323e
+RMD160 (libepoll-shim-0.0.20161220-c04b26b.tar.gz) = 243c19ceab9d6c159349a67bb48305799fd0c9c6
+SHA512 (libepoll-shim-0.0.20161220-c04b26b.tar.gz) = b497b7ecd780364ae98c7b5d4a45098e47f4afb8f96dc48f3e765a69212c74f6a796adab9e5114aae9f95e6d0e7c4d13c0c6f97bf287cd0d298f321cbb765be3
+Size (libepoll-shim-0.0.20161220-c04b26b.tar.gz) = 7635 bytes
+SHA1 (patch-src_epoll.c) = be388ee385bd9eaa20210d7140a6e5d7dbc30c30
+SHA1 (patch-src_signalfd.c) = 9888cbd1b84cd6ad6d5d9965bee223a9c176e8c9
+SHA1 (patch-src_timerfd.c) = 3c499e28285a55d3af319c2fe3548fc8b5342d35
diff --git a/libepoll-shim/patches/patch-src_epoll.c b/libepoll-shim/patches/patch-src_epoll.c
new file mode 100644
index 0000000000..65738a7e71
--- /dev/null
+++ b/libepoll-shim/patches/patch-src_epoll.c
@@ -0,0 +1,62 @@
+$NetBSD$
+
+<stdlib.h> for exit()
+unused variables
+
+--- src/epoll.c.orig	2016-12-20 21:20:05.000000000 +0000
++++ src/epoll.c
+@@ -11,6 +11,7 @@
+ #include <signal.h>
+ #include <stdio.h>
+ #include <string.h>
++#include <stdlib.h>
+ 
+ #if 1
+ int epoll_create(int size)
+@@ -51,7 +52,6 @@ epoll_kevent_set(int fd, uintptr_t ident
+ static int
+ epoll_ctl_add(int fd, int fd2, struct epoll_event *ev)
+ {
+-	struct kevent kev;
+ 	int ret = 0;
+ 	if(ev->events & EPOLLIN) {
+ 		ret = epoll_kevent_set(fd, fd2, EVFILT_READ, EV_ADD, 0, 0, ev->data.ptr);
+@@ -75,7 +75,8 @@ epoll_ctl_del(int fd, int fd2, struct ep
+ 	// TODO: Check if event exist before attemt to delete. Is there an
+ 	// API for that or do we need to keep track of <ident,filter> events
+ 	// we added to the queue?
+-	return 0;
++	ret = 0;
++	return ret;
+ }
+ 
+ int
+@@ -94,16 +95,16 @@ epoll_ctl(int fd, int op, int fd2, struc
+ 			ret = epoll_ctl_del(fd, fd2, ev);
+ 		}
+ 	} else if (op == EPOLL_CTL_MOD) {
+-		if(ev->events & EPOLLIN && ev->events & EPOLLOUT) {
++		if((ev->events & EPOLLIN) && (ev->events & EPOLLOUT)) {
+ 			// Adding both EVFILT_READ and EVFILT_WRITE
+ 			// Existing events will be modified.
+ 			ret = epoll_ctl_add(fd, fd2, ev);
+-		} else if(ev->events & EPOLLOUT == 0) {
++		} else if((ev->events & EPOLLOUT) == 0) {
+ 			// Is it OK to assume this?
+ 			ret = epoll_kevent_set(fd, fd2, EVFILT_WRITE, EV_DELETE, 0, 0, 0);
+ 			// Returns -1 if event does not exist so ignore return value for now.
+ 			ret = 0;
+-		} else if(ev->events & EPOLLIN == 0) {
++		} else if((ev->events & EPOLLIN) == 0) {
+ 			// Is it OK to assume this?
+ 			ret = epoll_kevent_set(fd, fd2, EVFILT_READ, EV_DELETE, 0, 0, 0);
+ 			// Returns -1 if event does not exist so ignore return value for now.
+@@ -194,7 +195,7 @@ epoll_wait(int fd, struct epoll_event *e
+ 			events |= EPOLLHUP;
+ 		}
+ 		ev[i].events = events;
+-		ev[i].data.ptr = evlist[i].udata;
++		ev[i].data.ptr = (void *) evlist[i].udata;
+ 	}
+ 	return ret;
+ }
diff --git a/libepoll-shim/patches/patch-src_signalfd.c b/libepoll-shim/patches/patch-src_signalfd.c
new file mode 100644
index 0000000000..f208c2857f
--- /dev/null
+++ b/libepoll-shim/patches/patch-src_signalfd.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+--- src/signalfd.c.orig	2016-12-20 21:20:05.000000000 +0000
++++ src/signalfd.c
+@@ -16,6 +16,10 @@
+ #include <string.h>
+ #include <unistd.h>
+ 
++#ifndef _SIG_MAXSIG
++#define _SIG_MAXSIG _NSIG
++#endif
++
+ struct signalfd_context {
+ 	int fd;
+ 	int flags;
diff --git a/libepoll-shim/patches/patch-src_timerfd.c b/libepoll-shim/patches/patch-src_timerfd.c
new file mode 100644
index 0000000000..3ea27fa409
--- /dev/null
+++ b/libepoll-shim/patches/patch-src_timerfd.c
@@ -0,0 +1,51 @@
+$NetBSD$
+
+Don't know how to do this so bail if actually called
+on NetBSD
+
+--- src/timerfd.c.orig	2016-12-20 21:20:05.000000000 +0000
++++ src/timerfd.c
+@@ -9,7 +9,9 @@
+ #include <sys/time.h>
+ 
+ #include <pthread.h>
++#ifndef __NetBSD__
+ #include <pthread_np.h>
++#endif
+ 
+ #include <errno.h>
+ #include <signal.h>
+@@ -53,6 +55,7 @@ get_timerfd_context(int fd, bool create_
+ 	return NULL;
+ }
+ 
++#ifndef __NetBSD__
+ static void *
+ worker_function(void *arg)
+ {
+@@ -81,6 +84,7 @@ worker_function(void *arg)
+ 
+ 	return NULL;
+ }
++#endif
+ 
+ static int
+ timerfd_create_impl(int clockid, int flags)
+@@ -104,6 +108,9 @@ timerfd_create_impl(int clockid, int fla
+ 		return -1;
+ 	}
+ 
++#ifdef __NetBSD__
++	abort();
++#else
+ 	ctx->flags = flags;
+ 
+ 	struct kevent kev;
+@@ -142,6 +149,7 @@ timerfd_create_impl(int clockid, int fla
+ 		ctx->fd = -1;
+ 		return -1;
+ 	}
++#endif
+ 
+ 	return ctx->fd;
+ }


Home | Main Index | Thread Index | Old Index