summaryrefslogtreecommitdiff
path: root/gnu/packages/libusb.scm
diff options
context:
space:
mode:
authorJean-Pierre De Jesus DIAZ <jean@foundationdevices.com>2023-07-28 14:23:56 +0200
committerVagrant Cascadian <vagrant@debian.org>2023-08-29 17:12:35 -0700
commit2da454d2033d95f108c26ac0018cf73b18823d43 (patch)
tree0001deb47f7410c0498b3c090831732e99960e2b /gnu/packages/libusb.scm
parent0c47e8bf2b8dc8d97686df57feddcc11f155c8e0 (diff)
gnu: Add python-hid.
* gnu/packages/libusb.scm (python-hid): New variable. Signed-off-by: Jean-Pierre De Jesus DIAZ <jean@foundationdevices.com> Signed-off-by: Vagrant Cascadian <vagrant@debian.org>
Diffstat (limited to 'gnu/packages/libusb.scm')
-rw-r--r--gnu/packages/libusb.scm37
1 files changed, 37 insertions, 0 deletions
diff --git a/gnu/packages/libusb.scm b/gnu/packages/libusb.scm
index 6076165f45..5ebae9fe1c 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 Foundation Devices, Inc. <hello@foundationdevices.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -653,6 +654,42 @@ HID-Class devices.")
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 pyproject-build-system)
+ (arguments
+ ;; No tests present on the source tree, without this compilation fails
+ ;; because it "requires" the python-nose package, but it is not really
+ ;; necessary.
+ (list #:tests? #f
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'add-extra-library-paths
+ (lambda _
+ (let ((libhidapi-hidraw.so
+ #$(file-append hidapi "/lib/libhidapi-hidraw.so"))
+ (libhidapi-libusb.so
+ #$(file-append hidapi "/lib/libhidapi-libusb.so")))
+ (substitute* "hid/__init__.py"
+ (("library_paths = \\(.*$" all)
+ (string-append
+ all
+ " '" libhidapi-hidraw.so "',\n"
+ " '" libhidapi-libusb.so "',\n")))))))))
+ (inputs (list hidapi))
+ (home-page "https://github.com/apmorton/pyhidapi")
+ (synopsis "Python @code{ctypes} bindings for HIDAPI library")
+ (description "Python @code{ctypes} bindings for HIDAPI library.")
+ (license license:expat)))
+
(define-public python-hidapi
(package
(name "python-hidapi")