# Buildsheet autogenerated by ravenadm tool -- Do not edit. NAMEBASE= xorg-xshmfence VERSION= 1.3.2 REVISION= 2 KEYWORDS= x11 VARIANTS= standard SDESC[standard]= Shared memory SyncFence synchronization primitive HOMEPAGE= https://www.x.org/ CONTACT= nobody DOWNLOAD_GROUPS= main pkgsrc SITES[main]= XORG/individual/lib SITES[pkgsrc]= https://raw.githubusercontent.com/NetBSD/pkgsrc/a620db1add3040d2b1437d2918793182f9ffa887/x11/libxshmfence/files/ DISTFILE[1]= libxshmfence-1.3.2.tar.xz:main DISTFILE[2]= xshmfence_semaphore.h:pkgsrc DISTFILE[3]= xshmfence_semaphore.c:pkgsrc DIST_SUBDIR= xorg-shmfence-2 DF_INDEX= 1 2 3 SPKGS[standard]= complete primary dev OPTIONS_AVAILABLE= none OPTIONS_STANDARD= none USES= autoreconf libtool pkgconfig XORG_COMPONENTS= xorgproto DISTNAME= libxshmfence-1.3.2 EXTRACT_ONLY= 1 LICENSE= HPND:primary LICENSE_FILE= HPND:{{WRKSRC}}/COPYING LICENSE_SCHEME= solo FPC_EQUIVALENT= x11/libxshmfence MUST_CONFIGURE= gnu CONFIGURE_ARGS= --with-shared-memory-dir=/tmp INSTALL_TARGET= install-strip TEST_TARGET= check VAR_OPSYS[linux]= CONFIGURE_ENV=ac_cv_func_mkostemp=no VAR_OPSYS[netbsd]= CONFIGURE_ARGS=--disable-futex CONFIGURE_ARGS=--enable-semaphore CPPFLAGS=-DLIBXSHM_PAGESIZE=4096 pre-configure: # cd ${WRKSRC} && autoreconf -vif post-extract-netbsd: ${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/xshmfence_semaphore.[ch] \ ${WRKSRC}/src [FILE:166:descriptions/desc.primary] This library offers a CPU-based synchronization primitive compatible with the X SyncFence objects that can be shared between processes using file descriptor passing. [FILE:352:distinfo] 870df257bc40b126d91b5a8f1da6ca8a524555268c50b59c0acd1a27f361606f 259024 xorg-shmfence-2/libxshmfence-1.3.2.tar.xz d81113ac925b908e7526d935c365f178cc803e6ab425f6e717783071b540a64c 2140 xorg-shmfence-2/xshmfence_semaphore.h 6741c12e2f0693f08b27b44de30c9b2782ebd1e85b90114c57b16dc2a7481d97 5453 xorg-shmfence-2/xshmfence_semaphore.c [FILE:47:manifests/plist.primary] lib/ libxshmfence.so.1 libxshmfence.so.1.0.0 [FILE:89:manifests/plist.dev] include/X11/xshmfence.h lib/ libxshmfence.a libxshmfence.so lib/pkgconfig/xshmfence.pc [FILE:259:patches/patch-config.h.in] --- config.h.in.orig 2022-12-08 16:08:29 UTC +++ config.h.in @@ -25,6 +25,9 @@ /* Define to 1 if you have the `mkostemp' function. */ #undef HAVE_MKOSTEMP +/* Use mkostemp(3) */ +#undef HAVE_MKOSTEMP + /* Use pthread primitives */ #undef HAVE_PTHREAD [FILE:1473:patches/patch-configure.ac] --- configure.ac.orig 2022-12-08 16:08:26 UTC +++ configure.ac @@ -57,6 +57,9 @@ dnl AC_ARG_ENABLE(futex, AS_HELP_STRING([--enable-futex], [Enable futexes (default: auto)]), [FUTEX=$enableval], [FUTEX=auto]) +AC_ARG_ENABLE(semaphore, AS_HELP_STRING([--enable-semaphore], [Enable POSIX named semaphores (default: no)]), + [SEMAPHORE=$enableval], [SEMAPHORE=no]) + if test "x$FUTEX" = "xauto"; then AC_CHECK_HEADER([linux/futex.h], [FUTEX=yes]) fi @@ -70,23 +73,36 @@ if test "x$FUTEX" = "xauto"; then fi fi +if test "x$SEMAPHORE" = "xyes"; then + AC_CHECK_HEADER([semaphore.h], [], [AC_MSG_ERROR([No platform support for POSIX named semaphores])]) +fi + if test "x$FUTEX" = "xyes"; then PTHREAD=no AC_DEFINE(HAVE_FUTEX,1,[Use futexes]) else - PTHREAD=yes - AC_DEFINE(HAVE_PTHREAD,1,[Use pthread primitives]) + if test "x$SEMAPHORE" = "xyes"; then + PTHREAD=no + AC_DEFINE(HAVE_SEMAPHORE,1,[Use semaphores]) + else + PTHREAD=yes + AC_DEFINE(HAVE_PTHREAD,1,[Use pthread primitives]) + fi fi PTHREAD_LIBS= if test "x$PTHREAD" = "xyes"; then AC_CHECK_LIB(pthread,pthread_create,[PTHREAD_LIBS=-lpthread],[PTHREAD_LIBS=]) fi +if test "x$SEMAPHORE" = "xyes"; then + AC_CHECK_LIB(rt,sem_open,[PTHREAD_LIBS=-lrt]) +fi AC_SUBST([PTHREAD_LIBS]) AM_CONDITIONAL([FUTEX], [test x"$FUTEX" = xyes]) AM_CONDITIONAL([PTHREAD], [test x"$PTHREAD" = xyes]) +AM_CONDITIONAL([SEMAPHORE], [test x"$SEMAPHORE" = xyes]) PKG_CHECK_MODULES(XPROTO, xproto) [FILE:568:patches/patch-src_Makefile.am] $NetBSD: patch-src_Makefile.am,v 1.1 2015/09/24 23:34:16 tnn Exp $ --- src/Makefile.am.orig 2022-12-08 16:08:26 UTC +++ src/Makefile.am @@ -4,6 +4,10 @@ if PTHREAD PTHREAD_SOURCES=xshmfence_pthread.c xshmfence_pthread.h endif +if SEMAPHORE +SEMAPHORE_SOURCES=xshmfence_semaphore.c xshmfence_semaphore.h +endif + if FUTEX FUTEX_SOURCES=xshmfence_futex.c xshmfence_futex.h endif @@ -12,6 +16,7 @@ libxshmfence_la_SOURCES = \ xshmfenceint.h \ xshmfence_alloc.c \ $(PTHREAD_SOURCES) \ + $(SEMAPHORE_SOURCES) \ $(FUTEX_SOURCES) AM_CFLAGS = $(CWARNFLAGS) [FILE:214:patches/patch-src__xshmfence_futex.h] --- src/xshmfence_futex.h.orig 2022-12-08 16:08:26 UTC +++ src/xshmfence_futex.h @@ -28,6 +28,7 @@ #ifdef HAVE_UMTX +#include #include #include #include [FILE:619:patches/patch-src_xshmfence__alloc.c] --- src/xshmfence_alloc.c.orig 2022-12-08 16:08:26 UTC +++ src/xshmfence_alloc.c @@ -69,7 +69,7 @@ int xshmfence_alloc_shm(void) { char template[] = SHMDIR "/shmfd-XXXXXX"; - int fd; + int fd = -1; #ifndef HAVE_MKOSTEMP int flags; #endif @@ -130,6 +130,9 @@ xshmfence_map_shm(int fd) close (fd); return 0; } +#ifdef HAVE_SEMAPHORE + xshmfence_open_semaphore(addr); +#endif return addr; } @@ -141,5 +144,8 @@ xshmfence_map_shm(int fd) void xshmfence_unmap_shm(struct xshmfence *f) { +#ifdef HAVE_SEMAPHORE + xshmfence_close_semaphore(f); +#endif munmap(f, sizeof (struct xshmfence)); } [FILE:413:patches/patch-src_xshmfenceint.h] --- src/xshmfenceint.h.orig 2022-12-08 16:08:26 UTC +++ src/xshmfenceint.h @@ -23,6 +23,7 @@ #ifndef _XSHMFENCEINT_H_ #define _XSHMFENCEINT_H_ +#include #include #include #include @@ -32,6 +33,10 @@ #include "xshmfence_futex.h" #endif +#if HAVE_SEMAPHORE +#include "xshmfence_semaphore.h" +#endif + #if HAVE_PTHREAD #include "xshmfence_pthread.h" #endif