gnu: emacs-undo-tree: Update to 0.7.
[jackhill/guix/guix.git] / gnu / packages / pulseaudio.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
6 ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
7 ;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
8 ;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
9 ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
10 ;;; Copyright © 2018 Pierre Langlois <pierre.langlois@gmx.com>
11 ;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
12 ;;;
13 ;;; This file is part of GNU Guix.
14 ;;;
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
19 ;;;
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
24 ;;;
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27
28 (define-module (gnu packages pulseaudio)
29 #:use-module (guix packages)
30 #:use-module (guix download)
31 #:use-module (guix git-download)
32 #:use-module ((guix licenses) #:prefix l:)
33 #:use-module (guix build-system gnu)
34 #:use-module (guix build-system python)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages algebra)
37 #:use-module (gnu packages audio)
38 #:use-module (gnu packages autotools)
39 #:use-module (gnu packages avahi)
40 #:use-module (gnu packages check)
41 #:use-module (gnu packages dbm)
42 #:use-module (gnu packages glib)
43 #:use-module (gnu packages gtk)
44 #:use-module (gnu packages libcanberra)
45 #:use-module (gnu packages web)
46 #:use-module (gnu packages linux)
47 #:use-module (gnu packages m4)
48 #:use-module (gnu packages protobuf)
49 #:use-module (gnu packages python)
50 #:use-module (gnu packages python-xyz)
51 #:use-module (gnu packages python-web)
52 #:use-module (gnu packages pkg-config)
53 #:use-module (gnu packages xiph)
54 #:use-module (gnu packages xorg))
55
56 (define-public libsndfile
57 (package
58 (name "libsndfile")
59 (version "1.0.28")
60 (source (origin
61 (method url-fetch)
62 (uri (string-append "http://www.mega-nerd.com/libsndfile/files/libsndfile-"
63 version ".tar.gz"))
64 (patches (search-patches "libsndfile-armhf-type-checks.patch"
65 "libsndfile-CVE-2017-8361-8363-8365.patch"
66 "libsndfile-CVE-2017-8362.patch"
67 "libsndfile-CVE-2017-12562.patch"))
68 (sha256
69 (base32
70 "1afzm7jx34jhqn32clc5xghyjglccam2728yxlx37yj2y0lkkwqz"))))
71 (build-system gnu-build-system)
72 (inputs
73 `(("libvorbis" ,libvorbis)
74 ("libogg" ,libogg)
75 ("flac" ,flac)))
76 (native-inputs
77 `(("pkg-config" ,pkg-config)))
78 (home-page "http://www.mega-nerd.com/libsndfile/")
79 (synopsis "Reading and writing files containing sampled sound")
80 (description
81 "Libsndfile is a C library for reading and writing files containing
82 sampled sound (such as MS Windows WAV and the Apple/SGI AIFF format) through
83 one standard library interface.
84
85 It was designed to handle both little-endian (such as WAV) and
86 big-endian (such as AIFF) data, and to compile and run correctly on
87 little-endian (such as Intel and DEC/Compaq Alpha) processor systems as well
88 as big-endian processor systems such as Motorola 68k, Power PC, MIPS and
89 SPARC. Hopefully the design of the library will also make it easy to extend
90 for reading and writing new sound file formats.")
91 (license l:gpl2+)))
92
93 (define-public libsamplerate
94 (package
95 (name "libsamplerate") ; aka. Secret Rabbit Code (SRC)
96 (version "0.1.9")
97 (source (origin
98 (method url-fetch)
99 (uri (string-append "http://www.mega-nerd.com/SRC/libsamplerate-"
100 version ".tar.gz"))
101 (sha256
102 (base32
103 "1ha46i0nbibq0pl0pjwcqiyny4hj8lp1bnl4dpxm64zjw9lb2zha"))))
104 (build-system gnu-build-system)
105 (native-inputs
106 `(("pkg-config" ,pkg-config)))
107 (propagated-inputs
108 `(("libsndfile" ,libsndfile)
109 ("fftw" ,fftw)))
110 (home-page "http://www.mega-nerd.com/SRC/index.html")
111 (synopsis "Audio sample rate conversion library")
112 (description
113 "Secret Rabbit Code (aka. libsamplerate) is a Sample Rate Converter for
114 audio. One example of where such a thing would be useful is converting audio
115 from the CD sample rate of 44.1kHz to the 48kHz sample rate used by DAT
116 players.
117
118 SRC is capable of arbitrary and time varying conversions; from downsampling by
119 a factor of 256 to upsampling by the same factor. Arbitrary in this case means
120 that the ratio of input and output sample rates can be an irrational
121 number. The conversion ratio can also vary with time for speeding up and
122 slowing down effects.
123
124 SRC provides a small set of converters to allow quality to be traded off
125 against computation cost. The current best converter provides a
126 signal-to-noise ratio of 145dB with -3dB passband extending from DC to 96% of
127 the theoretical best bandwidth for a given pair of input and output sample
128 rates.")
129 (license l:bsd-2)))
130
131 (define-public pulseaudio
132 (package
133 (name "pulseaudio")
134 (version "13.0")
135 (source (origin
136 (method url-fetch)
137 (uri (string-append
138 "https://freedesktop.org/software/pulseaudio/releases/"
139 name "-" version ".tar.xz"))
140 (sha256
141 (base32
142 "0mw0ybrqj7hvf8lqs5gjzip464hfnixw453lr0mqzlng3b5266wn"))
143 (modules '((guix build utils)))
144 (snippet
145 ;; Disable console-kit support by default since it's deprecated
146 ;; anyway.
147 '(begin
148 (substitute* "src/daemon/default.pa.in"
149 (("load-module module-console-kit" all)
150 (string-append "#" all "\n")))
151 #t))
152 (patches (search-patches
153 "pulseaudio-fix-mult-test.patch"
154 "pulseaudio-longer-test-timeout.patch"))))
155 (build-system gnu-build-system)
156 (arguments
157 `(#:configure-flags (list "--localstatedir=/var" ;"--sysconfdir=/etc"
158 "--disable-oss-output"
159 "--enable-bluez5"
160 (string-append "--with-udev-rules-dir="
161 (assoc-ref %outputs "out")
162 "/lib/udev/rules.d"))
163 #:phases (modify-phases %standard-phases
164 (add-before 'check 'pre-check
165 (lambda _
166 ;; 'tests/lock-autospawn-test.c' wants to create a file
167 ;; under ~/.config/pulse.
168 (setenv "HOME" (getcwd))
169 ;; 'thread-test' needs more time on hydra and on slower
170 ;; machines, so we set the default timeout to 120 seconds.
171 (setenv "CK_DEFAULT_TIMEOUT" "120")
172 #t)))))
173 (inputs
174 ;; TODO: Add optional inputs (GTK+?).
175 `(("alsa-lib" ,alsa-lib)
176 ("bluez" ,bluez)
177 ("sbc" ,sbc)
178 ("speexdsp" ,speexdsp)
179 ("libsndfile" ,libsndfile)
180 ("jack" ,jack-1) ; For routing the output to jack.
181 ("dbus" ,dbus)
182 ("glib" ,glib)
183 ("libltdl" ,libltdl)
184 ("fftwf" ,fftwf)
185 ("avahi" ,avahi)
186
187 ;; For the optional X11 modules.
188 ("libice" ,libice)
189 ("libsm" ,libsm)
190 ("libxcb" ,libxcb)
191 ("libxtst" ,libxtst)
192
193 ("eudev" ,eudev))) ;for the detection of hardware audio devices
194 (native-inputs
195 `(("check" ,check)
196 ("glib:bin" ,glib "bin")
197 ("intltool" ,intltool)
198 ("m4" ,m4)
199 ("pkg-config" ,pkg-config)))
200 (propagated-inputs
201 ;; 'libpulse*.la' contain `-lgdbm' and `-lcap', so propagate them.
202 `(("libcap" ,libcap)
203 ("gdbm" ,gdbm)))
204 (home-page "http://www.pulseaudio.org/")
205 (synopsis "Sound server")
206 (description
207 "PulseAudio is a sound server. It is basically a proxy for your sound
208 applications. It allows you to do advanced operations on your sound data as
209 it passes between your application and your hardware. Things like
210 transferring the audio to a different machine, changing the sample format or
211 channel count and mixing several sounds into one are easily achieved using a
212 sound server.")
213
214 ;; PulseAudio is LGPLv2+, but some of the optional dependencies (GNU dbm,
215 ;; FFTW, etc.) are GPL'd, so the result is effectively GPLv2+. See
216 ;; 'LICENSE' for details.
217 (license l:gpl2+)))
218
219 (define-public pavucontrol
220 (package
221 (name "pavucontrol")
222 (version "3.0")
223 (source (origin
224 (method url-fetch)
225 (uri (string-append
226 "https://freedesktop.org/software/pulseaudio/pavucontrol/pavucontrol-"
227 version
228 ".tar.xz"))
229 (sha256
230 (base32
231 "14486c6lmmirkhscbfygz114f6yzf97h35n3h3pdr27w4mdfmlmk"))))
232 (build-system gnu-build-system)
233 (inputs
234 `(("libcanberra" ,libcanberra)
235 ("gtkmm" ,gtkmm)
236 ("pulseaudio" ,pulseaudio)))
237 (native-inputs
238 `(("intltool" ,intltool)
239 ("pkg-config" ,pkg-config)))
240 (home-page "https://www.freedesktop.org/software/pulseaudio/pavucontrol/")
241 (synopsis "PulseAudio volume control")
242 (description
243 "PulseAudio Volume Control (pavucontrol) provides a GTK+
244 graphical user interface to connect to a PulseAudio server and
245 easily control the volume of all clients, sinks, etc.")
246 (license l:gpl2+)))
247
248 (define-public ponymix
249 (package
250 (name "ponymix")
251 (version "5")
252 (source (origin
253 (method url-fetch)
254 (uri (string-append "https://github.com/falconindy/ponymix/"
255 "archive/" version ".tar.gz"))
256 (sha256
257 (base32
258 "1c0ch98zry3c4ixywwynjid1n1nh4xl4l1p548giq2w3zwflaghn"))
259 (file-name (string-append name "-" version ".tar.gz"))))
260 (build-system gnu-build-system)
261 (arguments
262 `(#:tests? #f ; There is no test suite.
263 #:make-flags (let ((out (assoc-ref %outputs "out")))
264 (list (string-append "DESTDIR=" out)))
265 #:phases
266 (modify-phases %standard-phases
267 (add-after 'unpack 'patch-paths
268 (lambda _
269 (substitute* "Makefile"
270 (("/usr") ""))))
271 (delete 'configure)))) ; There's no configure phase.
272 (inputs
273 `(("pulseaudio" ,pulseaudio)))
274 (native-inputs
275 `(("pkg-config" ,pkg-config)))
276 (home-page "https://github.com/falconindy/ponymix")
277 (synopsis "Console-based PulseAudio mixer")
278 (description "Ponymix is a PulseAudio mixer and volume controller with a
279 command-line interface. In addition, it is possible to use named sources and
280 sinks.")
281 (license l:expat)))
282
283 (define-public pulsemixer
284 (package
285 (name "pulsemixer")
286 (version "1.4.0")
287 (source (origin
288 (method url-fetch)
289 (uri (string-append "https://github.com/GeorgeFilipkin/"
290 "pulsemixer/archive/" version ".tar.gz"))
291 (file-name (string-append name "-" version ".tar.gz"))
292 (sha256
293 (base32
294 "1lpad90ifr2xfldyf39sbwx1v85rif2gm9w774gwwpjv53zfgk1g"))))
295 (build-system python-build-system)
296 (arguments
297 `(#:phases
298 (modify-phases %standard-phases
299 (add-after 'unpack 'patch-path
300 (lambda* (#:key inputs #:allow-other-keys)
301 (let ((pulse (assoc-ref inputs "pulseaudio")))
302 (substitute* "pulsemixer"
303 (("libpulse.so.0")
304 (string-append pulse "/lib/libpulse.so.0")))
305 #t))))))
306 (inputs
307 `(("pulseaudio" ,pulseaudio)))
308 (home-page "https://github.com/GeorgeFilipkin/pulsemixer/")
309 (synopsis "Command-line and curses mixer for PulseAudio")
310 (description "Pulsemixer is a PulseAudio mixer with command-line and
311 curses-style interfaces.")
312 (license l:expat)))
313
314 (define-public pulseaudio-dlna
315 ;; The last release was in 2016; use a more recent commit.
316 (let ((commit "4472928dd23f274193f14289f59daec411023ab0")
317 (revision "1"))
318 (package
319 (name "pulseaudio-dlna")
320 (version (git-version "0.5.2" revision commit))
321 (source
322 (origin
323 (method git-fetch)
324 (uri (git-reference
325 (url "https://github.com/masmu/pulseaudio-dlna.git")
326 (commit commit)))
327 (file-name (git-file-name name version))
328 (sha256
329 (base32
330 "1dfn7036vrq49kxv4an7rayypnm5dlawsf02pfsldw877hzdamqk"))))
331 (build-system python-build-system)
332 (arguments `(#:python ,python-2))
333 (inputs
334 `(("python2-chardet" ,python2-chardet)
335 ("python2-dbus" ,python2-dbus)
336 ("python2-docopt" ,python2-docopt)
337 ("python2-futures" ,python2-futures)
338 ("python2-pygobject" ,python2-pygobject)
339 ("python2-lxml" ,python2-lxml)
340 ("python2-netifaces" ,python2-netifaces)
341 ("python2-notify2" ,python2-notify2)
342 ("python2-protobuf" ,python2-protobuf)
343 ("python2-psutil" ,python2-psutil)
344 ("python2-requests" ,python2-requests)
345 ("python2-pyroute2" ,python2-pyroute2)
346 ("python2-setproctitle" ,python2-setproctitle)
347 ("python2-zeroconf" ,python2-zeroconf)))
348 (home-page "https://github.com/masmu/pulseaudio-dlna")
349 (synopsis "Stream audio to DLNA/UPnP and Chromecast devices")
350 (description "This lightweight streaming server brings DLNA/UPnP and
351 Chromecast support to PulseAudio. It can stream your current PulseAudio
352 playback to different UPnP devices (UPnP Media Renderers, including Sonos
353 devices and some Smart TVs) or Chromecasts in your network. You should also
354 install one or more of the following packages alongside pulseaudio-dlna:
355
356 @itemize
357 @item ffmpeg - transcoding support for multiple codecs
358 @item flac - FLAC transcoding support
359 @item lame - MP3 transcoding support
360 @item opus-tools - Opus transcoding support
361 @item sox - WAV transcoding support
362 @item vorbis-tools - Vorbis transcoding support
363 @end itemize")
364 (license l:gpl3+))))