From patchwork Sun Oct 10 06:15:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jgart X-Patchwork-Id: 33725 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 9BE6F27BBE3; Sun, 10 Oct 2021 07:17:12 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 1A55C27BBE1 for ; Sun, 10 Oct 2021 07:17:12 +0100 (BST) Received: from localhost ([::1]:60834 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mZS91-0002BU-3L for patchwork@mira.cbaines.net; Sun, 10 Oct 2021 02:17:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58754) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mZS8t-0002Au-GQ for guix-patches@gnu.org; Sun, 10 Oct 2021 02:17:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42826) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mZS8s-0002Dq-WA for guix-patches@gnu.org; Sun, 10 Oct 2021 02:17:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mZS8s-0005pe-SV for guix-patches@gnu.org; Sun, 10 Oct 2021 02:17:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49469] [PATCH] gnu: Add python-pysox. Resent-From: jgart Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 10 Oct 2021 06:17: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.163384659922375 (code B ref 49469); Sun, 10 Oct 2021 06:17:02 +0000 Received: (at 49469) by debbugs.gnu.org; 10 Oct 2021 06:16:39 +0000 Received: from localhost ([127.0.0.1]:54371 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZS8V-0005oo-9W for submit@debbugs.gnu.org; Sun, 10 Oct 2021 02:16:39 -0400 Received: from mx1.dismail.de ([78.46.223.134]:13699) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mZS8T-0005oF-MM for 49469@debbugs.gnu.org; Sun, 10 Oct 2021 02:16:38 -0400 Received: from mx1.dismail.de (localhost [127.0.0.1]) by mx1.dismail.de (OpenSMTPD) with ESMTP id 1c03a14d for <49469@debbugs.gnu.org>; Sun, 10 Oct 2021 08:16:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=dismail.de; h=from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=20190914; bh=18BYfmUjgynDPvBZ9uGxK sn6XkSdloXb8SWIbPjARNk=; b=iTq2mvTkTZbMYSyqsieEE47Odb/H+vtCPhGVG RdLzFDYqu4GH3A1OLO+vQDhv0QAABcVFEuCpNYzs/x+83bO05GYuQw3T/zdEndPd YTMywvCMYa2IM64I77sRWjsFnCzacfzvXAVkrgedbj4UnDj0PpFGxxbP3olvC844 s6h5axySQenxXPZIqvujPKA0Rmoz9jpDGZ9waWpXnqfGViYAV5kVHt/vUWRivxRL b66SMa7GVThZLiqjoB4cjCqM9s7sxBx02SR9dDTvlw0Czsxut/WQeBm1a3tUjaQI YwZWCobkOmNMcJtCsYuxob+yK0LK9YFEPTICiF8OCxJyUdALA== Received: from smtp1.dismail.de ( [10.240.26.11]) by mx1.dismail.de (OpenSMTPD) with ESMTP id 223d22bf for <49469@debbugs.gnu.org>; Sun, 10 Oct 2021 08:16:37 +0200 (CEST) Received: from smtp1.dismail.de (localhost [127.0.0.1]) by smtp1.dismail.de (OpenSMTPD) with ESMTP id 77496984 for <49469@debbugs.gnu.org>; Sun, 10 Oct 2021 08:16:37 +0200 (CEST) Received: by dismail.de (OpenSMTPD) with ESMTPSA id dc94610f (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Sun, 10 Oct 2021 08:16:36 +0200 (CEST) Date: Sun, 10 Oct 2021 02:15:04 -0400 Message-Id: <20211010061525.11302-2-jgart@dismail.de> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211010061525.11302-1-jgart@dismail.de> References: <20211010061525.11302-1-jgart@dismail.de> 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 | 57 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm index cc51ac51f3..8b412a63d1 100644 --- a/gnu/packages/audio.scm +++ b/gnu/packages/audio.scm @@ -2429,6 +2429,63 @@ compensation, (de)interleaving, and byte-swapping ;; original developer. (license license:expat))) +(define-public python-pysox + (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))) + (substitute* "sox/log.py" + (("Logger\\('sox") + (string-append "Logger\('" sox-bin)))))) + (replace 'check + (lambda* (#:key inputs outputs tests? #:allow-other-keys) + (when tests? + (add-installed-pythonpath inputs outputs) + (setenv "PYTHONPATH" (string-append ".:" (getenv "PYTHONPATH"))) + (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{pysox} is a wrapper around the @command{sox} command line tool. + pysox's API offers @code{Transformer} and @code{Combiner} classes that allow the user to +incrementally build up effects and audio manipulations. @code{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 python-pyaudio (package (name "python-pyaudio")