Ravenports generated: 17 Sep 2022 15:25
[ravenports.git] / bucket_AF / libevdev
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               libevdev
4 VERSION=                1.12.1
5 KEYWORDS=               devel
6 VARIANTS=               standard
7 SDESC[standard]=        Wrapper library for evdev devices
8 HOMEPAGE=               https://www.freedesktop.org/wiki/Software/libevdev/
9 CONTACT=                nobody
10
11 DOWNLOAD_GROUPS=        main
12 SITES[main]=            https://www.freedesktop.org/software/libevdev/
13 DISTFILE[1]=            libevdev-1.12.1.tar.xz:main
14 DF_INDEX=               1
15 SPKGS[standard]=        single
16
17 OPTIONS_AVAILABLE=      none
18 OPTIONS_STANDARD=       none
19
20 BUILD_DEPENDS=          evdev-proto:single:standard
21
22 USES=                   meson pkgconfig python:build
23
24 LICENSE=                MIT:single
25 LICENSE_FILE=           MIT:{{WRKSRC}}/COPYING
26 LICENSE_SCHEME=         solo
27
28 FPC_EQUIVALENT=         devel/libevdev
29 MESON_ARGS=             -Ddocumentation=disabled
30                         -Dtests=disabled
31
32 SOVERSION=              2.3.0
33
34 CFLAGS=                 -Wno-incompatible-pointer-types
35                         -Wno-unused-function
36                         -Wno-format-truncation
37
38 pre-configure:
39         ${CP} ${LOCALBASE}/include/linux/*.h ${WRKSRC}/include/linux/
40
41 post-extract:
42         (cd ${WRKSRC}/include && ${MV} linux stock)
43         ${MKDIR} ${WRKSRC}/include/linux
44
45 [FILE:328:descriptions/desc.single]
46 libevdev is a wrapper library for evdev devices. It moves the common
47 tasks when dealing with evdev devices into a library and provides a
48 library interface to the callers, thus avoiding erroneous ioctls, etc.
49
50 The eventual goal is that libevdev wraps all ioctls available to evdev
51 devices, thus making direct access unnecessary.
52
53
54 [FILE:101:distinfo]
55 1dbba41bc516d3ca7abc0da5b862efe3ea8a7018fa6e9b97ce9d39401b22426c       446476 libevdev-1.12.1.tar.xz
56
57
58 [FILE:328:manifests/plist.single]
59 bin/
60  libevdev-tweak-device
61  mouse-dpi-tool
62  touchpad-edge-detector
63 include/libevdev-1.0/libevdev/
64  libevdev-uinput.h
65  libevdev.h
66 lib/
67  libevdev.so
68  libevdev.so.%%SOMAJOR%%
69  libevdev.so.%%SOVERSION%%
70 lib/pkgconfig/libevdev.pc
71 share/man/man1/
72  libevdev-tweak-device.1.gz
73  touchpad-edge-detector.1.gz
74 share/man/man3/libevdev.3.gz
75
76
77 [FILE:825:patches/patch-meson.build]
78 --- meson.build.orig    2022-03-25 04:33:26 UTC
79 +++ meson.build
80 @@ -39,9 +39,9 @@ pkgconfig = import('pkgconfig')
81  dep_lm = cc.find_library('m')
82  dep_rt = cc.find_library('rt')
83  
84 -input_h = join_paths(meson.source_root(), 'include', 'linux', host_machine.system(), 'input.h')
85 -uinput_h = join_paths(meson.source_root(), 'include', 'linux', host_machine.system(), 'uinput.h')
86 -input_event_codes_h = join_paths(meson.source_root(), 'include', 'linux', host_machine.system(), 'input-event-codes.h')
87 +input_h = join_paths(meson.source_root(), 'include', 'linux', 'input.h')
88 +uinput_h = join_paths(meson.source_root(), 'include', 'linux', 'uinput.h')
89 +input_event_codes_h = join_paths(meson.source_root(), 'include', 'linux', 'input-event-codes.h')
90  
91  # event-names.h
92  make_event_names = find_program('libevdev/make-event-names.py')
93
94
95 [FILE:2605:patches/patch-tools_mouse-dpi-tool.c]
96 --- tools/mouse-dpi-tool.c.orig 2022-03-25 04:33:26 UTC
97 +++ tools/mouse-dpi-tool.c
98 @@ -5,6 +5,11 @@
99  
100  #include "config.h"
101  
102 +#if defined(__DragonFly__)
103 +#include <sys/types.h>
104 +#include <sys/event.h>
105 +#include <sys/time.h>
106 +#endif
107  #include <errno.h>
108  #include <fcntl.h>
109  #include <libgen.h>
110 @@ -130,6 +135,88 @@ signal_handler(__attribute__((__unused__
111         signalled++;
112  }
113  
114 +#if defined(__DragonFly__)
115 +static int
116 +mainloop(struct libevdev *dev, struct dimensions *dim) {
117 +       int kq, nev;
118 +       struct kevent change[2];
119 +       struct kevent events[2];
120 +       int libevdev_fd;
121 +       struct sigaction sa;
122 +
123 +       memset(&sa, 0, sizeof(struct sigaction));
124 +       sa.sa_handler = SIG_IGN;
125 +       sigaction(SIGINT, &sa, NULL);
126 +
127 +       kq = kqueue();
128 +       if (kq == -1) {
129 +               fprintf(stderr, "Error initializing kqueue: %s\n",
130 +                       strerror(errno));
131 +               return (EXIT_FAILURE);
132 +       }
133 +
134 +       libevdev_fd = libevdev_get_fd(dev);
135 +       EV_SET(&change[0], libevdev_fd, EVFILT_READ, EV_ADD | EV_ENABLE, 0, 0,
136 +              NULL);
137 +       EV_SET(&change[1], SIGINT, EVFILT_SIGNAL, EV_ADD | EV_ENABLE, 0, 0,
138 +              NULL);
139 +
140 +       if (kevent(kq, change, 2, NULL, 0, NULL) == -1) {
141 +               fprintf(stderr, "Error adding events: %s\n", strerror(errno));
142 +               close(kq);
143 +               return (EXIT_FAILURE);
144 +       }
145 +
146 +       for (;;) {
147 +               struct input_event ev;
148 +               int rc;
149 +
150 +               nev = kevent(kq, NULL, 0, events, 2, NULL);
151 +
152 +               if (nev == 0) {
153 +                       break;
154 +               } else if (nev == -1) {
155 +                       if (errno == EINTR) {
156 +                               continue;
157 +                       } else {
158 +                               fprintf(stderr, "Error from kqueue: %s\n",
159 +                                   strerror(errno));
160 +                               return (EXIT_FAILURE);
161 +                       }
162 +               } else if (nev > 0) {
163 +                       for (int i = 0; i < nev; i++) {
164 +                               if ((events[i].filter == EVFILT_SIGNAL) &&
165 +                                   (events[i].data > 0)) {
166 +                                   goto out;
167 +                               }
168 +                       }
169 +               }
170 +
171 +               /* now let's find read events */
172 +               if (nev > 0) {
173 +                       for (int i = 0; i < nev; i++) {
174 +                               if (events[i].filter == EVFILT_READ) {
175 +                                       do {
176 +                                               rc = libevdev_next_event(dev, LIBEVDEV_READ_FLAG_NORMAL, &ev);
177 +                                               if (rc == LIBEVDEV_READ_STATUS_SYNC) {
178 +                                                       fprintf(stderr, "Error: cannot keep up\n");
179 +                                                       return 1;
180 +                                               } else if (rc != -EAGAIN && rc < 0) {
181 +                                                       fprintf(stderr, "Error: %s\n", strerror(-rc));
182 +                                                       return 1;
183 +                                               } else if (rc == LIBEVDEV_READ_STATUS_SUCCESS) {
184 +                                                       handle_event(dim, &ev);
185 +                                               }
186 +                                       } while (rc != -EAGAIN);
187 +                               }
188 +                       }
189 +               }
190 +       }
191 +
192 +out:
193 +       return 0;
194 +}
195 +#else  /* Linux */
196  static int
197  mainloop(struct libevdev *dev, struct measurements *m) {
198         struct pollfd fds;
199 @@ -165,6 +252,7 @@ mainloop(struct libevdev *dev, struct me
200  
201         return 0;
202  }
203 +#endif
204  
205  static inline double
206  mean_frequency(struct measurements *m)
207
208
209 [FILE:2641:patches/patch-tools_touchpad-edge-detector.c]
210 --- tools/touchpad-edge-detector.c.orig 2022-03-25 04:33:26 UTC
211 +++ tools/touchpad-edge-detector.c
212 @@ -5,6 +5,11 @@
213  
214  #include "config.h"
215  
216 +#if defined(__DragonFly__)
217 +#include <sys/types.h>
218 +#include <sys/event.h>
219 +#include <sys/time.h>
220 +#endif
221  #include <errno.h>
222  #include <fcntl.h>
223  #include <libgen.h>
224 @@ -93,6 +98,88 @@ signal_handler(__attribute__((__unused__
225         signalled++;
226  }
227  
228 +#if defined(__DragonFly__)
229 +static int
230 +mainloop(struct libevdev *dev, struct dimensions *dim) {
231 +       int kq, nev;
232 +       struct kevent change[2];
233 +       struct kevent events[2];
234 +       int libevdev_fd;
235 +       struct sigaction sa;
236 +
237 +       memset(&sa, 0, sizeof(struct sigaction));
238 +       sa.sa_handler = SIG_IGN;
239 +       sigaction(SIGINT, &sa, NULL);
240 +
241 +       kq = kqueue();
242 +       if (kq == -1) {
243 +               fprintf(stderr, "Error initializing kqueue: %s\n",
244 +                       strerror(errno));
245 +               return (EXIT_FAILURE);
246 +       }
247 +
248 +       libevdev_fd = libevdev_get_fd(dev);
249 +       EV_SET(&change[0], libevdev_fd, EVFILT_READ, EV_ADD | EV_ENABLE, 0, 0,
250 +              NULL);
251 +       EV_SET(&change[1], SIGINT, EVFILT_SIGNAL, EV_ADD | EV_ENABLE, 0, 0,
252 +              NULL);
253 +
254 +       if (kevent(kq, change, 2, NULL, 0, NULL) == -1) {
255 +               fprintf(stderr, "Error adding events: %s\n", strerror(errno));
256 +               close(kq);
257 +               return (EXIT_FAILURE);
258 +       }
259 +
260 +       for (;;) {
261 +               struct input_event ev;
262 +               int rc;
263 +
264 +               nev = kevent(kq, NULL, 0, events, 2, NULL);
265 +
266 +               if (nev == 0) {
267 +                       break;
268 +               } else if (nev == -1) {
269 +                       if (errno == EINTR) {
270 +                               continue;
271 +                       } else {
272 +                               fprintf(stderr, "Error from kqueue: %s\n",
273 +                                   strerror(errno));
274 +                               return (EXIT_FAILURE);
275 +                       }
276 +               } else if (nev > 0) {
277 +                       for (int i = 0; i < nev; i++) {
278 +                               if ((events[i].filter == EVFILT_SIGNAL) &&
279 +                                   (events[i].data > 0)) {
280 +                                   goto out;
281 +                               }
282 +                       }
283 +               }
284 +
285 +               /* now let's find read events */
286 +               if (nev > 0) {
287 +                       for (int i = 0; i < nev; i++) {
288 +                               if (events[i].filter == EVFILT_READ) {
289 +                                       do {
290 +                                               rc = libevdev_next_event(dev, LIBEVDEV_READ_FLAG_NORMAL, &ev);
291 +                                               if (rc == LIBEVDEV_READ_STATUS_SYNC) {
292 +                                                       fprintf(stderr, "Error: cannot keep up\n");
293 +                                                       return 1;
294 +                                               } else if (rc != -EAGAIN && rc < 0) {
295 +                                                       fprintf(stderr, "Error: %s\n", strerror(-rc));
296 +                                                       return 1;
297 +                                               } else if (rc == LIBEVDEV_READ_STATUS_SUCCESS) {
298 +                                                       handle_event(dim, &ev);
299 +                                               }
300 +                                       } while (rc != -EAGAIN);
301 +                               }
302 +                       }
303 +               }
304 +       }
305 +
306 +out:
307 +       return 0;
308 +}
309 +#else  /* Linux */
310  static int
311  mainloop(struct libevdev *dev, struct dimensions *dim) {
312         struct pollfd fds;
313 @@ -129,6 +216,7 @@ mainloop(struct libevdev *dev, struct di
314  
315         return 0;
316  }
317 +#endif
318  
319  static inline void
320  pid_vid_matchstr(struct libevdev *dev, char *match, size_t sz)
321