summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorDanny Milosavljevic <dannym@scratchpost.org>2018-03-25 19:25:31 +0200
committerDanny Milosavljevic <dannym@scratchpost.org>2018-03-25 19:26:27 +0200
commit9b36e3bf25cf5df94858ac5860e2e7ad8239aa31 (patch)
tree5444ee4a83181c36eb3da1d1341f068b5f6829bf /gnu
parenta4e7215df2530978a7764813270af311b2d2dd63 (diff)
downloadguix-9b36e3bf25cf5df94858ac5860e2e7ad8239aa31.tar.gz
gnu: Add python-parted.
* gnu/packages/disk.scm (python-parted, python2-parted): New variables.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/disk.scm40
1 files changed, 40 insertions, 0 deletions
diff --git a/gnu/packages/disk.scm b/gnu/packages/disk.scm
index 756a9f5451..96c3a56e7e 100644
--- a/gnu/packages/disk.scm
+++ b/gnu/packages/disk.scm
@@ -416,3 +416,43 @@ capacity of a flash card (flash drive, flash disk, pendrive).  F3 writes to
 the card and then checks if can read it.  It will assure you haven't been sold
 a card with a smaller capacity than stated.")
     (license license:gpl3+)))
+
+(define-public python-parted
+  (package
+    (name "python-parted")
+    (version "3.11.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://github.com/dcantrell/pyparted/archive/v"
+                           version ".tar.gz"))
+       (sha256
+        (base32
+         "0r1nyjj40nacnfnv17x2mnsj6ga1qplyxyza82v2809dfhim2fwq"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (delete 'check)
+         (add-after 'install 'check
+           (lambda* (#:key outputs inputs #:allow-other-keys)
+             (add-installed-pythonpath inputs outputs)
+             ;; See <https://github.com/dcantrell/pyparted/issues/47>.
+             (substitute* "tests/test__ped_ped.py"
+               (("\"/tmp/temp-device-\"") "self.path"))
+             (invoke "python" "-m" "unittest" "discover" "-v")
+             #t)))))
+    (native-inputs
+     `(("e2fsprogs" ,e2fsprogs)
+       ("pkg-config" ,pkg-config)))
+    (propagated-inputs
+     `(("python-six" ,python-six)))
+    (inputs
+     `(("parted" ,parted)))
+    (home-page "https://github.com/dcantrell/pyparted")
+    (synopsis "Parted bindings for Python")
+    (description "This package provides @code{parted} bindings for Python.")
+    (license license:gpl2+)))
+
+(define-public python2-parted
+  (package-with-python2 python-parted))