guix_mirror_bot pushed a commit to branch master
in repository guix.

commit 1ad09126871a55c3cf0ba6d3838e85ff841b4334
Author: Vagrant Cascadian <[email protected]>
AuthorDate: Thu Oct 16 00:59:14 2025 -0700

    gnu: Add python-capablerobot-usbhub.
    
    This was previously removed due to dropping python-pyyaml-5, though 
currently
    builds fine with the default python-pyyaml and python-click. See:
    
    https://codeberg.org/guix/guix/issues/1390
    
    * gnu/packages/libusb.scm (python-capablerobot-usbhub): New variable.
---
 gnu/packages/libusb.scm | 52 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/gnu/packages/libusb.scm b/gnu/packages/libusb.scm
index d8bb55dfc0..c8753c3b17 100644
--- a/gnu/packages/libusb.scm
+++ b/gnu/packages/libusb.scm
@@ -374,6 +374,58 @@ wrapper for accessing libusb-1.0.")
      "PyUSB aims to be an easy to use Python module to access USB devices.")
     (license license:bsd-3)))
 
+(define-public python-capablerobot-usbhub
+  (package
+    (name "python-capablerobot-usbhub")
+    (version "0.5.0")
+    (source
+     (origin
+       ;; PyPI tarball fails to build.
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/CapableRobot/CapableRobot_USBHub_Driver";)
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1nfd12612z9a9hby5dxg7lfqw5jcv3wcyqqagbg5izragni646mc"))
+       (modules '((guix build utils)))
+       (snippet
+        ;; Remove bundled libraries.
+        '(begin
+           (delete-file-recursively "capablerobot_usbhub/windows/")))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:tests? #f ;No tests provided.
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'use-poetry-core
+            (lambda _
+              ;; Patch to use the core poetry API.
+              (substitute* "pyproject.toml"
+                (("poetry.masonry.api")
+                 "poetry.core.masonry.api"))))
+          (add-after 'install 'install-udev-rules
+            (lambda* (#:key outputs #:allow-other-keys)
+              (let ((out (assoc-ref outputs "out"))
+                    (udevdir "/lib/udev/rules.d/")
+                    (udevrules "50-capablerobot-usbhub.rules"))
+                (mkdir-p (string-append out udevdir))
+                (copy-file udevrules
+                           (string-append out udevdir udevrules))))))))
+    (native-inputs (list python-poetry-core))
+    (propagated-inputs (list python-click python-construct python-pyusb
+                             python-pyyaml))
+    (home-page "https://github.com/CapableRobot/CapableRobot_USBHub_Driver";)
+    (synopsis "Host side driver for the Capable Robot Programmable USB Hub")
+    (description
+     "This package provides access to the internal state of the Capable Robot
+USB Hub, allowing you to monitor and control the Hub from an upstream
+computer.  It also creates a transparent CircuitPython Bridge, allowing
+unmodified CircuitPython code to run on the host computer and interact with
+I2C and SPI devices attached to the USB Hub.")
+    (license license:expat)))
+
 (define-public ideviceinstaller
   (package
     (name "ideviceinstaller")

Reply via email to