From patchwork Thu Nov 25 04:42:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: jgart X-Patchwork-Id: 34801 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id CEBCB27BBEB; Thu, 25 Nov 2021 04:44:11 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 6E56B27BBEA for ; Thu, 25 Nov 2021 04:44:11 +0000 (GMT) Received: from localhost ([::1]:48254 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mq6cE-0003KJ-FH for patchwork@mira.cbaines.net; Wed, 24 Nov 2021 23:44:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57200) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mq6c7-0003Ji-9b for guix-patches@gnu.org; Wed, 24 Nov 2021 23:44:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:43940) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mq6c6-0003si-IY for guix-patches@gnu.org; Wed, 24 Nov 2021 23:44:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mq6c6-0006VO-F9 for guix-patches@gnu.org; Wed, 24 Nov 2021 23:44:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#49469] [PATCH v3] gnu: Add python-pysox. References: <0e7aba9bd4b403707a06597219700743@dismail.de> In-Reply-To: <0e7aba9bd4b403707a06597219700743@dismail.de> Resent-From: jgart Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 25 Nov 2021 04:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49469 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49469@debbugs.gnu.org Cc: jgart Received: via spool by 49469-submit@debbugs.gnu.org id=B49469.163781540624941 (code B ref 49469); Thu, 25 Nov 2021 04:44:02 +0000 Received: (at 49469) by debbugs.gnu.org; 25 Nov 2021 04:43:26 +0000 Received: from localhost ([127.0.0.1]:55483 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mq6bT-0006U8-8h for submit@debbugs.gnu.org; Wed, 24 Nov 2021 23:43:26 -0500 Received: from mx1.dismail.de ([78.46.223.134]:8941) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mq6bQ-0006Tv-Nk for 49469@debbugs.gnu.org; Wed, 24 Nov 2021 23:43:21 -0500 Received: from mx1.dismail.de (localhost [127.0.0.1]) by mx1.dismail.de (OpenSMTPD) with ESMTP id 5d15ef53 for <49469@debbugs.gnu.org>; Thu, 25 Nov 2021 05:43:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=dismail.de; h=from:to:cc :subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=20190914; bh=H1IvbxVFYpYXYRktujncs IDB8tBB/Hc9mYDL4VfW8I8=; b=hOvVKzodrrk4PsIfSIF53z+fJv3NZUPbLY5MU xRFa3Dey0fPOJ9iSvQG77DtRtV50A9x2NqDoXC0FHSXfZXetriRwKtk0SswBhs08 AITq5H3aFPFdFofoIdkGBLKHsG7iT+QAmDO5/oHnaktcJJnzplKz74Y+z9+egjVq 9wJslaUcgB3+zyIT7/MrU9AHIOMEK+y259PFTGFoy6Vc6ztHvbNGiy2K8hGanRYV xg1WJHL0f9YN2q30aoZIxKnOyc1S+cBd3A4uT+OFF3pfvWioQDoIhLsqvRVeQ5u9 YQTZ9UU5YfiVW4nJ3HDb2g6GeckyrGmhBldCZT1FgvqYhcgIA== Received: from smtp1.dismail.de ( [10.240.26.11]) by mx1.dismail.de (OpenSMTPD) with ESMTP id cd1c7ca8 for <49469@debbugs.gnu.org>; Thu, 25 Nov 2021 05:43:14 +0100 (CET) Received: from smtp1.dismail.de (localhost [127.0.0.1]) by smtp1.dismail.de (OpenSMTPD) with ESMTP id 6d0cb48b for <49469@debbugs.gnu.org>; Thu, 25 Nov 2021 05:43:13 +0100 (CET) Received: by dismail.de (OpenSMTPD) with ESMTPSA id e17de741 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Thu, 25 Nov 2021 05:43:08 +0100 (CET) Date: Wed, 24 Nov 2021 23:42:45 -0500 Message-Id: <20211125044245.25678-1-jgart@dismail.de> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: jgart X-ACL-Warn: , jgart via Guix-patches X-Patchwork-Original-From: jgart via Guix-patches via From: jgart X-getmail-retrieved-from-mailbox: Patches * 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 ;;; Copyright © 2020, 2021 Vinicius Monego ;;; Copyright © 2020 Michael Rohleder +;;; Copyright © 2021 jgart ;;; ;;; 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")