summary refs log tree commit diff
diff options
context:
space:
mode:
authorDanny Milosavljevic <dannym@scratchpost.org>2018-08-12 20:26:34 +0200
committerDanny Milosavljevic <dannym@scratchpost.org>2018-08-29 17:18:28 +0200
commitac94ccb9b43186264e1cb3aa0c337b1e13772cca (patch)
tree7fab6c868615d37b93a6f620e57fff88311ca84c
parentc7fe888b424faec05a0d55e8b9321d6852ffb1f2 (diff)
downloadguix-ac94ccb9b43186264e1cb3aa0c337b1e13772cca.tar.gz
gnu: Add python-pyudev.
* gnu/packages/admin.scm (python-pyudev): New variable.
-rw-r--r--gnu/packages/admin.scm39
1 files changed, 39 insertions, 0 deletions
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index c9230c3295..b372cd0079 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -2750,3 +2750,42 @@ support forum.  It runs with the @code{/exec} command in most IRC clients.")
     (description
      "@code{pscircle} visualizes Linux processes in the form of a radial tree.")
     (license license:gpl2+)))
+
+(define-public python-pyudev
+  (package
+    (name "python-pyudev")
+    (version "0.21.0")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (pypi-uri "pyudev" version))
+        (sha256
+          (base32
+            "0arz0dqp75sszsmgm6vhg92n1lsx91ihddx3m944f4ah0487ljq9"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:tests? #f ; Tests require /sys
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-ctypes-udev
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((eudev (assoc-ref inputs "eudev")))
+               (substitute* "src/pyudev/core.py"
+                (("'udev'")
+                 (string-append "'" eudev "/lib/libudev.so'")))
+               (substitute* "src/pyudev/_ctypeslib/utils.py"
+                ;; Use absolute paths instead of keys.
+                (("= find_library") "= "))
+               #t))))))
+    (inputs
+     `(("eudev" ,eudev)))
+    (native-inputs
+     `(("python-docutils" ,python-docutils)
+       ("python-hypothesis" ,python-hypothesis)
+       ("python-mock" ,python-mock)
+       ("python-pytest" ,python-pytest)
+       ("python-sphinx" ,python-sphinx)))
+    (home-page "http://pyudev.readthedocs.org/")
+    (synopsis "Python udev binding")
+    (description "This package provides @code{udev} bindings for Python.")
+    (license license:lgpl2.1)))