pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/devel/libepoll-shim libepoll-shim: Support NetBSD with...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/0cf59af5b448
branches:  trunk
changeset: 458868:0cf59af5b448
user:      ryoon <ryoon%pkgsrc.org@localhost>
date:      Tue Sep 21 14:44:49 2021 +0000

description:
libepoll-shim: Support NetBSD with eventfd(2)/timerfd(2)

* Simplify logics in Makefile.
* Exclude eventfd.h for NetBSD with eventfd(2).
* Exclude timerfd.h for NetBSD with timerfd(2).

diffstat:

 devel/libepoll-shim/Makefile                         |  13 +++-
 devel/libepoll-shim/PLIST                            |   6 +-
 devel/libepoll-shim/distinfo                         |   3 +-
 devel/libepoll-shim/patches/patch-src_CMakeLists.txt |  48 ++++++++++++++++++++
 4 files changed, 62 insertions(+), 8 deletions(-)

diffs (113 lines):

diff -r 2d2d69fc452e -r 0cf59af5b448 devel/libepoll-shim/Makefile
--- a/devel/libepoll-shim/Makefile      Tue Sep 21 14:27:05 2021 +0000
+++ b/devel/libepoll-shim/Makefile      Tue Sep 21 14:44:49 2021 +0000
@@ -1,10 +1,9 @@
-# $NetBSD: Makefile,v 1.2 2021/05/03 17:20:24 jdolecek Exp $
+# $NetBSD: Makefile,v 1.3 2021/09/21 14:44:49 ryoon Exp $
 
 GITHUB_PROJECT=        epoll-shim
-GITHUB_TAG=    refs/tags/v${PKGVERSION_NOREV}
+GITHUB_TAG=    v${PKGVERSION_NOREV}
 DISTNAME=      ${GITHUB_PROJECT}-0.0.20210418
 PKGNAME=       lib${DISTNAME}
-PKGREVISION=   # empty
 CATEGORIES=    devel
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=jiixyj/}
 
@@ -21,6 +20,12 @@
 
 CMAKE_ARGS+=   -DBUILD_TESTING=OFF
 
-WRKSRC=                ${WRKDIR}/${DISTNAME}
+PLIST_VARS+=   eventfd timerfd
+.if exists("/usr/include/sys/eventfd.h")
+PLIST.eventfd= YES
+.endif
+.if exists("/usr/include/sys/timerfd.h")
+PLIST.timerfd= YES
+.endif
 
 .include "../../mk/bsd.pkg.mk"
diff -r 2d2d69fc452e -r 0cf59af5b448 devel/libepoll-shim/PLIST
--- a/devel/libepoll-shim/PLIST Tue Sep 21 14:27:05 2021 +0000
+++ b/devel/libepoll-shim/PLIST Tue Sep 21 14:44:49 2021 +0000
@@ -1,12 +1,12 @@
-@comment $NetBSD: PLIST,v 1.1 2021/05/03 17:17:17 jdolecek Exp $
+@comment $NetBSD: PLIST,v 1.2 2021/09/21 14:44:49 ryoon 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
+${PLIST.eventfd}include/libepoll-shim/sys/eventfd.h
 include/libepoll-shim/sys/signalfd.h
-include/libepoll-shim/sys/timerfd.h
+${PLIST.timerfd}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
diff -r 2d2d69fc452e -r 0cf59af5b448 devel/libepoll-shim/distinfo
--- a/devel/libepoll-shim/distinfo      Tue Sep 21 14:27:05 2021 +0000
+++ b/devel/libepoll-shim/distinfo      Tue Sep 21 14:44:49 2021 +0000
@@ -1,6 +1,7 @@
-$NetBSD: distinfo,v 1.1 2021/05/03 17:17:17 jdolecek Exp $
+$NetBSD: distinfo,v 1.2 2021/09/21 14:44:49 ryoon 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
+SHA1 (patch-src_CMakeLists.txt) = 47f32282b12c79a9b51d8ffc821cd4ffbf19b728
diff -r 2d2d69fc452e -r 0cf59af5b448 devel/libepoll-shim/patches/patch-src_CMakeLists.txt
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/libepoll-shim/patches/patch-src_CMakeLists.txt      Tue Sep 21 14:44:49 2021 +0000
@@ -0,0 +1,48 @@
+$NetBSD: patch-src_CMakeLists.txt,v 1.1 2021/09/21 14:44:49 ryoon Exp $
+
+* If /usr/include/sys/timerfd.h exists, do not install timerfd.h.
+
+--- src/CMakeLists.txt.orig    2021-04-18 19:28:52.000000000 +0000
++++ src/CMakeLists.txt
+@@ -31,6 +31,7 @@ endmacro()
+ include(CheckSymbolExists)
+ # FreeBSD 13 supports native eventfd descriptors. Prefer them if available.
+ check_symbol_exists(eventfd "sys/eventfd.h" HAVE_EVENTFD)
++check_symbol_exists(timerfd_create "sys/timerfd.h" HAVE_TIMERFD)
+ check_symbol_exists(kqueue1 "sys/event.h" HAVE_KQUEUE1)
+ add_compat_target(kqueue1 "NOT;HAVE_KQUEUE1")
+ check_symbol_exists(sigandset "signal.h" HAVE_SIGANDSET)
+@@ -65,7 +66,6 @@ add_library(
+   epoll.c
+   epollfd_ctx.c
+   kqueue_event.c
+-  timerfd.c
+   timerfd_ctx.c
+   signalfd.c
+   signalfd_ctx.c
+@@ -73,6 +73,9 @@ add_library(
+ if(NOT HAVE_EVENTFD)
+   target_sources(epoll-shim PRIVATE eventfd.c eventfd_ctx.c)
+ endif()
++if(NOT HAVE_TIMERFD)
++  target_sources(epoll-shim PRIVATE timerfd.c)
++endif()
+ include(GenerateExportHeader)
+ generate_export_header(epoll-shim BASE_NAME epoll_shim)
+ target_link_libraries(
+@@ -91,11 +94,13 @@ set(_headers
+     "epoll-shim/detail/read.h"
+     "epoll-shim/detail/write.h"
+     "sys/epoll.h"
+-    "sys/signalfd.h"
+-    "sys/timerfd.h")
++    "sys/signalfd.h")
+ if(NOT HAVE_EVENTFD)
+   list(APPEND _headers "sys/eventfd.h")
+ endif()
++if(NOT HAVE_TIMERFD)
++  list(APPEND _headers "sys/timerfd.h")
++endif()
+ foreach(_header IN LISTS _headers)
+   configure_file("${PROJECT_SOURCE_DIR}/include/${_header}"
+                  "${PROJECT_BINARY_DIR}/install-include/${_header}" COPYONLY)



Home | Main Index | Thread Index | Old Index