[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#42682] [PATCH v3 7/9] gnu: Add python-hid.
From: |
Fredrik Salomonsson |
Subject: |
[bug#42682] [PATCH v3 7/9] gnu: Add python-hid. |
Date: |
Sun, 28 May 2023 23:44:05 +0000 |
* gnu/packages/libusb.scm (python-hid): New variable.
---
gnu/packages/libusb.scm | 56 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 56 insertions(+)
diff --git a/gnu/packages/libusb.scm b/gnu/packages/libusb.scm
index d0837c8a91..8e81b0c1a9 100644
--- a/gnu/packages/libusb.scm
+++ b/gnu/packages/libusb.scm
@@ -13,6 +13,7 @@
;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
;;; Copyright © 2022 Jacob Hrbek <kreyren@rixotstudio.cz>
;;; Copyright © 2023 Sharlatan Hellseher <sharlatanus@gmail.com>
+;;; Copyright © 2023 Fredrik Salomonsson <plattfot@posteo.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -44,6 +45,7 @@ (define-module (gnu packages libusb)
#:use-module (guix build-system pyproject)
#:use-module (guix build-system python)
#:use-module (gnu packages autotools)
+ #:use-module (gnu packages check)
#:use-module (gnu packages compression)
#:use-module (gnu packages curl)
#:use-module (gnu packages gnupg)
@@ -54,6 +56,7 @@ (define-module (gnu packages libusb)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
#:use-module (gnu packages python-build)
+ #:use-module (gnu packages python-check)
#:use-module (gnu packages python-xyz)
#:use-module (gnu packages readline)
#:use-module (gnu packages tls)
@@ -650,6 +653,59 @@ (define-public hidapi
license:bsd-3
(license:non-copyleft "file://LICENSE-orig.txt")))))
+(define-public python-hid
+ (package
+ (name "python-hid")
+ (version "1.0.5")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri "hid" version))
+ (sha256
+ (base32
+ "1s5hvfbmnlmifswr5514f4xxn5rcd429bdcdqzgwkdxrg9zlx58y"))))
+ (build-system python-build-system)
+ (arguments
+ (list
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'patch-library-paths
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* '("hid/__init__.py")
+ (("'libhidapi-hidraw.so'")
+ (string-append
+ "'" (search-input-file inputs "/lib/libhidapi-hidraw.so")
"'"))
+ (("'libhidapi-libusb.so'")
+ (string-append
+ "'" (search-input-file inputs "/lib/libhidapi-libusb.so")
"'"))
+ ;; Nuke the rest of the library_paths
+ (("[[:blank:]]+'libhidapi-hidraw.so.0',\n")
+ "")
+ (("[[:blank:]]+'libhidapi-libusb.so.0',\n")
+ "")
+ (("[[:blank:]]+'libhidapi-iohidmanager.so',\n")
+ "")
+ (("[[:blank:]]+'libhidapi-iohidmanager.so.0',\n")
+ "")
+ (("[[:blank:]]+'libhidapi.dylib',\n")
+ "")
+ (("[[:blank:]]+'hidapi.dll',\n")
+ "")
+ (("[[:blank:]]+'hidapi-0.dll',\n")
+ "")))))))
+ (native-inputs
+ (list
+ python-nose
+ python-tox))
+ (inputs
+ (list
+ hidapi))
+ (home-page "https://github.com/apmorton/pyhidapi")
+ (synopsis "Ctypes bindings for hidapi")
+ (description "This package provides ctypes bindings in Python for the
@code{hidapi}
+package. Note that this package conflicts with the
+@code{python-hidapi} package as they occupy the same Python namespace.")
+ (license license:expat)))
+
(define-public python-hidapi
(package
(name "python-hidapi")
--
2.40.1
- [bug#42682] [PATCH v3 0/9] Add qmk-cli, Fredrik Salomonsson, 2023/05/28
- [bug#42682] [PATCH v3 3/9] gnu: Add python-spinners., Fredrik Salomonsson, 2023/05/28
- [bug#42682] [PATCH v3 1/9] gnu: Add python-hjson., Fredrik Salomonsson, 2023/05/28
- [bug#42682] [PATCH v3 2/9] gnu: Add python-log-symbols., Fredrik Salomonsson, 2023/05/28
- [bug#42682] [PATCH v3 6/9] gnu: Add python-dotty-dict., Fredrik Salomonsson, 2023/05/28
- [bug#42682] [PATCH v3 9/9] gnu: Add qmk-udev-rules., Fredrik Salomonsson, 2023/05/28
- [bug#42682] [PATCH v3 4/9] gnu: Add python-halo., Fredrik Salomonsson, 2023/05/28
- [bug#42682] [PATCH v3 8/9] gnu: Add qmk-cli., Fredrik Salomonsson, 2023/05/28
- [bug#42682] [PATCH v3 5/9] gnu: Add python-milc., Fredrik Salomonsson, 2023/05/28
- [bug#42682] [PATCH v3 7/9] gnu: Add python-hid.,
Fredrik Salomonsson <=