1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
3 NAMEBASE= xorg-xshmfence
8 SDESC[standard]= Shared memory SyncFence synchronization primitive
9 HOMEPAGE= https://www.x.org/
12 DOWNLOAD_GROUPS= main pkgsrc
13 SITES[main]= XORG/individual/lib
14 SITES[pkgsrc]= https://raw.githubusercontent.com/NetBSD/pkgsrc/a620db1add3040d2b1437d2918793182f9ffa887/x11/libxshmfence/files/
15 DISTFILE[1]= libxshmfence-1.3.2.tar.xz:main
16 DISTFILE[2]= xshmfence_semaphore.h:pkgsrc
17 DISTFILE[3]= xshmfence_semaphore.c:pkgsrc
18 DIST_SUBDIR= xorg-shmfence-2
20 SPKGS[standard]= complete
24 OPTIONS_AVAILABLE= none
25 OPTIONS_STANDARD= none
27 USES= autoreconf libtool pkgconfig
28 XORG_COMPONENTS= xorgproto
30 DISTNAME= libxshmfence-1.3.2
34 LICENSE_FILE= HPND:{{WRKSRC}}/COPYING
37 FPC_EQUIVALENT= x11/libxshmfence
40 CONFIGURE_ARGS= --with-shared-memory-dir=/tmp
42 INSTALL_TARGET= install-strip
45 VAR_OPSYS[linux]= CONFIGURE_ENV=ac_cv_func_mkostemp=no
46 VAR_OPSYS[netbsd]= CONFIGURE_ARGS=--disable-futex
47 CONFIGURE_ARGS=--enable-semaphore
48 CPPFLAGS=-DLIBXSHM_PAGESIZE=4096
51 # cd ${WRKSRC} && autoreconf -vif
54 ${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/xshmfence_semaphore.[ch] \
57 [FILE:166:descriptions/desc.primary]
58 This library offers a CPU-based synchronization primitive compatible
59 with the X SyncFence objects that can be shared between processes
60 using file descriptor passing.
64 870df257bc40b126d91b5a8f1da6ca8a524555268c50b59c0acd1a27f361606f 259024 xorg-shmfence-2/libxshmfence-1.3.2.tar.xz
65 d81113ac925b908e7526d935c365f178cc803e6ab425f6e717783071b540a64c 2140 xorg-shmfence-2/xshmfence_semaphore.h
66 6741c12e2f0693f08b27b44de30c9b2782ebd1e85b90114c57b16dc2a7481d97 5453 xorg-shmfence-2/xshmfence_semaphore.c
69 [FILE:47:manifests/plist.primary]
75 [FILE:89:manifests/plist.dev]
76 lib/pkgconfig/xshmfence.pc
77 include/X11/xshmfence.h
83 [FILE:259:patches/patch-config.h.in]
84 --- config.h.in.orig 2022-12-08 16:08:29 UTC
87 /* Define to 1 if you have the `mkostemp' function. */
90 +/* Use mkostemp(3) */
93 /* Use pthread primitives */
98 [FILE:1473:patches/patch-configure.ac]
99 --- configure.ac.orig 2022-12-08 16:08:26 UTC
101 @@ -57,6 +57,9 @@ dnl
102 AC_ARG_ENABLE(futex, AS_HELP_STRING([--enable-futex], [Enable futexes (default: auto)]),
103 [FUTEX=$enableval], [FUTEX=auto])
105 +AC_ARG_ENABLE(semaphore, AS_HELP_STRING([--enable-semaphore], [Enable POSIX named semaphores (default: no)]),
106 + [SEMAPHORE=$enableval], [SEMAPHORE=no])
108 if test "x$FUTEX" = "xauto"; then
109 AC_CHECK_HEADER([linux/futex.h], [FUTEX=yes])
111 @@ -70,23 +73,36 @@ if test "x$FUTEX" = "xauto"; then
115 +if test "x$SEMAPHORE" = "xyes"; then
116 + AC_CHECK_HEADER([semaphore.h], [], [AC_MSG_ERROR([No platform support for POSIX named semaphores])])
119 if test "x$FUTEX" = "xyes"; then
121 AC_DEFINE(HAVE_FUTEX,1,[Use futexes])
124 - AC_DEFINE(HAVE_PTHREAD,1,[Use pthread primitives])
125 + if test "x$SEMAPHORE" = "xyes"; then
127 + AC_DEFINE(HAVE_SEMAPHORE,1,[Use semaphores])
130 + AC_DEFINE(HAVE_PTHREAD,1,[Use pthread primitives])
135 if test "x$PTHREAD" = "xyes"; then
136 AC_CHECK_LIB(pthread,pthread_create,[PTHREAD_LIBS=-lpthread],[PTHREAD_LIBS=])
138 +if test "x$SEMAPHORE" = "xyes"; then
139 + AC_CHECK_LIB(rt,sem_open,[PTHREAD_LIBS=-lrt])
142 AC_SUBST([PTHREAD_LIBS])
144 AM_CONDITIONAL([FUTEX], [test x"$FUTEX" = xyes])
145 AM_CONDITIONAL([PTHREAD], [test x"$PTHREAD" = xyes])
146 +AM_CONDITIONAL([SEMAPHORE], [test x"$SEMAPHORE" = xyes])
148 PKG_CHECK_MODULES(XPROTO, xproto)
152 [FILE:568:patches/patch-src_Makefile.am]
153 $NetBSD: patch-src_Makefile.am,v 1.1 2015/09/24 23:34:16 tnn Exp $
155 --- src/Makefile.am.orig 2022-12-08 16:08:26 UTC
157 @@ -4,6 +4,10 @@ if PTHREAD
158 PTHREAD_SOURCES=xshmfence_pthread.c xshmfence_pthread.h
162 +SEMAPHORE_SOURCES=xshmfence_semaphore.c xshmfence_semaphore.h
166 FUTEX_SOURCES=xshmfence_futex.c xshmfence_futex.h
168 @@ -12,6 +16,7 @@ libxshmfence_la_SOURCES = \
172 + $(SEMAPHORE_SOURCES) \
175 AM_CFLAGS = $(CWARNFLAGS)
178 [FILE:214:patches/patch-src__xshmfence_futex.h]
179 --- src/xshmfence_futex.h.orig 2022-12-08 16:08:26 UTC
180 +++ src/xshmfence_futex.h
185 +#include <sys/limits.h>
186 #include <sys/types.h>
187 #include <sys/umtx.h>
191 [FILE:619:patches/patch-src_xshmfence__alloc.c]
192 --- src/xshmfence_alloc.c.orig 2022-12-08 16:08:26 UTC
193 +++ src/xshmfence_alloc.c
194 @@ -69,7 +69,7 @@ int
195 xshmfence_alloc_shm(void)
197 char template[] = SHMDIR "/shmfd-XXXXXX";
200 #ifndef HAVE_MKOSTEMP
203 @@ -130,6 +130,9 @@ xshmfence_map_shm(int fd)
207 +#ifdef HAVE_SEMAPHORE
208 + xshmfence_open_semaphore(addr);
213 @@ -141,5 +144,8 @@ xshmfence_map_shm(int fd)
215 xshmfence_unmap_shm(struct xshmfence *f)
217 +#ifdef HAVE_SEMAPHORE
218 + xshmfence_close_semaphore(f);
220 munmap(f, sizeof (struct xshmfence));
224 [FILE:413:patches/patch-src_xshmfenceint.h]
225 --- src/xshmfenceint.h.orig 2022-12-08 16:08:26 UTC
226 +++ src/xshmfenceint.h
228 #ifndef _XSHMFENCEINT_H_
229 #define _XSHMFENCEINT_H_
234 #include <sys/mman.h>
236 #include "xshmfence_futex.h"
240 +#include "xshmfence_semaphore.h"
244 #include "xshmfence_pthread.h"