From c29ab0a9c94db62b2ffc2505e680188fb2a2e2f9 Mon Sep 17 00:00:00 2001 From: Vladimir Kondratyev Date: Wed, 9 Aug 2017 21:00:12 +0000 Subject: [PATCH] New port: devel/evemu Tools and bindings for kernel input event device emulation and data capture and replay. Evemu provides a programmatic API to access the kernel input event devices. The original and intended purpose is for supporting multi-touch input, especially with regard to the Ubuntu touch and gesture stack. WWW: http://www.freedesktop.org/wiki/Evemu PR: 218383 Approved by: bapt (mentor) --- devel/Makefile | 1 + devel/evemu/Makefile | 55 ++++++++++++++++++++ devel/evemu/distinfo | 3 ++ devel/evemu/files/patch-src_evemu.c | 21 ++++++++ devel/evemu/files/patch-tools_evemu-record.c | 12 +++++ devel/evemu/pkg-descr | 8 +++ devel/evemu/pkg-plist | 28 ++++++++++ 7 files changed, 128 insertions(+) create mode 100644 devel/evemu/Makefile create mode 100644 devel/evemu/distinfo create mode 100644 devel/evemu/files/patch-src_evemu.c create mode 100644 devel/evemu/files/patch-tools_evemu-record.c create mode 100644 devel/evemu/pkg-descr create mode 100644 devel/evemu/pkg-plist diff --git a/devel/Makefile b/devel/Makefile index 6205b38aa21d..29d0079772f7 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -585,6 +585,7 @@ SUBDIR += etcd32 SUBDIR += etl SUBDIR += euca2ools + SUBDIR += evemu SUBDIR += eventxx SUBDIR += evolution-gconf-tools SUBDIR += exercisix diff --git a/devel/evemu/Makefile b/devel/evemu/Makefile new file mode 100644 index 000000000000..c7df0a91c1a4 --- /dev/null +++ b/devel/evemu/Makefile @@ -0,0 +1,55 @@ +# Created by: Vladimir Kondratyev +# $FreeBSD$ + +PORTNAME= evemu +PORTVERSION= 2.6.0 +CATEGORIES= devel +MASTER_SITES= http://www.freedesktop.org/software/${PORTNAME}/ + +MAINTAINER= wulf@FreeBSD.org +COMMENT= Records and replays EVDEV descriptions and events + +LICENSE= GPLv3 + +BUILD_DEPENDS= v4l_compat>=0:multimedia/v4l_compat +LIB_DEPENDS= libevdev.so:devel/libevdev + +USES= tar:xz python:2,build pathfix libtool pkgconfig localbase + +OPTIONS_DEFINE= MANPAGES PYTHON +OPTIONS_DEFAULT=MANPAGES +OPTIONS_SUB= yes + +MANPAGES_BUILD_DEPENDS= minixmlto:textproc/minixmlto \ + asciidoc:textproc/asciidoc +MANPAGES_CONFIGURE_ENV= XMLTO=${LOCALBASE}/bin/minixmlto +MANPAGES_CONFIGURE_ENV_OFF= ac_cv_path_XMLTO="" \ + ac_cv_path_ASCIIDOC="" +PYTHON_RUN_DEPENDS= ${PYTHON_CMD}:${PYTHON_PORTSDIR} +PYTHON_CONFIGURE_ENABLE= python-bindings + +GNU_CONFIGURE= yes +CFLAGS+= -D_WITH_DPRINTF -include stdlib.h +USE_LDCONFIG= yes +INSTALL_TARGET= install-strip +REINPLACE_ARGS= -i '' + +TEST_TARGET= check +TEST_WRKSRC= ${WRKSRC}/test + +post-patch: + ${REINPLACE_CMD} -e 's|program_invocation_short_name|getprogname()|' \ + ${WRKSRC}/tools/evemu-event.c ${WRKSRC}/tools/evemu-play.c \ + ${WRKSRC}/tools/evemu-record.c + ${REINPLACE_CMD} -e 's|versionsort|alphasort|' \ + ${WRKSRC}/tools/find_event_devices.c + +# Fix evemu-event.1, evemu-play.1 and evemu-record.1 manpages which are broken +# due to docbook-xsl bug: https://sourceforge.net/p/docbook/bugs/1058/ +post-install-MANPAGES-on: +.for manpage in evemu-event.1 evemu-play.1 evemu-record.1 + @${REINPLACE_CMD} -e 's|^\.so evemu|.so man1/evemu|' \ + ${STAGEDIR}${MANPREFIX}/man/man1/${manpage} +.endfor + +.include diff --git a/devel/evemu/distinfo b/devel/evemu/distinfo new file mode 100644 index 000000000000..d7e7f883c48d --- /dev/null +++ b/devel/evemu/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1491102615 +SHA256 (evemu-2.6.0.tar.xz) = ed81dd4552ffeb92c346b47e56b249c67f1cb37d5b31fc073ea0ad4858ae3dcc +SIZE (evemu-2.6.0.tar.xz) = 507032 diff --git a/devel/evemu/files/patch-src_evemu.c b/devel/evemu/files/patch-src_evemu.c new file mode 100644 index 000000000000..f903363cfb9f --- /dev/null +++ b/devel/evemu/files/patch-src_evemu.c @@ -0,0 +1,21 @@ +--- src/evemu.c.orig 2016-11-08 09:43:24 UTC ++++ src/evemu.c +@@ -456,16 +456,13 @@ int evemu_write(const struct evemu_devic + static int parse_name(struct evemu_device *dev, const char *line) + { + int matched; +- char *devname = NULL; ++ char devname[UINPUT_MAX_NAME_SIZE]; + +- if ((matched = sscanf(line, "N: %m[^\n\r]\n", &devname)) > 0) { ++ if ((matched = sscanf(line, "N: %[^\n\r]\n", devname)) > 0) { + if (strlen(evemu_get_name(dev)) == 0) + evemu_set_name(dev, devname); + } + +- if (devname != NULL) +- free(devname); +- + if (matched <= 0) + error(FATAL, "Expected device name, but got: %s", line); + diff --git a/devel/evemu/files/patch-tools_evemu-record.c b/devel/evemu/files/patch-tools_evemu-record.c new file mode 100644 index 000000000000..f09d9fdc7381 --- /dev/null +++ b/devel/evemu/files/patch-tools_evemu-record.c @@ -0,0 +1,12 @@ +--- tools/evemu-record.c.orig 2016-03-01 14:10:40 UTC ++++ tools/evemu-record.c +@@ -209,6 +209,9 @@ out: + return rc; + } + ++/* Fix broken linux/input.h ioctl define found in multimedia/v4l_compat as of 2017-04-02 */ ++#undef EVIOCGRAB ++#define EVIOCGRAB _IOWINT('E', 0x90) + static inline bool test_grab_device(int fd) + { + if (ioctl(fd, EVIOCGRAB, (void*)1) < 0) { diff --git a/devel/evemu/pkg-descr b/devel/evemu/pkg-descr new file mode 100644 index 000000000000..034f84c7c4e0 --- /dev/null +++ b/devel/evemu/pkg-descr @@ -0,0 +1,8 @@ +Tools and bindings for kernel input event device emulation and data capture +and replay. + +Evemu provides a programmatic API to access the kernel input event devices. +The original and intended purpose is for supporting multi-touch input, +especially with regard to the Ubuntu touch and gesture stack. + +WWW: http://www.freedesktop.org/wiki/Evemu diff --git a/devel/evemu/pkg-plist b/devel/evemu/pkg-plist new file mode 100644 index 000000000000..a50f7db48238 --- /dev/null +++ b/devel/evemu/pkg-plist @@ -0,0 +1,28 @@ +bin/evemu-describe +bin/evemu-device +bin/evemu-event +bin/evemu-play +bin/evemu-record +include/evemu.h +lib/libevemu.a +lib/libevemu.so +lib/libevemu.so.3 +lib/libevemu.so.3.0.3 +%%PYTHON%%%%PYTHON_SITELIBDIR%%/evemu/__init__.py +%%PYTHON%%%%PYTHON_SITELIBDIR%%/evemu/__init__.pyc +%%PYTHON%%%%PYTHON_SITELIBDIR%%/evemu/__init__.%%PYTHON_PYOEXTENSION%% +%%PYTHON%%%%PYTHON_SITELIBDIR%%/evemu/base.py +%%PYTHON%%%%PYTHON_SITELIBDIR%%/evemu/base.pyc +%%PYTHON%%%%PYTHON_SITELIBDIR%%/evemu/base.%%PYTHON_PYOEXTENSION%% +%%PYTHON%%%%PYTHON_SITELIBDIR%%/evemu/const.py +%%PYTHON%%%%PYTHON_SITELIBDIR%%/evemu/const.pyc +%%PYTHON%%%%PYTHON_SITELIBDIR%%/evemu/const.%%PYTHON_PYOEXTENSION%% +%%PYTHON%%%%PYTHON_SITELIBDIR%%/evemu/exception.py +%%PYTHON%%%%PYTHON_SITELIBDIR%%/evemu/exception.pyc +%%PYTHON%%%%PYTHON_SITELIBDIR%%/evemu/exception.%%PYTHON_PYOEXTENSION%% +libdata/pkgconfig/evemu.pc +%%MANPAGES%%man/man1/evemu-describe.1.gz +%%MANPAGES%%man/man1/evemu-device.1.gz +%%MANPAGES%%man/man1/evemu-event.1.gz +%%MANPAGES%%man/man1/evemu-play.1.gz +%%MANPAGES%%man/man1/evemu-record.1.gz