Ravenports generated: 27 Oct 2023 17:09
[ravenports.git] / bucket_13 / xorg-xshmfence
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               xorg-xshmfence
4 VERSION=                1.3.2
5 REVISION=               2
6 KEYWORDS=               x11
7 VARIANTS=               standard
8 SDESC[standard]=        Shared memory SyncFence synchronization primitive
9 HOMEPAGE=               https://www.x.org/
10 CONTACT=                nobody
11
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
19 DF_INDEX=               1 2 3
20 SPKGS[standard]=        complete
21                         primary
22                         dev
23
24 OPTIONS_AVAILABLE=      none
25 OPTIONS_STANDARD=       none
26
27 USES=                   autoreconf libtool pkgconfig
28 XORG_COMPONENTS=        xorgproto
29
30 DISTNAME=               libxshmfence-1.3.2
31 EXTRACT_ONLY=           1
32
33 LICENSE=                HPND:primary
34 LICENSE_FILE=           HPND:{{WRKSRC}}/COPYING
35 LICENSE_SCHEME=         solo
36
37 FPC_EQUIVALENT=         x11/libxshmfence
38
39 MUST_CONFIGURE=         gnu
40 CONFIGURE_ARGS=         --with-shared-memory-dir=/tmp
41
42 INSTALL_TARGET=         install-strip
43
44 TEST_TARGET=            check
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
49
50 pre-configure:
51         # cd ${WRKSRC} && autoreconf -vif
52
53 post-extract-netbsd:
54         ${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/xshmfence_semaphore.[ch] \
55                 ${WRKSRC}/src
56
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.
61
62
63 [FILE:352:distinfo]
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
67
68
69 [FILE:47:manifests/plist.primary]
70 lib/
71  libxshmfence.so.1
72  libxshmfence.so.1.0.0
73
74
75 [FILE:89:manifests/plist.dev]
76 lib/pkgconfig/xshmfence.pc
77 include/X11/xshmfence.h
78 lib/
79  libxshmfence.a
80  libxshmfence.so
81
82
83 [FILE:259:patches/patch-config.h.in]
84 --- config.h.in.orig    2022-12-08 16:08:29 UTC
85 +++ config.h.in
86 @@ -25,6 +25,9 @@
87  /* Define to 1 if you have the `mkostemp' function. */
88  #undef HAVE_MKOSTEMP
89  
90 +/* Use mkostemp(3) */
91 +#undef HAVE_MKOSTEMP
92 +
93  /* Use pthread primitives */
94  #undef HAVE_PTHREAD
95  
96
97
98 [FILE:1473:patches/patch-configure.ac]
99 --- configure.ac.orig   2022-12-08 16:08:26 UTC
100 +++ configure.ac
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])
104  
105 +AC_ARG_ENABLE(semaphore,       AS_HELP_STRING([--enable-semaphore], [Enable POSIX named semaphores (default: no)]),
106 +               [SEMAPHORE=$enableval], [SEMAPHORE=no])
107 +
108  if test "x$FUTEX" = "xauto"; then
109         AC_CHECK_HEADER([linux/futex.h], [FUTEX=yes])
110  fi
111 @@ -70,23 +73,36 @@ if test "x$FUTEX" = "xauto"; then
112         fi
113  fi
114  
115 +if test "x$SEMAPHORE" = "xyes"; then
116 +       AC_CHECK_HEADER([semaphore.h], [], [AC_MSG_ERROR([No platform support for POSIX named semaphores])])
117 +fi
118 +
119  if test "x$FUTEX" = "xyes"; then
120         PTHREAD=no
121         AC_DEFINE(HAVE_FUTEX,1,[Use futexes])
122  else
123 -       PTHREAD=yes
124 -       AC_DEFINE(HAVE_PTHREAD,1,[Use pthread primitives])
125 +       if test "x$SEMAPHORE" = "xyes"; then
126 +               PTHREAD=no
127 +               AC_DEFINE(HAVE_SEMAPHORE,1,[Use semaphores])
128 +       else
129 +               PTHREAD=yes
130 +               AC_DEFINE(HAVE_PTHREAD,1,[Use pthread primitives])
131 +       fi
132  fi
133  
134  PTHREAD_LIBS=
135  if test "x$PTHREAD" = "xyes"; then
136         AC_CHECK_LIB(pthread,pthread_create,[PTHREAD_LIBS=-lpthread],[PTHREAD_LIBS=])
137  fi
138 +if test "x$SEMAPHORE" = "xyes"; then
139 +       AC_CHECK_LIB(rt,sem_open,[PTHREAD_LIBS=-lrt])
140 +fi
141  
142  AC_SUBST([PTHREAD_LIBS])
143  
144  AM_CONDITIONAL([FUTEX], [test x"$FUTEX" = xyes])
145  AM_CONDITIONAL([PTHREAD], [test x"$PTHREAD" = xyes])
146 +AM_CONDITIONAL([SEMAPHORE], [test x"$SEMAPHORE" = xyes])
147  
148  PKG_CHECK_MODULES(XPROTO, xproto)
149  
150
151
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 $
154
155 --- src/Makefile.am.orig        2022-12-08 16:08:26 UTC
156 +++ src/Makefile.am
157 @@ -4,6 +4,10 @@ if PTHREAD
158  PTHREAD_SOURCES=xshmfence_pthread.c xshmfence_pthread.h
159  endif
160  
161 +if SEMAPHORE
162 +SEMAPHORE_SOURCES=xshmfence_semaphore.c xshmfence_semaphore.h
163 +endif
164 +
165  if FUTEX
166  FUTEX_SOURCES=xshmfence_futex.c xshmfence_futex.h
167  endif
168 @@ -12,6 +16,7 @@ libxshmfence_la_SOURCES = \
169         xshmfenceint.h \
170         xshmfence_alloc.c \
171         $(PTHREAD_SOURCES) \
172 +       $(SEMAPHORE_SOURCES) \
173         $(FUTEX_SOURCES)
174  
175  AM_CFLAGS = $(CWARNFLAGS)
176
177
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
181 @@ -28,6 +28,7 @@
182  
183  #ifdef HAVE_UMTX
184  
185 +#include <sys/limits.h>
186  #include <sys/types.h>
187  #include <sys/umtx.h>
188  #include <limits.h>
189
190
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)
196  {
197         char    template[] = SHMDIR "/shmfd-XXXXXX";
198 -       int     fd;
199 +       int     fd = -1;
200  #ifndef HAVE_MKOSTEMP
201         int     flags;
202  #endif
203 @@ -130,6 +130,9 @@ xshmfence_map_shm(int fd)
204                 close (fd);
205                 return 0;
206         }
207 +#ifdef HAVE_SEMAPHORE
208 +       xshmfence_open_semaphore(addr);
209 +#endif
210         return addr;
211  }
212  
213 @@ -141,5 +144,8 @@ xshmfence_map_shm(int fd)
214  void
215  xshmfence_unmap_shm(struct xshmfence *f)
216  {
217 +#ifdef HAVE_SEMAPHORE
218 +       xshmfence_close_semaphore(f);
219 +#endif
220          munmap(f, sizeof (struct xshmfence));
221  }
222
223
224 [FILE:413:patches/patch-src_xshmfenceint.h]
225 --- src/xshmfenceint.h.orig     2022-12-08 16:08:26 UTC
226 +++ src/xshmfenceint.h
227 @@ -23,6 +23,7 @@
228  #ifndef _XSHMFENCEINT_H_
229  #define _XSHMFENCEINT_H_
230  
231 +#include <fcntl.h>
232  #include <stdlib.h>
233  #include <unistd.h>
234  #include <sys/mman.h>
235 @@ -32,6 +33,10 @@
236  #include "xshmfence_futex.h"
237  #endif
238  
239 +#if HAVE_SEMAPHORE
240 +#include "xshmfence_semaphore.h"
241 +#endif
242 +
243  #if HAVE_PTHREAD
244  #include "xshmfence_pthread.h"
245  #endif
246