1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
7 SDESC[standard]= Wrapper library for evdev devices
8 HOMEPAGE= https://www.freedesktop.org/wiki/Software/libevdev/
12 SITES[main]= https://www.freedesktop.org/software/libevdev/
13 DISTFILE[1]= libevdev-1.12.1.tar.xz:main
15 SPKGS[standard]= single
17 OPTIONS_AVAILABLE= none
18 OPTIONS_STANDARD= none
20 BUILD_DEPENDS= evdev-proto:single:standard
22 USES= meson pkgconfig python:build
25 LICENSE_FILE= MIT:{{WRKSRC}}/COPYING
28 FPC_EQUIVALENT= devel/libevdev
29 MESON_ARGS= -Ddocumentation=disabled
34 CFLAGS= -Wno-incompatible-pointer-types
36 -Wno-format-truncation
39 ${CP} ${LOCALBASE}/include/linux/*.h ${WRKSRC}/include/linux/
42 (cd ${WRKSRC}/include && ${MV} linux stock)
43 ${MKDIR} ${WRKSRC}/include/linux
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.
50 The eventual goal is that libevdev wraps all ioctls available to evdev
51 devices, thus making direct access unnecessary.
55 1dbba41bc516d3ca7abc0da5b862efe3ea8a7018fa6e9b97ce9d39401b22426c 446476 libevdev-1.12.1.tar.xz
58 [FILE:328:manifests/plist.single]
62 touchpad-edge-detector
63 include/libevdev-1.0/libevdev/
68 libevdev.so.%%SOMAJOR%%
69 libevdev.so.%%SOVERSION%%
70 lib/pkgconfig/libevdev.pc
72 libevdev-tweak-device.1.gz
73 touchpad-edge-detector.1.gz
74 share/man/man3/libevdev.3.gz
77 [FILE:825:patches/patch-meson.build]
78 --- meson.build.orig 2022-03-25 04:33:26 UTC
80 @@ -39,9 +39,9 @@ pkgconfig = import('pkgconfig')
81 dep_lm = cc.find_library('m')
82 dep_rt = cc.find_library('rt')
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')
92 make_event_names = find_program('libevdev/make-event-names.py')
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
102 +#if defined(__DragonFly__)
103 +#include <sys/types.h>
104 +#include <sys/event.h>
105 +#include <sys/time.h>
110 @@ -130,6 +135,88 @@ signal_handler(__attribute__((__unused__
114 +#if defined(__DragonFly__)
116 +mainloop(struct libevdev *dev, struct dimensions *dim) {
118 + struct kevent change[2];
119 + struct kevent events[2];
121 + struct sigaction sa;
123 + memset(&sa, 0, sizeof(struct sigaction));
124 + sa.sa_handler = SIG_IGN;
125 + sigaction(SIGINT, &sa, NULL);
129 + fprintf(stderr, "Error initializing kqueue: %s\n",
131 + return (EXIT_FAILURE);
134 + libevdev_fd = libevdev_get_fd(dev);
135 + EV_SET(&change[0], libevdev_fd, EVFILT_READ, EV_ADD | EV_ENABLE, 0, 0,
137 + EV_SET(&change[1], SIGINT, EVFILT_SIGNAL, EV_ADD | EV_ENABLE, 0, 0,
140 + if (kevent(kq, change, 2, NULL, 0, NULL) == -1) {
141 + fprintf(stderr, "Error adding events: %s\n", strerror(errno));
143 + return (EXIT_FAILURE);
147 + struct input_event ev;
150 + nev = kevent(kq, NULL, 0, events, 2, NULL);
154 + } else if (nev == -1) {
155 + if (errno == EINTR) {
158 + fprintf(stderr, "Error from kqueue: %s\n",
160 + return (EXIT_FAILURE);
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)) {
171 + /* now let's find read events */
173 + for (int i = 0; i < nev; i++) {
174 + if (events[i].filter == EVFILT_READ) {
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");
180 + } else if (rc != -EAGAIN && rc < 0) {
181 + fprintf(stderr, "Error: %s\n", strerror(-rc));
183 + } else if (rc == LIBEVDEV_READ_STATUS_SUCCESS) {
184 + handle_event(dim, &ev);
186 + } while (rc != -EAGAIN);
197 mainloop(struct libevdev *dev, struct measurements *m) {
199 @@ -165,6 +252,7 @@ mainloop(struct libevdev *dev, struct me
206 mean_frequency(struct measurements *m)
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
216 +#if defined(__DragonFly__)
217 +#include <sys/types.h>
218 +#include <sys/event.h>
219 +#include <sys/time.h>
224 @@ -93,6 +98,88 @@ signal_handler(__attribute__((__unused__
228 +#if defined(__DragonFly__)
230 +mainloop(struct libevdev *dev, struct dimensions *dim) {
232 + struct kevent change[2];
233 + struct kevent events[2];
235 + struct sigaction sa;
237 + memset(&sa, 0, sizeof(struct sigaction));
238 + sa.sa_handler = SIG_IGN;
239 + sigaction(SIGINT, &sa, NULL);
243 + fprintf(stderr, "Error initializing kqueue: %s\n",
245 + return (EXIT_FAILURE);
248 + libevdev_fd = libevdev_get_fd(dev);
249 + EV_SET(&change[0], libevdev_fd, EVFILT_READ, EV_ADD | EV_ENABLE, 0, 0,
251 + EV_SET(&change[1], SIGINT, EVFILT_SIGNAL, EV_ADD | EV_ENABLE, 0, 0,
254 + if (kevent(kq, change, 2, NULL, 0, NULL) == -1) {
255 + fprintf(stderr, "Error adding events: %s\n", strerror(errno));
257 + return (EXIT_FAILURE);
261 + struct input_event ev;
264 + nev = kevent(kq, NULL, 0, events, 2, NULL);
268 + } else if (nev == -1) {
269 + if (errno == EINTR) {
272 + fprintf(stderr, "Error from kqueue: %s\n",
274 + return (EXIT_FAILURE);
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)) {
285 + /* now let's find read events */
287 + for (int i = 0; i < nev; i++) {
288 + if (events[i].filter == EVFILT_READ) {
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");
294 + } else if (rc != -EAGAIN && rc < 0) {
295 + fprintf(stderr, "Error: %s\n", strerror(-rc));
297 + } else if (rc == LIBEVDEV_READ_STATUS_SUCCESS) {
298 + handle_event(dim, &ev);
300 + } while (rc != -EAGAIN);
311 mainloop(struct libevdev *dev, struct dimensions *dim) {
313 @@ -129,6 +216,7 @@ mainloop(struct libevdev *dev, struct di
320 pid_vid_matchstr(struct libevdev *dev, char *match, size_t sz)