pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

py-hidapi: add new package 0.14.0



Module Name:	pkgsrc-wip
Committed By:	Stepan Ipatov <st.ipatov%gmail.com@localhost>
Pushed By:	st.ipatov
Date:		Wed Nov 5 00:49:24 2025 +0000
Changeset:	61f43cfec55565acfd208b415e53f84ec0c6ea4a

Modified Files:
	Makefile
Added Files:
	py-hidapi/COMMIT_MSG
	py-hidapi/DESCR
	py-hidapi/Makefile
	py-hidapi/PLIST
	py-hidapi/distinfo
	py-hidapi/patches/patch-setup.py

Log Message:
py-hidapi: add new package 0.14.0

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=61f43cfec55565acfd208b415e53f84ec0c6ea4a

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 Makefile                         |  1 +
 py-hidapi/COMMIT_MSG             |  3 ++
 py-hidapi/DESCR                  |  1 +
 py-hidapi/Makefile               | 29 ++++++++++++++++++
 py-hidapi/PLIST                  | 10 ++++++
 py-hidapi/distinfo               |  6 ++++
 py-hidapi/patches/patch-setup.py | 66 ++++++++++++++++++++++++++++++++++++++++
 7 files changed, 116 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index 9076265781..58e945654d 100644
--- a/Makefile
+++ b/Makefile
@@ -3994,6 +3994,7 @@ SUBDIR+=	py-hg-cinnabarclone
 SUBDIR+=	py-hg-git-devel
 SUBDIR+=	py-hgapi
 SUBDIR+=	py-hickle
+SUBDIR+=	py-hidapi
 SUBDIR+=	py-hidapi-git
 SUBDIR+=	py-hieroglyph
 SUBDIR+=	py-hiphive
diff --git a/py-hidapi/COMMIT_MSG b/py-hidapi/COMMIT_MSG
new file mode 100644
index 0000000000..d16d672387
--- /dev/null
+++ b/py-hidapi/COMMIT_MSG
@@ -0,0 +1,3 @@
+comms/py-hidapi: Add py-hidapi version 0.14.0.post4
+
+Cython interface to the hidapi
diff --git a/py-hidapi/DESCR b/py-hidapi/DESCR
new file mode 100644
index 0000000000..e471b4f714
--- /dev/null
+++ b/py-hidapi/DESCR
@@ -0,0 +1 @@
+A Cython interface to HIDAPI library.
diff --git a/py-hidapi/Makefile b/py-hidapi/Makefile
new file mode 100644
index 0000000000..8b9f7a1ed5
--- /dev/null
+++ b/py-hidapi/Makefile
@@ -0,0 +1,29 @@
+# $NetBSD$
+
+NAME=		hidapi
+VERSION=	0.14.0
+DISTNAME=	${NAME}-${VERSION}.post4
+PKGNAME=	${PYPKGPREFIX}-${NAME}-${VERSION}
+CATEGORIES=	comms
+MASTER_SITES=	${MASTER_SITE_PYPI:=h/hidapi/}
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://github.com/trezor/cython-hidapi
+COMMENT=	Cython interface to the hidapi
+LICENSE=	modified-bsd OR gnu-gpl-v3
+
+TOOL_DEPENDS+=	${PYPKGPREFIX}-setuptools>=78:../../devel/py-setuptools
+TOOL_DEPENDS+=	${PYPKGPREFIX}-cython-[0-9]*:../../devel/py-cython
+
+USE_LANGUAGES=	c
+USE_TOOLS+=	pkg-config
+
+PYTHON_VERSIONS_INCOMPATIBLE=	27
+
+MAKE_ENV+=	HIDAPI_SYSTEM_HIDAPI=1
+MAKE_ENV+=	HIDAPI_WITH_LIBUSB=1
+
+.include "../../lang/python/wheel.mk"
+.include "../../devel/libusb1/buildlink3.mk"
+.include "../../comms/libhidapi/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/py-hidapi/PLIST b/py-hidapi/PLIST
new file mode 100644
index 0000000000..ca6c18e11b
--- /dev/null
+++ b/py-hidapi/PLIST
@@ -0,0 +1,10 @@
+@comment $NetBSD$
+${PYSITELIB}/hid.so
+${PYSITELIB}/${WHEEL_INFODIR}/METADATA
+${PYSITELIB}/${WHEEL_INFODIR}/RECORD
+${PYSITELIB}/${WHEEL_INFODIR}/WHEEL
+${PYSITELIB}/${WHEEL_INFODIR}/licenses/LICENSE-bsd.txt
+${PYSITELIB}/${WHEEL_INFODIR}/licenses/LICENSE-gpl3.txt
+${PYSITELIB}/${WHEEL_INFODIR}/licenses/LICENSE-orig.txt
+${PYSITELIB}/${WHEEL_INFODIR}/licenses/LICENSE.txt
+${PYSITELIB}/${WHEEL_INFODIR}/top_level.txt
diff --git a/py-hidapi/distinfo b/py-hidapi/distinfo
new file mode 100644
index 0000000000..5660914a19
--- /dev/null
+++ b/py-hidapi/distinfo
@@ -0,0 +1,6 @@
+$NetBSD$
+
+BLAKE2s (hidapi-0.14.0.post4.tar.gz) = 9af452f1771e0825fb657e7c219d02d33181ccbcc4eff6e7276402a6c6eb6e79
+SHA512 (hidapi-0.14.0.post4.tar.gz) = 16e567a7390c3a7abd4e271ced41a4e01041d03c4e14168db92a62afa39e8992b078577c1b836b6728e683ac5a9621553bedf426fe15aa8ca3ccae06ce55d79d
+Size (hidapi-0.14.0.post4.tar.gz) = 174388 bytes
+SHA1 (patch-setup.py) = 2db67a4fb201f82b48e7e49f65aab6eb933a0fa2
diff --git a/py-hidapi/patches/patch-setup.py b/py-hidapi/patches/patch-setup.py
new file mode 100644
index 0000000000..9b3031a6e2
--- /dev/null
+++ b/py-hidapi/patches/patch-setup.py
@@ -0,0 +1,66 @@
+$NetBSD$
+
+Fix setup.py to use the backend according to the comms/libhidapi 
+settings.
+
+--- setup.py.orig	2025-11-04 23:48:53.111348221 +0000
++++ setup.py
+@@ -179,46 +179,29 @@ def hid_from_embedded_hidapi():
+ 
+ def hid_from_system_hidapi():
+     if sys.platform.startswith("linux"):
+-        modules = []
+-        if "--with-hidraw" in sys.argv:
+-            sys.argv.remove("--with-hidraw")
+-            HIDAPI_WITH_HIDRAW = True
+-        else:
+-            HIDAPI_WITH_HIDRAW = to_bool(os.getenv("HIDAPI_WITH_HIDRAW"))
+-        if "--with-libusb" in sys.argv:
+-            sys.argv.remove("--with-libusb")
+-            HIDAPI_WITH_LIBUSB = True
+-        else:
+-            HIDAPI_WITH_LIBUSB = to_bool(os.getenv("HIDAPI_WITH_LIBUSB"))
+-
+-        # make libusb backend default if none is specified
+-        if not HIDAPI_WITH_HIDRAW and not HIDAPI_WITH_LIBUSB:
+-            HIDAPI_WITH_LIBUSB = True
+-
+-        if HIDAPI_WITH_LIBUSB:
+-            hidraw_module = "hidraw"
+-            modules.append(
+-                pkgconfig_configure_extension(
+-                    Extension("hid", sources=["hid.pyx"]), hidapi_libusb_pkgconfig
+-                )
++        modules.append(
++            pkgconfig_configure_extension(
++                Extension("hid", sources=["hid.pyx"]), hidapi_libusb_pkgconfig
+             )
+-        elif HIDAPI_WITH_HIDRAW:
+-            hidraw_module = "hid"
+-        else:
+-            raise ValueError("Unknown HIDAPI backend")
+-
++        )
+         modules.append(
+             pkgconfig_configure_extension(
+-                Extension(hidraw_module, sources=["hidraw.pyx"]),
++                Extension("hidraw", sources=["hidraw.pyx"]),
+                 hidapi_hidraw_pkgconfig,
+             )
+         )
+-    else:
++    elif sys.platform.startswith("darwin"):
+         modules = [
+             pkgconfig_configure_extension(
+                 Extension("hid", sources=["hid.pyx"]), hidapi_pkgconfig
+             )
+         ]
++    else:
++        modules = [
++            pkgconfig_configure_extension(
++                Extension("hid", sources=["hid.pyx"]), hidapi_libusb_pkgconfig
++            )
++        ]
+ 
+     return modules
+ 


Home | Main Index | Thread Index | Old Index