Revert "doc: Drop documentation of deprecated procedures."
[jackhill/guix/guix.git] / gnu / packages / pulseaudio.scm
CommitLineData
37bfb448 1;;; GNU Guix --- Functional package management for GNU
3246cc91 2;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
4373278e 3;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
37bfb448
LC
4;;;
5;;; This file is part of GNU Guix.
6;;;
7;;; GNU Guix is free software; you can redistribute it and/or modify it
8;;; under the terms of the GNU General Public License as published by
9;;; the Free Software Foundation; either version 3 of the License, or (at
10;;; your option) any later version.
11;;;
12;;; GNU Guix is distributed in the hope that it will be useful, but
13;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;;; GNU General Public License for more details.
16;;;
17;;; You should have received a copy of the GNU General Public License
18;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20(define-module (gnu packages pulseaudio)
21 #:use-module (guix packages)
22 #:use-module (guix download)
b5b73a82 23 #:use-module ((guix licenses) #:prefix l:)
37bfb448 24 #:use-module (guix build-system gnu)
b645425f 25 #:use-module (gnu packages)
54ff0b7d 26 #:use-module (gnu packages algebra)
38cf2ba0 27 #:use-module (gnu packages autotools)
37bfb448 28 #:use-module (gnu packages avahi)
54ff0b7d 29 #:use-module (gnu packages check)
b416aadf 30 #:use-module (gnu packages databases)
37bfb448 31 #:use-module (gnu packages glib)
66fb2d23
LC
32 #:use-module (gnu packages gtk)
33 #:use-module (gnu packages libcanberra)
f6ad09ae 34 #:use-module (gnu packages web)
54ff0b7d 35 #:use-module (gnu packages linux)
37bfb448 36 #:use-module (gnu packages m4)
54ff0b7d
AE
37 #:use-module (gnu packages pkg-config)
38 #:use-module (gnu packages xiph)
37bfb448
LC
39 #:export (libsndfile
40 libsamplerate
37bfb448
LC
41 pulseaudio))
42
43(define libsndfile
44 (package
45 (name "libsndfile")
4373278e 46 (version "1.0.26")
37bfb448
LC
47 (source (origin
48 (method url-fetch)
49 (uri (string-append "http://www.mega-nerd.com/libsndfile/files/libsndfile-"
50 version ".tar.gz"))
51 (sha256
52 (base32
4373278e 53 "14jhla289cj45946h0hq2an0a9g4wkwb3v4571bla6ixfvn20rfd"))))
37bfb448
LC
54 (build-system gnu-build-system)
55 (inputs
56 `(("libvorbis" ,libvorbis)
57 ("libogg" ,libogg)
d7e92b87
ML
58 ("flac" ,flac)))
59 (native-inputs
60 `(("pkg-config" ,pkg-config)))
37bfb448
LC
61 (home-page "http://www.mega-nerd.com/libsndfile/")
62 (synopsis "Reading and writing files containing sampled sound")
63 (description
64 "Libsndfile is a C library for reading and writing files containing
65sampled sound (such as MS Windows WAV and the Apple/SGI AIFF format) through
66one standard library interface.
67
68It was designed to handle both little-endian (such as WAV) and
69big-endian (such as AIFF) data, and to compile and run correctly on
70little-endian (such as Intel and DEC/Compaq Alpha) processor systems as well
71as big-endian processor systems such as Motorola 68k, Power PC, MIPS and
72SPARC. Hopefully the design of the library will also make it easy to extend
73for reading and writing new sound file formats.")
74 (license l:gpl2+)))
75
76(define libsamplerate
77 (package
78 (name "libsamplerate") ; aka. Secret Rabbit Code (SRC)
79 (version "0.1.8")
80 (source (origin
81 (method url-fetch)
82 (uri (string-append "http://www.mega-nerd.com/SRC/libsamplerate-"
83 version ".tar.gz"))
84 (sha256
85 (base32
86 "01hw5xjbjavh412y63brcslj5hi9wdgkjd3h9csx5rnm8vglpdck"))))
87 (build-system gnu-build-system)
d7e92b87
ML
88 (native-inputs
89 `(("pkg-config" ,pkg-config)))
37bfb448
LC
90 (propagated-inputs
91 `(("libsndfile" ,libsndfile)
92 ("fftw" ,fftw)))
93 (home-page "http://www.mega-nerd.com/SRC/index.html")
94 (synopsis "Audio sample rate conversion library")
95 (description
96 "Secret Rabbit Code (aka. libsamplerate) is a Sample Rate Converter for
97audio. One example of where such a thing would be useful is converting audio
98from the CD sample rate of 44.1kHz to the 48kHz sample rate used by DAT
99players.
100
101SRC is capable of arbitrary and time varying conversions; from downsampling by
102a factor of 256 to upsampling by the same factor. Arbitrary in this case means
103that the ratio of input and output sample rates can be an irrational
104number. The conversion ratio can also vary with time for speeding up and
105slowing down effects.
106
107SRC provides a small set of converters to allow quality to be traded off
108against computation cost. The current best converter provides a
109signal-to-noise ratio of 145dB with -3dB passband extending from DC to 96% of
110the theoretical best bandwidth for a given pair of input and output sample
e881752c 111rates.")
37bfb448
LC
112 (license l:gpl2+)))
113
37bfb448
LC
114(define pulseaudio
115 (package
116 (name "pulseaudio")
5a74d239 117 (version "6.0")
37bfb448
LC
118 (source (origin
119 (method url-fetch)
120 (uri (string-append
121 "http://freedesktop.org/software/pulseaudio/releases/pulseaudio-"
122 version ".tar.xz"))
123 (sha256
124 (base32
5a74d239 125 "1xpnfxa0d8pgf6b4qdgnkcvrvdxbbbjd5ync19h0f5hbp3h401mm"))
3f9d63df
LC
126 (modules '((guix build utils)))
127 (snippet
128 ;; Disable console-kit support by default since it's deprecated
129 ;; anyway.
130 '(substitute* "src/daemon/default.pa.in"
131 (("load-module module-console-kit" all)
1d1efa6c 132 (string-append "#" all "\n"))))
f6e7e20b
MW
133 (patches
134 (list (search-patch "pulseaudio-fix-mult-test.patch")
135 (search-patch "pulseaudio-longer-test-timeout.patch")))))
37bfb448
LC
136 (build-system gnu-build-system)
137 (arguments
5a74d239
LC
138 `(#:configure-flags (list "--localstatedir=/var" ;"--sysconfdir=/etc"
139 "--disable-oss-output"
140 (string-append "--with-udev-rules-dir="
141 (assoc-ref %outputs "out")
142 "/lib/udev/rules.d"))
37bfb448
LC
143 #:phases (alist-cons-before
144 'check 'pre-check
145 (lambda _
146 ;; 'tests/lock-autospawn-test.c' wants to create a file
147 ;; under ~/.config/pulse.
b0364911
MW
148 (setenv "HOME" (getcwd))
149 ;; 'thread-test' needs more time on hydra and on slower
150 ;; machines, so we set the default timeout to 120 seconds.
151 (setenv "CK_DEFAULT_TIMEOUT" "120"))
f5ac2352 152 %standard-phases)))
37bfb448
LC
153 (inputs
154 ;; TODO: Add optional inputs (GTK+?).
155 `(;; ("sbc" ,sbc)
156 ("alsa-lib" ,alsa-lib)
157 ("json-c" ,json-c)
158 ("speex" ,speex)
159 ("libsndfile" ,libsndfile)
160 ("libsamplerate" ,libsamplerate)
161 ("dbus" ,dbus)
162 ("glib" ,glib)
163 ("intltool" ,intltool)
37bfb448 164 ("m4" ,m4)
3246cc91 165 ("libltdl" ,libltdl)
7569c5cb 166 ("fftwf" ,fftwf)
37bfb448 167 ("avahi" ,avahi)
5a74d239 168 ("eudev" ,eudev) ;for the detection of hardware audio devices
37bfb448 169 ("check" ,check)))
d7e92b87
ML
170 (native-inputs
171 `(("pkg-config" ,pkg-config)))
37bfb448
LC
172 (propagated-inputs
173 ;; 'libpulse*.la' contain `-lgdbm' and `-lcap', so propagate them.
09767fb5 174 `(("libcap" ,libcap)
37bfb448
LC
175 ("gdbm" ,gdbm)))
176 (home-page "http://www.pulseaudio.org/")
177 (synopsis "Sound server")
178 (description
e881752c
AK
179 "PulseAudio is a sound server. It is basically a proxy for your sound
180applications. It allows you to do advanced operations on your sound data as
181it passes between your application and your hardware. Things like
182transferring the audio to a different machine, changing the sample format or
183channel count and mixing several sounds into one are easily achieved using a
184sound server.")
37bfb448
LC
185
186 ;; PulseAudio is LGPLv2+, but some of the optional dependencies (GNU dbm,
187 ;; FFTW, etc.) are GPL'd, so the result is effectively GPLv2+. See
188 ;; 'LICENSE' for details.
189 (license l:gpl2+)))
66fb2d23
LC
190
191(define-public pavucontrol
192 (package
193 (name "pavucontrol")
08cc159a 194 (version "3.0")
66fb2d23
LC
195 (source (origin
196 (method url-fetch)
197 (uri (string-append
198 "http://freedesktop.org/software/pulseaudio/pavucontrol/pavucontrol-"
199 version
200 ".tar.xz"))
201 (sha256
202 (base32
08cc159a 203 "14486c6lmmirkhscbfygz114f6yzf97h35n3h3pdr27w4mdfmlmk"))))
66fb2d23 204 (build-system gnu-build-system)
d8c317df
SB
205 (arguments
206 '(#:configure-flags '("CXXFLAGS=-std=c++11"))) ; required by gtkmm
66fb2d23 207 (inputs
c4c4cc05 208 `(("libcanberra" ,libcanberra)
66fb2d23 209 ("gtkmm" ,gtkmm)
c4c4cc05
JD
210 ("pulseaudio" ,pulseaudio)))
211 (native-inputs
212 `(("intltool" ,intltool)
66fb2d23
LC
213 ("pkg-config" ,pkg-config)))
214 (home-page "http://freedesktop.org/software/pulseaudio/pavucontrol/")
215 (synopsis "PulseAudio volume control")
216 (description
217 "PulseAudio Volume Control (pavucontrol) provides a GTK+
218graphical user interface to connect to a PulseAudio server and
219easily control the volume of all clients, sinks, etc.")
220 (license l:gpl2+)))