summary refs log tree commit diff
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-06-06 13:04:08 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-06-06 13:27:39 -0400
commit1c7d5b1c822b4a0820e02afde3853eeb3093b2f3 (patch)
tree75d14c9c5efe164e01263785e17b93e45e2f8656
parent1d0d46b1c7532461c6243e4af6f208f47d66cd4e (diff)
downloadguix-1c7d5b1c822b4a0820e02afde3853eeb3093b2f3.tar.gz
gnu: Add python-exodriver.
* gnu/packages/python-xyz.scm (python-exodriver): New variable.
-rw-r--r--gnu/packages/python-xyz.scm54
1 files changed, 54 insertions, 0 deletions
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 1bed505a56..f9f5b26ea1 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -187,6 +187,7 @@
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libffi)
   #:use-module (gnu packages libidn)
+  #:use-module (gnu packages libusb)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages man)
@@ -16966,6 +16967,59 @@ as well.")
      @end itemize")
     (license license:bsd-3)))
 
+(define-public python-exodriver
+  (package
+    (name "python-exodriver")
+    (version "2.6.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/labjack/exodriver")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1ikjz8147p14s814yabdq821y691klnr2yg54zgsymcc97kvwp2q"))))
+    (outputs (list "out"
+                   "doc"))              ;544 KiB of examples
+    (build-system gnu-build-system)
+    (arguments
+     (list
+      #:tests? #f                       ;no test suite
+      #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
+                           (string-append "PREFIX=" #$output)
+                           "RUN_LDCONFIG=0"
+                           "LINK_SO=1")
+      #:phases
+      #~(modify-phases %standard-phases
+          (delete 'configure)
+          (replace 'build
+            (lambda* (#:key make-flags #:allow-other-keys #:rest args)
+              (with-directory-excursion "liblabjackusb"
+                (apply (assoc-ref %standard-phases 'build)
+                       `(,@args #:make-flags ,make-flags)))))
+          (replace 'install
+            (lambda* (#:key make-flags #:allow-other-keys #:rest args)
+              (with-directory-excursion "liblabjackusb"
+                (apply (assoc-ref %standard-phases 'install)
+                       `(,@args #:make-flags ,make-flags)))
+              ;; Install udev rules.
+              (install-file "90-labjack.rules"
+                            (string-append #$output "/lib/udev/rules.d"))
+              ;; Install examples.
+              (let ((doc (string-append #$output:doc "/share/doc/" #$name)))
+                (mkdir-p doc)
+                (copy-recursively "examples"
+                                  (string-append doc "/examples"))))))))
+    (inputs (list libusb))
+    (home-page "https://github.com/labjack/exodriver")
+    (synopsis "USB driver for LabJack data acquisition instruments")
+    (description "This package provides @code{liblabjackusb}, a USB library for low-level
+communication with the U3, U6, UE9, Digit, T4 and T7 LabJack data acquisition
+instruments.  A udev rule is also included to allow unprivileged users to
+communicate with the instruments via USB.")
+    (license license:expat)))           ;see README
+
 (define-public python-kivy-garden
   (package
     (name "python-kivy-garden")