Subject: [PATCH 2/3] gnu: packages: Add python-pulsectl.

From: Sergiu Ivanov <[email-masked]>
Date: Sun, 15 Jan 2023 23:49:58 +0100

>From b92cdb4ce99bc7ad45e0caba7f863db5931741db Mon Sep 17 00:00:00 2001
From: Sergiu Ivanov <[email-masked]>
Date: Sun, 15 Jan 2023 23:16:02 +0100
Subject: [PATCH 2/3] gnu: packages: Add python-pulsectl.

* gnu/packages/audio.scm (python-pulsectl): New variable.
---
 gnu/packages/audio.scm | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm
index d72cf0ca87..391a763e45 100644
--- a/gnu/packages/audio.scm
+++ b/gnu/packages/audio.scm
@@ -40,6 +40,7 @@
 ;;; Copyright © 2022 Juliana Sims <[email-masked]>
 ;;; Copyright © 2022 Simon Streit <[email-masked]>
 ;;; Copyright © 2022 Andy Tai <[email-masked]>
+;;; Copyright © 2023 Sergiu Ivanov <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -2779,6 +2780,39 @@ (define-public python-pyaudio
 cross-platform audio input/output stream library.")
     (license license:expat)))
 
+(define-public python-pulsectl
+  (package
+    (name "python-pulsectl")
+    (version "22.3.2")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "pulsectl" version))
+              (sha256
+               (base32
+                "115ha1cwpd2r84ssnxdbr59hgs0jbx0lz3xpqli64kmxxqf4w5yc"))))
+    (build-system python-build-system)
+    (inputs (list pulseaudio))
+    (arguments
+     `(#:tests? #f
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-path
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let ((pulse (assoc-ref inputs "pulseaudio")))
+               (substitute* "pulsectl/_pulsectl.py"
+                 (("libpulse.so.0")
+                  (string-append pulse "/lib/libpulse.so.0")))
+               #t))))))
+    (home-page "https://github.com/mk-fg/python-pulse-control")
+    (synopsis
+     "Python bindings for mixer-like controls in PulseAudio")
+    (description
+     "Python high-level interface and ctypes-based bindings for
+PulseAudio (libpulse), to use in simple synchronous code.  This wrapper is
+mostly for mixer-like controls and introspection-related operations, as
+opposed to e.g. submitting sound samples to play and player-like client.")
+    (license license:expat)))
+
 (define-public python-pyliblo
   (package
     (name "python-pyliblo")
-- 
2.38.1