View | Details | Raw Unified | Return to bug 253498 | Differences between
and this patch

Collapse All | Expand All

(-)sysutils/hid-tools/Makefile (+33 lines)
Line 0 Link Here
1
# Created by: Vladimir Kondratyev <wulf@FreeBSD.org>
2
# $FreeBSD$
3
4
PORTNAME=	hid-tools
5
PORTVERSION=	0.2
6
CATEGORIES=	sysutils python
7
MASTER_SITES=	https://gitlab.freedesktop.org/libevdev/${PORTNAME}/-/archive/${DISTVERSION}/
8
9
MAINTAINER=	wulf@FreeBSD.org
10
COMMENT=	Python scripts to manipulate HID data
11
12
LICENSE=	GPLv2
13
14
IGNORE_FreeBSD_11=	Is missing a hidraw(4) driver
15
16
USES=		python:3.6+ tar:bz2 shebangfix
17
USE_PYTHON=	autoplist distutils
18
19
RUN_DEPENDS_FreeBSD_12=	iichid>=0.0.6:sysutils/iichid
20
RUN_DEPENDS=	${RUN_DEPENDS_${OPSYS}_${OSREL:R}} \
21
		${PYTHON_PKGNAMEPREFIX}click>=0:devel/py-click@${PY_FLAVOR} \
22
		${PYTHON_PKGNAMEPREFIX}pyudev>=0:devel/py-pyudev@${PY_FLAVOR} \
23
		${PYTHON_PKGNAMEPREFIX}yaml>=0:devel/py-yaml@${PY_FLAVOR} \
24
		${PYTHON_PKGNAMEPREFIX}parse>=0:textproc/py-parse@${PY_FLAVOR}
25
26
OPTIONS_DEFINE=	MANPAGES
27
OPTIONS_DEFAULT=MANPAGES
28
29
MANPAGES_BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}pypandoc>=0:textproc/py-pypandoc@${PY_FLAVOR}
30
31
NO_ARCH=	yes
32
33
.include <bsd.port.mk>
(-)sysutils/hid-tools/distinfo (+3 lines)
Line 0 Link Here
1
TIMESTAMP = 1612900435
2
SHA256 (hid-tools-0.2.tar.bz2) = c0a963f75699d69740ecd10549f3ffe32d620703f3090c5e3c55b9af1d469786
3
SIZE (hid-tools-0.2.tar.bz2) = 78530
(-)sysutils/hid-tools/files/patch-hidtools_hidraw.py (+58 lines)
Line 0 Link Here
1
Fix ioctl(2) definitions to match <sys/ioccom.h> and <dev/hid/hidraw.h>
2
3
--- hidtools/hidraw.py.orig	2019-03-29 01:29:29 UTC
4
+++ hidtools/hidraw.py
5
@@ -36,13 +36,14 @@ def _ioctl(fd, EVIOC, code, return_type, buf=None):
6
 
7
 
8
 # extracted from <asm-generic/ioctl.h>
9
-_IOC_WRITE = 1
10
+_IOC_VOID = 1
11
 _IOC_READ = 2
12
+_IOC_WRITE = 4
13
 
14
 _IOC_NRBITS = 8
15
 _IOC_TYPEBITS = 8
16
-_IOC_SIZEBITS = 14
17
-_IOC_DIRBITS = 2
18
+_IOC_SIZEBITS = 13
19
+_IOC_DIRBITS = 3
20
 
21
 _IOC_NRSHIFT = 0
22
 _IOC_TYPESHIFT = _IOC_NRSHIFT + _IOC_NRBITS
23
@@ -74,7 +75,7 @@ def _IOW(type, nr, size):
24
 
25
 # define HIDIOCGRDESCSIZE	_IOR('H', 0x01, int)
26
 def _IOC_HIDIOCGRDESCSIZE(none, len):
27
-    return _IOR('H', 0x01, len)
28
+    return _IOR('U', 30, len)
29
 
30
 
31
 def _HIDIOCGRDESCSIZE(fd):
32
@@ -85,7 +86,7 @@ def _HIDIOCGRDESCSIZE(fd):
33
 
34
 # define HIDIOCGRDESC		_IOR('H', 0x02, struct hidraw_report_descriptor)
35
 def _IOC_HIDIOCGRDESC(none, len):
36
-    return _IOR('H', 0x02, len)
37
+    return _IOC(_IOC_VOID, 'U', 31, 0)
38
 
39
 
40
 def _HIDIOCGRDESC(fd, size):
41
@@ -102,7 +103,7 @@ def _HIDIOCGRDESC(fd, size):
42
 
43
 # define HIDIOCGRAWINFO		_IOR('H', 0x03, struct hidraw_devinfo)
44
 def _IOC_HIDIOCGRAWINFO(none, len):
45
-    return _IOR('H', 0x03, len)
46
+    return _IOR('U', 32, len)
47
 
48
 
49
 def _HIDIOCGRAWINFO(fd):
50
@@ -113,7 +114,7 @@ def _HIDIOCGRAWINFO(fd):
51
 
52
 # define HIDIOCGRAWNAME(len)     _IOC(_IOC_READ, 'H', 0x04, len)
53
 def _IOC_HIDIOCGRAWNAME(none, len):
54
-    return _IOC(_IOC_READ, 'H', 0x04, len)
55
+    return _IOC(_IOC_READ, 'U', 33, len)
56
 
57
 
58
 def _HIDIOCGRAWNAME(fd):
(-)sysutils/hid-tools/files/patch-man_hid-decode.md (+25 lines)
Line 0 Link Here
1
Remove unsupported sysfs-dependent parts from manpage.
2
3
--- man/hid-decode.md.orig	2019-03-29 01:29:29 UTC
4
+++ man/hid-decode.md
5
@@ -11,8 +11,6 @@ SYNOPSIS
6
 
7
 **hid-decode** */dev/hidraw0*
8
 
9
-**hid-decode** */dev/input/event0*
10
-
11
 **hid-decode** *hid-recording*
12
 
13
 DESCRIPTION
14
@@ -20,11 +18,8 @@ DESCRIPTION
15
 **hid-decode** decodes one or more HID report descriptors into into
16
 human-readable format. It supports a variety of inputs:
17
 
18
-- a binary format as exported in sysfs, e.g.
19
-  _/sys/class/input/event0/device/device/report_descriptor_
20
 - the format exported by **hid-recorder(1)**
21
 - a _/dev/hidraw_ node
22
-- a _/dev/input/event_ node
23
 
24
 The format is deduced based on the input arguments. Undetected formats are
25
 assumed to be binary files.
(-)sysutils/hid-tools/pkg-descr (+16 lines)
Line 0 Link Here
1
hid-tools is a set of tools to interact with the kernel's HID subsystem.
2
3
hid-recorder prints the HID Report Descriptor from a /dev/hidraw device
4
node and any HID reports coming from that device.  The output format can
5
be used with hid-replay for debugging.
6
7
hid-replay takes the output from hid-recorder and replays it through a
8
virtual HID device that looks exactly like the one recorded.
9
10
hid-decode takes a HID Report Descriptor and prints a human-readable
11
version of it.  hid-decode takes binary report descriptors, strings of
12
bytes, and other formats.
13
14
hid-tools require hidraw.ko driver to be loaded in to kernel.
15
16
WWW: https://gitlab.freedesktop.org/libevdev/hid-tools

Return to bug 253498