summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorLeo Prikler <leo.prikler@student.tugraz.at>2021-05-30 18:06:49 +0200
committerLeo Prikler <leo.prikler@student.tugraz.at>2021-06-22 18:34:37 +0200
commit58932576263d728225b6f2b32635fb5161573769 (patch)
tree2914644fcbeeec532a9b9fc3efd6eef4c2d571a6 /gnu
parent6623d1cd7f3298f2e5c224299d11a77f7ae18bf5 (diff)
downloadguix-58932576263d728225b6f2b32635fb5161573769.tar.gz
gnu: Add python-soundfile.
* gnu/packages/audio.scm (python-soundfile): New variable.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/audio.scm35
1 files changed, 35 insertions, 0 deletions
diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm
index 3885a22e10..9b259edfdf 100644
--- a/gnu/packages/audio.scm
+++ b/gnu/packages/audio.scm
@@ -85,6 +85,7 @@
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
   #:use-module (gnu packages libbsd)
+  #:use-module (gnu packages libffi)
   #:use-module (gnu packages libusb)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages llvm)
@@ -2427,6 +2428,40 @@ included are the command line utilities @code{send_osc} and @code{dump_osc}.")
 (define-public python2-pyliblo
   (package-with-python2 python-pyliblo))
 
+(define-public python-soundfile
+  (package
+    (name "python-soundfile")
+    (version "0.10.3.post1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "SoundFile" version))
+       (sha256
+        (base32
+         "0yqhrfz7xkvqrwdxdx2ydy4h467sk7z3gf984y1x2cq7cm1gy329"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-cffi" ,python-cffi)
+       ("python-numpy" ,python-numpy)
+       ("libsndfile" ,libsndfile)))
+    (native-inputs
+     `(("python-pytest" ,python-pytest)))
+    (arguments
+     `(#:tests? #f ; missing OGG support
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "soundfile.py"
+               (("_find_library\\('sndfile'\\)")
+                (string-append "\"" (assoc-ref inputs "libsndfile")
+                               "/lib/libsndfile.so\""))))))))
+    (home-page "https://github.com/bastibe/SoundFile")
+    (synopsis "Python bindings for libsndfile")
+    (description "This package provides python bindings for libsndfile based on
+CFFI and NumPy.")
+    (license license:expat)))
+
 (define-public lilv
   (package
     (name "lilv")