diff mbox series

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

Message ID a566a0b0d88642fdd856f3a115c95b6afad1204a.1698771987.git.sughosha@disroot.org
State New
Headers show
Series gnu: Add stargate | expand

Commit Message

Sughosha Oct. 31, 2023, 5:08 p.m. UTC
* gnu/packages/python-xyz.scm (python-wavefile): New variable.

Change-Id: I147c1bc9a71b4d304f31d2184e863e1c141bae40
---
 gnu/packages/python-xyz.scm | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 6001e7e6eb..53e57f8b49 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,39 @@  (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")))))))
+    (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")