diff mbox series

[1/2] package/phython-libevdev: new package

Message ID 20220809132730.232111-1-romain.naour@smile.fr
State Accepted
Headers show
Series [1/2] package/phython-libevdev: new package | expand

Commit Message

Romain Naour Aug. 9, 2022, 1:27 p.m. UTC
python-libevdev is needed for libinput replay command:

$ libinput replay recording.yml
Error: No module named 'libevdev'
One or more python modules are missing. Please install those modules and re-run this tool.

Indeed only libinput-replay tool is a python script
(like libinput-analyze-recording, libinput-measure-fuzz...)

phython-libevdev itself requires a kernel built with
CONFIG_INPUT_UINPUT option enabled, enable this option
if a kernel is built by Buildroot.

Signed-off-by: Romain Naour <romain.naour@smile.fr>
---
 DEVELOPERS                                   |  1 +
 package/Config.in                            |  1 +
 package/python-libevdev/Config.in            |  7 +++++++
 package/python-libevdev/python-libevdev.hash |  5 +++++
 package/python-libevdev/python-libevdev.mk   | 20 ++++++++++++++++++++
 5 files changed, 34 insertions(+)
 create mode 100644 package/python-libevdev/Config.in
 create mode 100644 package/python-libevdev/python-libevdev.hash
 create mode 100644 package/python-libevdev/python-libevdev.mk

Comments

Thomas Petazzoni Aug. 24, 2022, 10:13 a.m. UTC | #1
On Tue,  9 Aug 2022 15:27:29 +0200
Romain Naour <romain.naour@smile.fr> wrote:

> python-libevdev is needed for libinput replay command:
> 
> $ libinput replay recording.yml
> Error: No module named 'libevdev'
> One or more python modules are missing. Please install those modules and re-run this tool.
> 
> Indeed only libinput-replay tool is a python script
> (like libinput-analyze-recording, libinput-measure-fuzz...)
> 
> phython-libevdev itself requires a kernel built with
> CONFIG_INPUT_UINPUT option enabled, enable this option
> if a kernel is built by Buildroot.
> 
> Signed-off-by: Romain Naour <romain.naour@smile.fr>
> ---
>  DEVELOPERS                                   |  1 +
>  package/Config.in                            |  1 +
>  package/python-libevdev/Config.in            |  7 +++++++
>  package/python-libevdev/python-libevdev.hash |  5 +++++
>  package/python-libevdev/python-libevdev.mk   | 20 ++++++++++++++++++++
>  5 files changed, 34 insertions(+)
>  create mode 100644 package/python-libevdev/Config.in
>  create mode 100644 package/python-libevdev/python-libevdev.hash
>  create mode 100644 package/python-libevdev/python-libevdev.mk

So, I have applied both patches, but I had to split things up:

 * From PATCH 2/2, I took the removal of the Python tools, made it
   unconditional, and applied that to master.

 * In next, I cherry-picked the patch from master that unconditionally
   removes Python tools of libinput, then applied the python-libevdev
   patch, then applied a patch that adds the libinput option for Python
   tools.

This way, we have the fix in master (removal of Python tools) and the
new feature in next.

Thanks!

Thomas
diff mbox series

Patch

diff --git a/DEVELOPERS b/DEVELOPERS
index d2bd0d809a..5f1ef3df52 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2580,6 +2580,7 @@  F:	package/ogre/
 F:	package/openpowerlink/
 F:	package/physfs/
 F:	package/piglit/
+F:	package/python-libevdev/
 F:	package/qemu/
 F:	package/solarus/
 F:	package/stress-ng/
diff --git a/package/Config.in b/package/Config.in
index 2ddd240150..25562ac839 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1094,6 +1094,7 @@  menu "External python modules"
 	source "package/python-kiwisolver/Config.in"
 	source "package/python-lark/Config.in"
 	source "package/python-libconfig/Config.in"
+	source "package/python-libevdev/Config.in"
 	source "package/python-libusb1/Config.in"
 	source "package/python-lmdb/Config.in"
 	source "package/python-lockfile/Config.in"
diff --git a/package/python-libevdev/Config.in b/package/python-libevdev/Config.in
new file mode 100644
index 0000000000..2d6aa49ce0
--- /dev/null
+++ b/package/python-libevdev/Config.in
@@ -0,0 +1,7 @@ 
+config BR2_PACKAGE_PYTHON_LIBEVDEV
+	bool "python-libevdev"
+	select BR2_PACKAGE_LIBEVDEV # runtime
+	help
+	  Python wrapper for libevdev.
+
+	  https://gitlab.freedesktop.org/libevdev/python-libevdev
diff --git a/package/python-libevdev/python-libevdev.hash b/package/python-libevdev/python-libevdev.hash
new file mode 100644
index 0000000000..2799078cc8
--- /dev/null
+++ b/package/python-libevdev/python-libevdev.hash
@@ -0,0 +1,5 @@ 
+# md5, sha256 from https://pypi.org/pypi/libevdev/json
+md5  34b48098c1fba26de79a0d67a17a588a  libevdev-0.11.tar.gz
+sha256  e9ca006a4df2488a60bd9a740011ee948d81904be2364f017e560169508f560f  libevdev-0.11.tar.gz
+# Locally computed sha256 checksums
+sha256  a547b196da4e5bb9588a6e24f1f36ae9e2349ca5375e2cf9c315186e237d9f6d  COPYING
diff --git a/package/python-libevdev/python-libevdev.mk b/package/python-libevdev/python-libevdev.mk
new file mode 100644
index 0000000000..e5256064c9
--- /dev/null
+++ b/package/python-libevdev/python-libevdev.mk
@@ -0,0 +1,20 @@ 
+################################################################################
+#
+# python-libevdev
+#
+################################################################################
+
+PYTHON_LIBEVDEV_VERSION = 0.11
+PYTHON_LIBEVDEV_SOURCE = libevdev-$(PYTHON_LIBEVDEV_VERSION).tar.gz
+PYTHON_LIBEVDEV_SITE = https://files.pythonhosted.org/packages/b0/49/2fe589ce1fa6ca0f05ae0b1717923650f2cc6eec6307c71fbc7789738902
+PYTHON_LIBEVDEV_SETUP_TYPE = setuptools
+PYTHON_LIBEVDEV_LICENSE = MIT
+PYTHON_LIBEVDEV_LICENSE_FILES = COPYING
+
+# Requires a kernel built with user level driver support (uinput).
+define PYTHON_LIBEVDEV_LINUX_CONFIG_FIXUPS
+	$(call KCONFIG_ENABLE_OPT,CONFIG_INPUT_MISC)
+	$(call KCONFIG_ENABLE_OPT,CONFIG_INPUT_UINPUT)
+endef
+
+$(eval $(python-package))