diff mbox series

[bug#65367,v2,1/4] gnu: Add python-wavefile.

Message ID 3171b057e4ae222ea4c0785bc8835901f876a54c.1698759715.git.sughosha@disroot.org
State New
Headers show
Series gnu: Add stargate. | expand

Commit Message

Sughosha Oct. 31, 2023, 1:44 p.m. UTC
* gnu/packages/python-xyz.scm (python-wavefile): New variable.
---
 gnu/packages/python-xyz.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 6001e7e6eb..85930b1fad 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -169,6 +169,7 @@  (define-module (gnu packages python-xyz)
   #:use-module (gnu packages algebra)
   #:use-module (gnu packages astronomy)
   #:use-module (gnu packages attr)
+  #:use-module (gnu packages audio)
   #:use-module (gnu packages backup)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bash)
@@ -236,6 +237,7 @@  (define-module (gnu packages python-xyz)
   #:use-module (gnu packages photo)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages protobuf)
+  #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-build)
   #:use-module (gnu packages python-check)
@@ -1801,6 +1803,41 @@  (define-public python-pymediainfo
 access the technical and tag data for video and audio files.")
     (license license:expat)))
 
+(define-public python-wavefile
+  (package
+    (name "python-wavefile")
+    (version "1.6.2")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "wavefile" version))
+              (sha256
+               (base32
+                "04mdcxq7n1vnwb9y65j0cwpy91ik5rh9vki1f45xqnh4ygz91n75"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'patch-libsndfile-path
+                 (lambda* (#:key inputs #:allow-other-keys)
+                   (substitute* "wavefile/libsndfile.py"
+                     (("libsndfile\\.so")
+                      (search-input-file inputs "/lib/libsndfile.so")))))
+               (add-before 'check 'check-setup
+                 (lambda _
+                   (setenv "HOME" "/tmp")
+                   (setenv "LD_LIBRARY_PATH" (getenv "LIBRARY_PATH")))))))
+    (native-inputs
+     (list python-pytest))
+    (inputs
+     (list libsndfile portaudio))
+    (propagated-inputs (list python-numpy python-pyaudio))
+    (home-page "https://github.com/vokimon/python-wavefile")
+    (synopsis "Pythonic audio file reader and writer")
+    (description
+     "This package provides pythonic libsndfile wrapper to read and write audio
+files.")
+    (license license:gpl3+)))
+
 (define-public python-psutil
   (package
     (name "python-psutil")