summaryrefslogtreecommitdiff
path: root/gnu/packages
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
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')
-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 6076165f45b..5ebae9fe1c7 100644
--- a/gnu/packages/libusb.scm
+++ b/gnu/packages/libusb.scm
@@ -13,6 +13,7 @@
13;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net> 13;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
14;;; Copyright © 2022 Jacob Hrbek <kreyren@rixotstudio.cz> 14;;; Copyright © 2022 Jacob Hrbek <kreyren@rixotstudio.cz>
15;;; Copyright © 2023 Sharlatan Hellseher <sharlatanus@gmail.com> 15;;; Copyright © 2023 Sharlatan Hellseher <sharlatanus@gmail.com>
16;;; Copyright © 2023 Foundation Devices, Inc. <hello@foundationdevices.com>
16;;; 17;;;
17;;; This file is part of GNU Guix. 18;;; This file is part of GNU Guix.
18;;; 19;;;
@@ -653,6 +654,42 @@ HID-Class devices.")
653 license:bsd-3 654 license:bsd-3
654 (license:non-copyleft "file://LICENSE-orig.txt"))))) 655 (license:non-copyleft "file://LICENSE-orig.txt")))))
655 656
657(define-public python-hid
658 (package
659 (name "python-hid")
660 (version "1.0.5")
661 (source (origin
662 (method url-fetch)
663 (uri (pypi-uri "hid" version))
664 (sha256
665 (base32
666 "1s5hvfbmnlmifswr5514f4xxn5rcd429bdcdqzgwkdxrg9zlx58y"))))
667 (build-system pyproject-build-system)
668 (arguments
669 ;; No tests present on the source tree, without this compilation fails
670 ;; because it "requires" the python-nose package, but it is not really
671 ;; necessary.
672 (list #:tests? #f
673 #:phases
674 #~(modify-phases %standard-phases
675 (add-after 'unpack 'add-extra-library-paths
676 (lambda _
677 (let ((libhidapi-hidraw.so
678 #$(file-append hidapi "/lib/libhidapi-hidraw.so"))
679 (libhidapi-libusb.so
680 #$(file-append hidapi "/lib/libhidapi-libusb.so")))
681 (substitute* "hid/__init__.py"
682 (("library_paths = \\(.*$" all)
683 (string-append
684 all
685 " '" libhidapi-hidraw.so "',\n"
686 " '" libhidapi-libusb.so "',\n")))))))))
687 (inputs (list hidapi))
688 (home-page "https://github.com/apmorton/pyhidapi")
689 (synopsis "Python @code{ctypes} bindings for HIDAPI library")
690 (description "Python @code{ctypes} bindings for HIDAPI library.")
691 (license license:expat)))
692
656(define-public python-hidapi 693(define-public python-hidapi
657 (package 694 (package
658 (name "python-hidapi") 695 (name "python-hidapi")