[PATCH] gnu: Add python-pyalsaaudio.

  • Done
  • quality assurance status badge
Details
2 participants
  • Danny Milosavljevic
  • 宋文武
Owner
unassigned
Submitted by
Danny Milosavljevic
Severity
normal

Debbugs page

Danny Milosavljevic wrote 8 years ago
(address . guix-patches@gnu.org)(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
20170818145128.13605-1-dannym@scratchpost.org
* gnu/packages/audio.scm (python-pyalsaaudio, python2-pyalsaaudio): New
variables.
---
gnu/packages/audio.scm | 44 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)

Toggle diff (52 lines)
diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm
index 40700cae3..5897e5f18 100644
--- a/gnu/packages/audio.scm
+++ b/gnu/packages/audio.scm
@@ -2906,3 +2906,47 @@ code, used in @code{libtoxcore}.")
06.10 RPE-LTP lossy speech compression algorithm.")
(home-page "http://quut.com/gsm/")
(license (license:non-copyleft "file://COPYRIGHT"))))
+
+(define-public python-pyalsaaudio
+ (package
+ (name "python-pyalsaaudio")
+ (version "0.8.4")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "pyalsaaudio" version))
+ (sha256
+ (base32
+ "1180ypn9596rq4b7y7dyv627j1q0fqilmkkrckclnzsdakdgis44"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:tests? #f ; FIXME
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'check 'setup-alsa
+ (lambda _
+ (mkdir-p "/tmp/foo")
+ (setenv "HOME" "/tmp/foo")
+ ;; TODO use snd-dummy kernel module.
+ (call-with-output-file "/tmp/foo/.asoundrc"
+ (lambda (port)
+ (format port "
+pcm.!default {
+ type hw
+ card 0
+}
+ctl.!default {
+ type hw
+ card 0
+}
+")))
+ #t)))))
+ (inputs
+ `(("alsa-lib" ,alsa-lib)))
+ (home-page "http://larsimmisch.github.io/pyalsaaudio/")
+ (synopsis "ALSA bindings for Python")
+ (description "@code{pyalsaaudio} provides ALSA bindings for Python.")
+ (license license:psfl)))
+
+(define-public python2-pyalsaaudio
+ (package-with-python2 python-pyalsaaudio))
宋文武 wrote 8 years ago
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 28137@debbugs.gnu.org)
87shgis9kn.fsf@member.fsf.org
Hello!

Danny Milosavljevic <dannym@scratchpost.org> writes:

Toggle quote (50 lines)
> * gnu/packages/audio.scm (python-pyalsaaudio, python2-pyalsaaudio): New
> variables.
> ---
> gnu/packages/audio.scm | 44 ++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 44 insertions(+)
>
> diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm
> index 40700cae3..5897e5f18 100644
> --- a/gnu/packages/audio.scm
> +++ b/gnu/packages/audio.scm
> @@ -2906,3 +2906,47 @@ code, used in @code{libtoxcore}.")
> 06.10 RPE-LTP lossy speech compression algorithm.")
> (home-page "http://quut.com/gsm/")
> (license (license:non-copyleft "file://COPYRIGHT"))))
> +
> +(define-public python-pyalsaaudio
> + (package
> + (name "python-pyalsaaudio")
> + (version "0.8.4")
> + (source
> + (origin
> + (method url-fetch)
> + (uri (pypi-uri "pyalsaaudio" version))
> + (sha256
> + (base32
> + "1180ypn9596rq4b7y7dyv627j1q0fqilmkkrckclnzsdakdgis44"))))
> + (build-system python-build-system)
> + (arguments
> + `(#:tests? #f ; FIXME
> + #:phases
> + (modify-phases %standard-phases
> + (add-before 'check 'setup-alsa
> + (lambda _
> + (mkdir-p "/tmp/foo")
> + (setenv "HOME" "/tmp/foo")
> + ;; TODO use snd-dummy kernel module.
> + (call-with-output-file "/tmp/foo/.asoundrc"
> + (lambda (port)
> + (format port "
> +pcm.!default {
> + type hw
> + card 0
> +}
> +ctl.!default {
> + type hw
> + card 0
> +}
> +")))
> + #t)))))

Do you managed to pass these tests with snd-dummy loaded? I think there
is no way to load kernel modules to the builder, how about simply leave
a comment?


Toggle quote (7 lines)
> + (inputs
> + `(("alsa-lib" ,alsa-lib)))
> + (home-page "http://larsimmisch.github.io/pyalsaaudio/")
> + (synopsis "ALSA bindings for Python")
> + (description "@code{pyalsaaudio} provides ALSA bindings for
> Python.")

Its README.md file provides more description.


Here is my update for this patch:
From f0e9259f84c7d1bd46ea6ac8b588c8daa6f654e4 Mon Sep 17 00:00:00 2001
From: Danny Milosavljevic <dannym@scratchpost.org>
Date: Fri, 18 Aug 2017 16:51:28 +0200
Subject: [PATCH] gnu: Add python-pyalsaaudio.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/audio.scm (python-pyalsaaudio, python2-pyalsaaudio): New
variables.

Signed-off-by: 宋文武 <iyzsong@member.fsf.org>
---
gnu/packages/audio.scm | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)

Toggle diff (36 lines)
diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm
index 40700cae3..5d88a5935 100644
--- a/gnu/packages/audio.scm
+++ b/gnu/packages/audio.scm
@@ -2906,3 +2906,29 @@ code, used in @code{libtoxcore}.")
06.10 RPE-LTP lossy speech compression algorithm.")
(home-page "http://quut.com/gsm/")
(license (license:non-copyleft "file://COPYRIGHT"))))
+
+(define-public python-pyalsaaudio
+ (package
+ (name "python-pyalsaaudio")
+ (version "0.8.4")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri "pyalsaaudio" version))
+ (sha256
+ (base32
+ "1180ypn9596rq4b7y7dyv627j1q0fqilmkkrckclnzsdakdgis44"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:tests? #f)) ; tests require access to ALSA devices.
+ (inputs
+ `(("alsa-lib" ,alsa-lib)))
+ (home-page "http://larsimmisch.github.io/pyalsaaudio/")
+ (synopsis "ALSA wrappers for Python")
+ (description
+ "This package contains wrappers for accessing the ALSA API from Python.
+It is currently fairly complete for PCM devices, and has some support for
+mixers.")
+ (license license:psfl)))
+
+(define-public python2-pyalsaaudio
+ (package-with-python2 python-pyalsaaudio))
--
2.13.3
Danny Milosavljevic wrote 8 years ago
(name . 宋文武)(address . iyzsong@member.fsf.org)(address . 28137@debbugs.gnu.org)
20170829082009.1ff1307d@scratchpost.org
Hi,

On Wed, 23 Aug 2017 21:22:16 +0800
iyzsong@member.fsf.org (宋文武) wrote:

Toggle quote (2 lines)
> Do you managed to pass these tests with snd-dummy loaded?

No. I should have marked the patch WIP.

Toggle quote (4 lines)
>I think there
> is no way to load kernel modules to the builder, how about simply leave
> a comment?

Yeah.

Toggle quote (12 lines)
> > + (inputs
> > + `(("alsa-lib" ,alsa-lib)))
> > + (home-page "http://larsimmisch.github.io/pyalsaaudio/")
> > + (synopsis "ALSA bindings for Python")
> > + (description "@code{pyalsaaudio} provides ALSA bindings for
> > Python.")
>
> Its README.md file provides more description.
>
>
> Here is my update for this patch:

Thanks! LGTM!
宋文武 wrote 8 years ago
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 28137-done@debbugs.gnu.org)
87a82ivap1.fsf@member.fsf.org
Danny Milosavljevic <dannym@scratchpost.org> writes:

Toggle quote (4 lines)
>> Here is my update for this patch:
>
> Thanks! LGTM!

Pushed, thanks!
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 28137@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 28137
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help