35d499522b697137e46627430acaf7cc18ce97bc
[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 ;;;
12 ;;; This file is part of GNU Guix.
13 ;;;
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
15 ;;; under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation; either version 3 of the License, or (at
17 ;;; your option) any later version.
18 ;;;
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
20 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;;; GNU General Public License for more details.
23 ;;;
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26
27 (define-module (gnu packages pulseaudio)
28 #:use-module (guix packages)
29 #:use-module (guix download)
30 #:use-module ((guix licenses) #:prefix l:)
31 #:use-module (guix build-system gnu)
32 #:use-module (guix build-system python)
33 #:use-module (gnu packages)
34 #:use-module (gnu packages algebra)
35 #:use-module (gnu packages audio)
36 #:use-module (gnu packages autotools)
37 #:use-module (gnu packages avahi)
38 #:use-module (gnu packages check)
39 #:use-module (gnu packages databases)
40 #:use-module (gnu packages glib)
41 #:use-module (gnu packages gtk)
42 #:use-module (gnu packages libcanberra)
43 #:use-module (gnu packages web)
44 #:use-module (gnu packages linux)
45 #:use-module (gnu packages m4)
46 #:use-module (gnu packages pkg-config)
47 #:use-module (gnu packages xiph))
48
49 (define-public libsndfile
50 (package
51 (name "libsndfile")
52 (version "1.0.28")
53 (source (origin
54 (method url-fetch)
55 (uri (string-append "http://www.mega-nerd.com/libsndfile/files/libsndfile-"
56 version ".tar.gz"))
57 (patches (search-patches "libsndfile-armhf-type-checks.patch"
58 "libsndfile-CVE-2017-8361-8363-8365.patch"
59 "libsndfile-CVE-2017-8362.patch"
60 "libsndfile-CVE-2017-12562.patch"))
61 (sha256
62 (base32
63 "1afzm7jx34jhqn32clc5xghyjglccam2728yxlx37yj2y0lkkwqz"))))
64 (build-system gnu-build-system)
65 (inputs
66 `(("libvorbis" ,libvorbis)
67 ("libogg" ,libogg)
68 ("flac" ,flac)))
69 (native-inputs
70 `(("pkg-config" ,pkg-config)))
71 (home-page "http://www.mega-nerd.com/libsndfile/")
72 (synopsis "Reading and writing files containing sampled sound")
73 (description
74 "Libsndfile is a C library for reading and writing files containing
75 sampled sound (such as MS Windows WAV and the Apple/SGI AIFF format) through
76 one standard library interface.
77
78 It was designed to handle both little-endian (such as WAV) and
79 big-endian (such as AIFF) data, and to compile and run correctly on
80 little-endian (such as Intel and DEC/Compaq Alpha) processor systems as well
81 as big-endian processor systems such as Motorola 68k, Power PC, MIPS and
82 SPARC. Hopefully the design of the library will also make it easy to extend
83 for reading and writing new sound file formats.")
84 (license l:gpl2+)))
85
86 (define-public libsamplerate
87 (package
88 (name "libsamplerate") ; aka. Secret Rabbit Code (SRC)
89 (version "0.1.9")
90 (source (origin
91 (method url-fetch)
92 (uri (string-append "http://www.mega-nerd.com/SRC/libsamplerate-"
93 version ".tar.gz"))
94 (sha256
95 (base32
96 "1ha46i0nbibq0pl0pjwcqiyny4hj8lp1bnl4dpxm64zjw9lb2zha"))))
97 (build-system gnu-build-system)
98 (native-inputs
99 `(("pkg-config" ,pkg-config)))
100 (propagated-inputs
101 `(("libsndfile" ,libsndfile)
102 ("fftw" ,fftw)))
103 (home-page "http://www.mega-nerd.com/SRC/index.html")
104 (synopsis "Audio sample rate conversion library")
105 (description
106 "Secret Rabbit Code (aka. libsamplerate) is a Sample Rate Converter for
107 audio. One example of where such a thing would be useful is converting audio
108 from the CD sample rate of 44.1kHz to the 48kHz sample rate used by DAT
109 players.
110
111 SRC is capable of arbitrary and time varying conversions; from downsampling by
112 a factor of 256 to upsampling by the same factor. Arbitrary in this case means
113 that the ratio of input and output sample rates can be an irrational
114 number. The conversion ratio can also vary with time for speeding up and
115 slowing down effects.
116
117 SRC provides a small set of converters to allow quality to be traded off
118 against computation cost. The current best converter provides a
119 signal-to-noise ratio of 145dB with -3dB passband extending from DC to 96% of
120 the theoretical best bandwidth for a given pair of input and output sample
121 rates.")
122 (license l:bsd-2)))
123
124 (define-public pulseaudio
125 (package
126 (name "pulseaudio")
127 (version "12.2")
128 (source (origin
129 (method url-fetch)
130 (uri (string-append
131 "https://freedesktop.org/software/pulseaudio/releases/"
132 name "-" version ".tar.xz"))
133 (sha256
134 (base32
135 "0ma0p8iry7fil7qb4pm2nx2pm65kq9hk9xc4r5wkf14nqbzni5l0"))
136 (modules '((guix build utils)))
137 (snippet
138 ;; Disable console-kit support by default since it's deprecated
139 ;; anyway.
140 '(begin
141 (substitute* "src/daemon/default.pa.in"
142 (("load-module module-console-kit" all)
143 (string-append "#" all "\n")))
144 #t))
145 (patches (search-patches
146 "pulseaudio-fix-mult-test.patch"
147 "pulseaudio-longer-test-timeout.patch"))))
148 (build-system gnu-build-system)
149 (arguments
150 `(#:configure-flags (list "--localstatedir=/var" ;"--sysconfdir=/etc"
151 "--disable-oss-output"
152 "--enable-bluez5"
153 (string-append "--with-udev-rules-dir="
154 (assoc-ref %outputs "out")
155 "/lib/udev/rules.d"))
156 #:phases (modify-phases %standard-phases
157 (add-before 'check 'pre-check
158 (lambda _
159 ;; 'tests/lock-autospawn-test.c' wants to create a file
160 ;; under ~/.config/pulse.
161 (setenv "HOME" (getcwd))
162 ;; 'thread-test' needs more time on hydra and on slower
163 ;; machines, so we set the default timeout to 120 seconds.
164 (setenv "CK_DEFAULT_TIMEOUT" "120")
165 #t)))))
166 (inputs
167 ;; TODO: Add optional inputs (GTK+?).
168 `(("alsa-lib" ,alsa-lib)
169 ("bluez" ,bluez)
170 ("sbc" ,sbc)
171 ("speexdsp" ,speexdsp)
172 ("libsndfile" ,libsndfile)
173 ("jack" ,jack-1) ; For routing the output to jack.
174 ("dbus" ,dbus)
175 ("glib" ,glib)
176 ("libltdl" ,libltdl)
177 ("fftwf" ,fftwf)
178 ("avahi" ,avahi)
179 ("eudev" ,eudev))) ;for the detection of hardware audio devices
180 (native-inputs
181 `(("check" ,check)
182 ("glib:bin" ,glib "bin")
183 ("intltool" ,intltool)
184 ("m4" ,m4)
185 ("pkg-config" ,pkg-config)))
186 (propagated-inputs
187 ;; 'libpulse*.la' contain `-lgdbm' and `-lcap', so propagate them.
188 `(("libcap" ,libcap)
189 ("gdbm" ,gdbm)))
190 (home-page "http://www.pulseaudio.org/")
191 (synopsis "Sound server")
192 (description
193 "PulseAudio is a sound server. It is basically a proxy for your sound
194 applications. It allows you to do advanced operations on your sound data as
195 it passes between your application and your hardware. Things like
196 transferring the audio to a different machine, changing the sample format or
197 channel count and mixing several sounds into one are easily achieved using a
198 sound server.")
199
200 ;; PulseAudio is LGPLv2+, but some of the optional dependencies (GNU dbm,
201 ;; FFTW, etc.) are GPL'd, so the result is effectively GPLv2+. See
202 ;; 'LICENSE' for details.
203 (license l:gpl2+)))
204
205 (define-public pavucontrol
206 (package
207 (name "pavucontrol")
208 (version "3.0")
209 (source (origin
210 (method url-fetch)
211 (uri (string-append
212 "https://freedesktop.org/software/pulseaudio/pavucontrol/pavucontrol-"
213 version
214 ".tar.xz"))
215 (sha256
216 (base32
217 "14486c6lmmirkhscbfygz114f6yzf97h35n3h3pdr27w4mdfmlmk"))))
218 (build-system gnu-build-system)
219 (arguments
220 '(#:configure-flags '("CXXFLAGS=-std=c++11"))) ; required by gtkmm
221 (inputs
222 `(("libcanberra" ,libcanberra)
223 ("gtkmm" ,gtkmm)
224 ("pulseaudio" ,pulseaudio)))
225 (native-inputs
226 `(("intltool" ,intltool)
227 ("pkg-config" ,pkg-config)))
228 (home-page "https://www.freedesktop.org/software/pulseaudio/pavucontrol/")
229 (synopsis "PulseAudio volume control")
230 (description
231 "PulseAudio Volume Control (pavucontrol) provides a GTK+
232 graphical user interface to connect to a PulseAudio server and
233 easily control the volume of all clients, sinks, etc.")
234 (license l:gpl2+)))
235
236 (define-public ponymix
237 (package
238 (name "ponymix")
239 (version "5")
240 (source (origin
241 (method url-fetch)
242 (uri (string-append "https://github.com/falconindy/ponymix/"
243 "archive/" version ".tar.gz"))
244 (sha256
245 (base32
246 "1c0ch98zry3c4ixywwynjid1n1nh4xl4l1p548giq2w3zwflaghn"))
247 (file-name (string-append name "-" version ".tar.gz"))))
248 (build-system gnu-build-system)
249 (arguments
250 `(#:tests? #f ; There is no test suite.
251 #:make-flags (let ((out (assoc-ref %outputs "out")))
252 (list (string-append "DESTDIR=" out)))
253 #:phases
254 (modify-phases %standard-phases
255 (add-after 'unpack 'patch-paths
256 (lambda _
257 (substitute* "Makefile"
258 (("/usr") ""))))
259 (delete 'configure)))) ; There's no configure phase.
260 (inputs
261 `(("pulseaudio" ,pulseaudio)))
262 (native-inputs
263 `(("pkg-config" ,pkg-config)))
264 (home-page "https://github.com/falconindy/ponymix")
265 (synopsis "Console-based PulseAudio mixer")
266 (description "Ponymix is a PulseAudio mixer and volume controller with a
267 command-line interface. In addition, it is possible to use named sources and
268 sinks.")
269 (license l:expat)))
270
271 (define-public pulsemixer
272 (package
273 (name "pulsemixer")
274 (version "1.4.0")
275 (source (origin
276 (method url-fetch)
277 (uri (string-append "https://github.com/GeorgeFilipkin/"
278 "pulsemixer/archive/" version ".tar.gz"))
279 (file-name (string-append name "-" version ".tar.gz"))
280 (sha256
281 (base32
282 "1lpad90ifr2xfldyf39sbwx1v85rif2gm9w774gwwpjv53zfgk1g"))))
283 (build-system python-build-system)
284 (arguments
285 `(#:phases
286 (modify-phases %standard-phases
287 (add-after 'unpack 'patch-path
288 (lambda* (#:key inputs #:allow-other-keys)
289 (let ((pulse (assoc-ref inputs "pulseaudio")))
290 (substitute* "pulsemixer"
291 (("libpulse.so.0")
292 (string-append pulse "/lib/libpulse.so.0")))
293 #t))))))
294 (inputs
295 `(("pulseaudio" ,pulseaudio)))
296 (home-page "https://github.com/GeorgeFilipkin/pulsemixer/")
297 (synopsis "Command-line and curses mixer for PulseAudio")
298 (description "Pulsemixer is a PulseAudio mixer with command-line and
299 curses-style interfaces.")
300 (license l:expat)))