unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: jgart via Guix-patches via <guix-patches@gnu.org>
To: 49469@debbugs.gnu.org
Cc: jgart <jgart@dismail.de>
Subject: [bug#49469] [PATCH v3] gnu: Add python-pysox.
Date: Wed, 24 Nov 2021 23:42:45 -0500	[thread overview]
Message-ID: <20211125044245.25678-1-jgart@dismail.de> (raw)
In-Reply-To: <0e7aba9bd4b403707a06597219700743@dismail.de>

* gnu/packages/audio.scm (python-pysox): New variable.
---
 gnu/packages/audio.scm | 56 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)

diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm
index 4b1a602804..694ea1a21b 100644
--- a/gnu/packages/audio.scm
+++ b/gnu/packages/audio.scm
@@ -34,6 +34,7 @@
 ;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
 ;;; Copyright © 2020, 2021 Vinicius Monego <monego@posteo.net>
 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
+;;; Copyright © 2021 jgart <jgart@dismail.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -5532,6 +5533,61 @@ (define-public siggen
 device.  There is support for mono and/or stereo and 8 or 16 bit samples.")
     (license license:gpl2)))
 
+(define-public python-pysox
+  ;; PyPi does not include the data folder containing audio files for testing.
+  (let ((commit "3d0053381c24ae3490f759d4de87194b85789d36")
+        (revision "0"))
+    (package
+      (name "python-pysox")
+      (version (git-version "1.4.2" revision commit))
+      (source
+        (origin
+          (method git-fetch)
+          (uri (git-reference
+                 (url "https://github.com/rabitt/pysox")
+                 (commit commit)))
+          (file-name (git-file-name name version))
+          (sha256
+            (base32
+              "0i62jx92vfpcr2z7lp69yzqdi9idfs3pifl3rzm2akc2c4cr1mac"))))
+      (build-system python-build-system)
+      (arguments
+        `(#:phases
+          (modify-phases %standard-phases
+            (add-after 'unpack 'patch-sox
+              (lambda* (#:key inputs #:allow-other-keys)
+                (let* ((sox-store-path (assoc-ref inputs "sox"))
+                       (sox-bin (string-append sox-store-path "/bin/sox")))
+                  (substitute* "sox/__init__.py"
+                    (("sox -h")
+                     (string-append sox-bin " -h")))
+                  (substitute* "sox/core.py"
+                    (("\\['sox")
+                     (string-append "['" sox-bin))))))
+            (replace 'check
+              (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+                (when tests?
+                  (add-installed-pythonpath inputs outputs)
+                  (invoke "pytest")))))))
+      (propagated-inputs
+        `(("python-numpy" ,python-numpy)
+          ("python-typing-extensions" ,python-typing-extensions)))
+      (native-inputs
+        `(("sox" ,sox)
+          ("python-pytest" ,python-pytest)
+          ("python-pytest-cov" ,python-pytest-cov)
+          ("python-soundfile" ,python-soundfile)))
+      (home-page "https://github.com/rabitt/pysox")
+      (synopsis "Python wrapper around SoX")
+      (description
+"@code{python-pysox} is a wrapper around the @command{sox} command
+line tool.  The API offers @code{Transformer} and @code{Combiner}
+classes that allow the user to incrementally build up effects and audio
+manipulations.  @code{python-pysox} also provides methods for querying
+audio information such as sample rate, determining whether an audio file
+is silent, and much more.")
+      (license license:bsd-3))))
+
 (define-public mda-lv2
   (package
     (name "mda-lv2")
-- 
2.34.0





      parent reply	other threads:[~2021-11-25  4:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-08 18:45 [bug#49469] [PATCH] gnu: Add python-pysox jgart via Guix-patches via
2021-07-08 19:35 ` jgart via Guix-patches via
2021-10-09 15:20   ` Arun Isaac
2021-10-10  6:15 ` [bug#49469] jgart via Guix-patches via
2021-10-10  6:15   ` [bug#49469] [PATCH] gnu: Add python-pysox jgart via Guix-patches via
2021-10-16 10:02 ` Arun Isaac
2021-10-16 10:05 ` Arun Isaac
2021-11-24 16:25 ` Arun Isaac
2021-11-25  4:33   ` jgart via Guix-patches via
2021-11-25  4:46     ` jgart via Guix-patches via
2021-11-29 16:12     ` bug#49469: " Arun Isaac
2021-11-25  4:42 ` jgart via Guix-patches via [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211125044245.25678-1-jgart@dismail.de \
    --to=guix-patches@gnu.org \
    --cc=49469@debbugs.gnu.org \
    --cc=jgart@dismail.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).