From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:38871) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipjR9-0006vB-EK for guix-patches@gnu.org; Thu, 09 Jan 2020 20:50:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipjR7-0002Qk-1y for guix-patches@gnu.org; Thu, 09 Jan 2020 20:50:07 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:47430) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ipjR6-0002Pi-UV for guix-patches@gnu.org; Thu, 09 Jan 2020 20:50:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ipjR6-0003kJ-T0 for guix-patches@gnu.org; Thu, 09 Jan 2020 20:50:04 -0500 Subject: [bug#39065] [PATCH 4/6] services: Split ladspa-service-type from pulseaudio-service-type. Resent-Message-ID: Received: from eggs.gnu.org ([2001:470:142:3::10]:36893) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipjQc-0006NB-Ea for guix-patches@gnu.org; Thu, 09 Jan 2020 20:49:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipjQb-0007rY-1Y for guix-patches@gnu.org; Thu, 09 Jan 2020 20:49:34 -0500 Received: from mailrelay.tugraz.at ([129.27.2.202]:3689) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ipjQa-0007lk-MK for guix-patches@gnu.org; Thu, 09 Jan 2020 20:49:32 -0500 From: Leo Prikler Date: Fri, 10 Jan 2020 02:48:22 +0100 Message-Id: <20200110014823.10595-4-leo.prikler@student.tugraz.at> In-Reply-To: <87blrc1epy.fsf@devup.no> References: <87blrc1epy.fsf@devup.no> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 39065@debbugs.gnu.org Cc: 39053@debbugs.gnu.org * gnu/services/sound.scm (ladspa-configuration): New record. (ladspa-environment): New procedure. (ladspa-service-type): New service type. (pulseaudio-environment): Remove LADSPA_PATH. * doc/guix.texi: Adjust documentation. --- doc/guix.texi | 20 +++++++++++--------- gnu/services/sound.scm | 33 ++++++++++++++++++++++++++++++++- 2 files changed, 43 insertions(+), 10 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 60491af4d4..431895aa7d 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -15951,19 +15951,21 @@ pcm.!default @{ See @uref{https://www.alsa-project.org/main/index.php/Asoundrc} for the details. =20 -@deffn {Scheme Variable} pulseaudio-service-type -This is the type for the @uref{http://www.pulseaudio.org/, PulseAudio -sound server}, which sets the @var{LADSPA_PATH} environment variable to -allow PulseAudio load modules from @code{swh-plugins} package. +@deffn {Scheme Variable} ladspa-service-type +This service sets the @var{LADSPA_PATH} variable, so that programs, whic= h +respect it, e.g. PulseAudio, can load LADSPA plugins. =20 -See @uref{http://plugin.org.uk/ladspa-swh/docs/ladspa-swh.html} for the -details. - -The following example will setup the service: +The following example will setup the service to enable modules from the +@code{swh-plugins} package: =20 @lisp -(service pulseaudio-service-type) +(service ladspa-service-type + (ladspa-configuration (plugins (list swh-plugins)))) @end lisp + +See @uref{http://plugin.org.uk/ladspa-swh/docs/ladspa-swh.html} for the +details. + @end deffn =20 @node Database Services diff --git a/gnu/services/sound.scm b/gnu/services/sound.scm index 5d72b3ada2..64b45f585f 100644 --- a/gnu/services/sound.scm +++ b/gnu/services/sound.scm @@ -35,7 +35,10 @@ alsa-service-type =20 pulseaudio-configuration - pulseaudio-service-type)) + pulseaudio-service-type + + ladspa-configuration + ladspa-service-type)) =20 ;;; Commentary: ;;; @@ -162,4 +165,32 @@ ctl.!default { (default-value (pulseaudio-configuration)) (description "Configure PulseAudio sound support."))) =20 +=0C +;;; +;;; LADSPA +;;; + +(define-record-type* + ladspa-configuration make-ladspa-configuration + ladspa-configuration? + (plugins ladspa-plugins (default '()))) + +(define (ladspa-environment config) + ;; Define this variable in the global environment such that + ;; pulseaudio swh-plugins (and similar LADSPA plugins) work. + `(("LADSPA_PATH" . + (string-join + ',(map (lambda (package) (file-append package "/lib/ladspa")) + (ladspa-plugins config)) + ":")))) + +(define ladspa-service-type + (service-type + (name 'ladspa) + (extensions + (list (service-extension session-environment-service-type + ladspa-environment))) + (default-value (ladspa-configuration)) + (description "Configure LADSPA plugins."))) + ;;; sound.scm ends here --=20 2.24.1