GNU bug report logs - #42682
[PATCH 0/2] Qmk cli

Previous Next

Package: guix-patches;

Reported by: Jan Wielkiewicz <tona_kosmicznego_smiecia <at> interia.pl>

Date: Sun, 2 Aug 2020 20:46:02 UTC

Severity: normal

Tags: patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Fredrik Salomonsson <plattfot <at> posteo.net>
To: 42682 <at> debbugs.gnu.org
Cc: Fredrik Salomonsson <plattfot <at> posteo.net>
Subject: [bug#42682] [PATCH v2 7/9] gnu: Add python-hid.
Date: Sun,  9 Apr 2023 04:31:14 +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 c009c78e88..266ab459a1 100644
--- a/gnu/packages/libusb.scm
+++ b/gnu/packages/libusb.scm
@@ -13,6 +13,7 @@
 ;;; Copyright © 2021 Guillaume Le Vaillant <glv <at> posteo.net>
 ;;; Copyright © 2022 Jacob Hrbek <kreyren <at> rixotstudio.cz>
 ;;; Copyright © 2023 Sharlatan Hellseher <sharlatanus <at> gmail.com>
+;;; Copyright © 2023 Fredrik Salomonsson <plattfot <at> 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.39.2





This bug report was last modified 1 year and 285 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.