summaryrefslogtreecommitdiff
path: root/dev-python/hidapi
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-10-10 12:09:13 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-10-10 12:09:13 +0100
commit35d60f48c1e8e3d48626e53a1933c55805177d20 (patch)
tree0754900eff547564866e4e7265a5f0789874f907 /dev-python/hidapi
parentdd14643cac4a1aa6ce4151cea5c424577434968b (diff)
gentoo auto-resync : 10:10:2023 - 12:09:13
Diffstat (limited to 'dev-python/hidapi')
-rw-r--r--dev-python/hidapi/Manifest3
-rw-r--r--dev-python/hidapi/files/hidapi-0.14.0-cython3.patch134
-rw-r--r--dev-python/hidapi/hidapi-0.14.0.ebuild34
3 files changed, 171 insertions, 0 deletions
diff --git a/dev-python/hidapi/Manifest b/dev-python/hidapi/Manifest
index 8d0a1e66f09b..31474b83a083 100644
--- a/dev-python/hidapi/Manifest
+++ b/dev-python/hidapi/Manifest
@@ -1,3 +1,6 @@
+AUX hidapi-0.14.0-cython3.patch 3670 BLAKE2B c474480208fe8320d08ce6be18931079de4afb78749d573ae58ec99c96fca81a490e4661ca3a42b876d8b02d0479d37244578b27f3c5c964bb7ee4dadad94958 SHA512 b109db4162092ee8179031802ecd06676b9ca09685f9e98efde6d432fe7b32863d815b759fb5d3e45ff7922a0922b3d3abdf1d08e743801a9c86b2fede2144a2
DIST hidapi-0.13.1.tar.gz 130169 BLAKE2B 127e622e4b85880f1c20ccb819b806c66357d8cfa6c15d370c13a6a0a3838ac6acf0673c7edbf5309a91f55051b6177800328b8f897ff43cd1e0af1b511c52a6 SHA512 8e6a7a6bf47e24f6f637cc036dc306518d893fc9fdf94639f626725e8f8767d7e85496d8db5f9f394d648ef5af4dd5ead0f0a6d452a019b5d9fa0716371febed
+DIST hidapi-0.14.0.tar.gz 143052 BLAKE2B ebf3fb9608b1f18d9fa24aaa4bca7b2e5cbbbbcbdb6a33da41456f614d0cace556231bb8eb17c21e2a79a5292970cb37f7a46fb6cd1e82efb0a646cf8a942d2a SHA512 228fac22621e36a3108cefd418937a7ed0153e334e19999e947aad341a753d614877cd3f7add90d78037ebe9c7b3f6cbc42973a8e680188da14928311d317b17
EBUILD hidapi-0.13.1.ebuild 656 BLAKE2B 1ad3cec5c5af62cbbbff1bf24b5fd995d314e2fe5270916c842ab9206b408b34ab07a58f51ba9d1caa38f4816ab456a1c9815aad761d72b5bd9c9c9d03263b9d SHA512 43b04bd94e715f34dbe096de5081af6703b93888c70e9380ec425699ff536f8fa38dc6221b206be69f7fa51efa437bf6d990f09ef7a829a14e101c6c4a0ea042
+EBUILD hidapi-0.14.0.ebuild 698 BLAKE2B 67518e045f446d5b0c609daf648e37f2af781018f9acd641a1eb81dac0883f7573dadbc902dd148fd9889e08dc5b951425bf867e6c57d095fb1c9142676ff83e SHA512 1acc599831727c4763ef5e8cc6aaba05c1ddd7ebb91a75c730d3efbf903b1370b1d93c9af0797385c8f02f914b73f18f62088f602dd01f01efe7addf17f135ae
MISC metadata.xml 304 BLAKE2B 69f2abf7c43eda718abb98bdee59b648ca8562d77c2d8381ee7dc83e4b7d1d0f017dce9a291a783ba3891b54df905a49da3f74916158b9b72f6b6f12674b0b53 SHA512 d06b9d8c5b35cda24fb8fc01206e610d0fc78e723833817207c9c18e4b2d02df82cac832580ccd917c68be399d7115024f0b573acd8705d89306f88790cfdbc3
diff --git a/dev-python/hidapi/files/hidapi-0.14.0-cython3.patch b/dev-python/hidapi/files/hidapi-0.14.0-cython3.patch
new file mode 100644
index 000000000000..681f9a427934
--- /dev/null
+++ b/dev-python/hidapi/files/hidapi-0.14.0-cython3.patch
@@ -0,0 +1,134 @@
+https://bugs.gentoo.org/898678
+
+1. https://github.com/trezor/cython-hidapi/commit/749da6931f57c4c30596de678125648ccfd6e1cd
+2. https://github.com/trezor/cython-hidapi/pull/159
+
+From 749da6931f57c4c30596de678125648ccfd6e1cd Mon Sep 17 00:00:00 2001
+From: Pavol Rusnak <pavol@rusnak.io>
+Date: Thu, 20 Jul 2023 13:09:19 +0200
+Subject: [PATCH] Require Cython<3 instead of Cython
+
+---
+ setup.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/setup.py b/setup.py
+index 7e3eb29c..4c311ba4 100755
+--- a/setup.py
++++ b/setup.py
+@@ -136,6 +136,6 @@ def find_version():
+ "Programming Language :: Python :: 3.9",
+ ],
+ ext_modules=modules,
+- setup_requires=["Cython"],
++ setup_requires=["Cython<3"],
+ install_requires=["setuptools>=19.0"],
+ )
+
+From 7dad82b125fdca5df83c00fc711151c35aaa5125 Mon Sep 17 00:00:00 2001
+From: Shawn Hoffman <godisgovernment@gmail.com>
+Date: Mon, 11 Sep 2023 17:27:52 -0700
+Subject: [PATCH 1/4] use pyxdep file to locate chid.pxd
+
+---
+ hid.pyxdep | 1 +
+ setup.py | 4 ++--
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+ create mode 100644 hid.pyxdep
+
+diff --git a/hid.pyxdep b/hid.pyxdep
+new file mode 100644
+index 00000000..7480bc82
+--- /dev/null
++++ b/hid.pyxdep
+@@ -0,0 +1 @@
++chid.pxd
+diff --git a/setup.py b/setup.py
+index 4c311ba4..73066b06 100755
+--- a/setup.py
++++ b/setup.py
+@@ -9,7 +9,7 @@
+ hidapi_include = os.path.join(hidapi_topdir, "hidapi")
+ system_hidapi = 0
+ libs = []
+-src = ["hid.pyx", "chid.pxd"]
++src = ["hid.pyx"]
+
+
+ def hidapi_src(platform):
+@@ -42,7 +42,7 @@ def hidapi_src(platform):
+ )
+ )
+ libs = ["udev", "rt"]
+- src = ["hidraw.pyx", "chid.pxd"]
++ src = ["hidraw.pyx"]
+ if system_hidapi == 1:
+ libs.append("hidapi-hidraw")
+ else:
+
+From 4c78f61c7815d1005023d69c42ae777cfee021c1 Mon Sep 17 00:00:00 2001
+From: Shawn Hoffman <godisgovernment@gmail.com>
+Date: Mon, 11 Sep 2023 17:28:33 -0700
+Subject: [PATCH 2/4] specify language_level for cython
+
+---
+ setup.py | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/setup.py b/setup.py
+index 73066b06..6a3e0af0 100755
+--- a/setup.py
++++ b/setup.py
+@@ -1,5 +1,6 @@
+ #!/usr/bin/python
+ from setuptools import setup, Extension
++from Cython.Build import cythonize
+ import os
+ import sys
+ import subprocess
+@@ -135,7 +136,7 @@ def find_version():
+ "Programming Language :: Python :: 3.8",
+ "Programming Language :: Python :: 3.9",
+ ],
+- ext_modules=modules,
++ ext_modules=cythonize(modules, language_level=3),
+ setup_requires=["Cython<3"],
+ install_requires=["setuptools>=19.0"],
+ )
+
+From d73b4cc6706d4220d28df866504e989ab616616a Mon Sep 17 00:00:00 2001
+From: Shawn Hoffman <godisgovernment@gmail.com>
+Date: Mon, 11 Sep 2023 17:31:37 -0700
+Subject: [PATCH 3/4] use pyproject.toml allow using recent cython the
+ expectation is that one would use the `build` tool instead of invoking
+ setup.py.
+
+---
+ pyproject.toml | 3 +++
+ setup.py | 1 -
+ 3 files changed, 3 insertions(+), 2 deletions(-)
+ create mode 100644 pyproject.toml
+ delete mode 100644 requirements.txt
+
+diff --git a/pyproject.toml b/pyproject.toml
+new file mode 100644
+index 00000000..c07b1d35
+--- /dev/null
++++ b/pyproject.toml
+@@ -0,0 +1,3 @@
++[build-system]
++requires = ["setuptools", "Cython"]
++build-backend = "setuptools.build_meta"
+diff --git a/setup.py b/setup.py
+index 6a3e0af0..9dcdb0ee 100755
+--- a/setup.py
++++ b/setup.py
+@@ -137,6 +137,5 @@ def find_version():
+ "Programming Language :: Python :: 3.9",
+ ],
+ ext_modules=cythonize(modules, language_level=3),
+- setup_requires=["Cython<3"],
+ install_requires=["setuptools>=19.0"],
+ )
+
+
diff --git a/dev-python/hidapi/hidapi-0.14.0.ebuild b/dev-python/hidapi/hidapi-0.14.0.ebuild
new file mode 100644
index 000000000000..890f3675ed06
--- /dev/null
+++ b/dev-python/hidapi/hidapi-0.14.0.ebuild
@@ -0,0 +1,34 @@
+# Copyright 2022-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_EXT=1
+PYTHON_COMPAT=( python3_{10..12} )
+DISTUTILS_USE_PEP517=setuptools
+inherit distutils-r1 pypi
+
+DESCRIPTION="A Cython interface to HIDAPI library"
+HOMEPAGE="https://github.com/trezor/cython-hidapi"
+
+LICENSE="|| ( BSD GPL-3 )"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+
+DEPEND=">=dev-libs/hidapi-$(ver_cut 1-3)"
+RDEPEND="${DEPEND}"
+BDEPEND="dev-python/cython[${PYTHON_USEDEP}]"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.14.0-cython3.patch
+)
+
+distutils_enable_tests pytest
+
+python_configure_all() {
+ DISTUTILS_ARGS=( --with-system-hidapi )
+}
+
+python_test() {
+ epytest tests.py
+}