Subject: [bug#29678] [PATCH] gnu: qemu: Add pulseaudio support.

From: Oleg Pykhalov <[email-masked]>
Date: Wed, 31 Jan 2018 17:39:59 +0300

Hello Marius,

apologies for a long reply.  I fix a comment and have a question about
clojure.  Also a new patch is attached.

Marius Bakke <[email-masked]> writes:

> Oleg Pykhalov <[email-masked]> writes:
>
>> From 2eff4caca543d9909758a4f2eb6f953467a309d7 Mon Sep 17 00:00:00 2001
>> From: Oleg Pykhalov <[email-masked]>
>> Date: Fri, 8 Dec 2017 18:51:10 +0300
>> Subject: [PATCH] gnu: qemu: Add pulseaudio support.
>>
>> * gnu/packages/virtualization.scm (qemu): Add pulseaudio support.
>
> Please mention the change to [inputs] and [arguments] here.

OK.

[...]

>>         #:phases
>>         (modify-phases %standard-phases
>>           (replace 'configure
>> @@ -166,6 +171,7 @@
>>         ("ncurses" ,ncurses)
>>         ;; ("pciutils" ,pciutils)
>>         ("pixman" ,pixman)
>> +       ("pulseaudio" ,pulseaudio)
>
> I see pulseaudio is already in Qemus closure,

How do you see this?

Is that what do you use?
--8<---------------cut here---------------start------------->8---
guix graph --type=references pulseaudio | dot -Tsvg > pulseaudio.svg
--8<---------------cut here---------------end--------------->8---

> so this does not add anything.  LGTM!

Hm, seems it doesn't.
--8<---------------cut here---------------start------------->8---
starting phase `configure'

ERROR: pa check failed
       Make sure to have the pa libs and headers installed.

phase `configure' failed after 1.8 seconds
builder for `/gnu/store/zy7p2f4vhnmy154lmgjyhz26y41ngcjg-qemu-2.10.2.drv' failed with exit code 1
@ build-failed /gnu/store/zy7p2f4vhnmy154lmgjyhz26y41ngcjg-qemu-2.10.2.drv - 1 builder for `/gnu/store/zy7p2f4vhnmy154lmgjyhz26y41ngcjg-qemu-2.10.2.drv' failed with exit code 1
guix build: error: build failed: build of `/gnu/store/zy7p2f4vhnmy154lmgjyhz26y41ngcjg-qemu-2.10.2.drv' failed
--8<---------------cut here---------------end--------------->8---

[...]

From 69c18f461f6a00c7dd25b86e50be95a38d0ca445 Mon Sep 17 00:00:00 2001
From: Oleg Pykhalov <[email-masked]>
Date: Fri, 8 Dec 2017 18:51:10 +0300
Subject: [PATCH] gnu: qemu: Add pulseaudio support.

* gnu/packages/virtualization.scm (qemu)[arguments]: Add pulseaudio support.
[inputs]: Add pulseaudio.
---
 gnu/packages/virtualization.scm | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index f4fd4c336..97263382d 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -52,6 +52,7 @@
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-web)
+  #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages selinux)
   #:use-module (gnu packages sdl)
   #:use-module (gnu packages spice)
@@ -96,10 +97,13 @@
      '(;; Running tests in parallel can occasionally lead to failures, like:
        ;; boot_sector_test: assertion failed (signature == SIGNATURE): (0x00000000 == 0x0000dead)
        #:parallel-tests? #f
-       #:configure-flags (list "--enable-usb-redir" "--enable-opengl"
-                               (string-append "--smbd="
-                                              (assoc-ref %outputs "out")
-                                              "/libexec/samba-wrapper"))
+       #:configure-flags
+       (list "--enable-usb-redir"
+             "--enable-opengl"
+             (string-append "--smbd=" (assoc-ref %outputs "out")
+                            "/libexec/samba-wrapper")
+             (string-append "--audio-drv-list="
+                            (string-join (list "alsa" "pa" "sdl") ",")))
        #:phases
        (modify-phases %standard-phases
          (replace 'configure
@@ -181,6 +185,7 @@ exec smbd $@")))
        ("ncurses" ,ncurses)
        ;; ("pciutils" ,pciutils)
        ("pixman" ,pixman)
+       ("pulseaudio" ,pulseaudio)
        ("sdl" ,sdl)
        ("spice" ,spice)
        ("usbredir" ,usbredir)
-- 
2.15.1

Thanks,
Oleg.