Subject: [PATCH v2 2/4] gnu: pulseaudio: Graft to adjust configuration.

From: Maxim Cournoyer <[email-masked]>
Date: Thu, 24 Feb 2022 11:38:26 -0500

* gnu/packages/pulseaudio.scm (pulseaudio/fixed): New variable.
(pulseaudio)[replacement]: Graft package with it.
---
 gnu/packages/pulseaudio.scm | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/gnu/packages/pulseaudio.scm b/gnu/packages/pulseaudio.scm
index fe028b5202..c1b3d33d4a 100644
--- a/gnu/packages/pulseaudio.scm
+++ b/gnu/packages/pulseaudio.scm
@@ -178,6 +178,7 @@ (define-public libsamplerate
 (define-public pulseaudio
   (package
     (name "pulseaudio")
+    (replacement pulseaudio/fixed)
     (version "15.0")
     (source (origin
              (method url-fetch)
@@ -269,6 +270,22 @@ (define-public pulseaudio
     ;; 'LICENSE' for details.
     (license l:gpl2+)))
 
+(define pulseaudio/fixed
+  (package
+    (inherit pulseaudio)
+    (arguments
+     (substitute-keyword-arguments (package-arguments pulseaudio)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (add-after 'unpack 'customize-default-script
+             (lambda _
+               (substitute* "src/daemon/default.pa.in"
+                 (("^\\.include.*default.pa.d.*" anchor)
+                  (string-append
+                   ;; Honor PulseAudio script extensions found under
+                   ;; /etc/pulse/default.pa.d.
+                   anchor ".include /etc/pulse/default.pa.d\n")))))))))))
+
 (define-public pavucontrol
   (package
     (name "pavucontrol")
-- 
2.34.0