gnu: Add iml.
[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>
9dd61217 4;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
de1b319d 5;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
3cd959a4 6;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
efc95e7b 7;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
05bdb5e6 8;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
27a976ed 9;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
d5e60a2a 10;;; Copyright © 2018 Pierre Langlois <pierre.langlois@gmx.com>
37bfb448
LC
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)
b5b73a82 30 #:use-module ((guix licenses) #:prefix l:)
37bfb448 31 #:use-module (guix build-system gnu)
df71c88c 32 #:use-module (guix build-system python)
b645425f 33 #:use-module (gnu packages)
54ff0b7d 34 #:use-module (gnu packages algebra)
d5e60a2a 35 #:use-module (gnu packages audio)
38cf2ba0 36 #:use-module (gnu packages autotools)
37bfb448 37 #:use-module (gnu packages avahi)
54ff0b7d 38 #:use-module (gnu packages check)
255d1bbe 39 #:use-module (gnu packages dbm)
37bfb448 40 #:use-module (gnu packages glib)
66fb2d23
LC
41 #:use-module (gnu packages gtk)
42 #:use-module (gnu packages libcanberra)
f6ad09ae 43 #:use-module (gnu packages web)
54ff0b7d 44 #:use-module (gnu packages linux)
37bfb448 45 #:use-module (gnu packages m4)
54ff0b7d 46 #:use-module (gnu packages pkg-config)
0160458b 47 #:use-module (gnu packages xiph))
37bfb448 48
0160458b 49(define-public libsndfile
37bfb448
LC
50 (package
51 (name "libsndfile")
3cd959a4 52 (version "1.0.28")
37bfb448
LC
53 (source (origin
54 (method url-fetch)
55 (uri (string-append "http://www.mega-nerd.com/libsndfile/files/libsndfile-"
56 version ".tar.gz"))
d1a91408
RW
57 (patches (search-patches "libsndfile-armhf-type-checks.patch"
58 "libsndfile-CVE-2017-8361-8363-8365.patch"
1cbdfede
MW
59 "libsndfile-CVE-2017-8362.patch"
60 "libsndfile-CVE-2017-12562.patch"))
37bfb448
LC
61 (sha256
62 (base32
3cd959a4 63 "1afzm7jx34jhqn32clc5xghyjglccam2728yxlx37yj2y0lkkwqz"))))
37bfb448
LC
64 (build-system gnu-build-system)
65 (inputs
66 `(("libvorbis" ,libvorbis)
67 ("libogg" ,libogg)
d7e92b87
ML
68 ("flac" ,flac)))
69 (native-inputs
70 `(("pkg-config" ,pkg-config)))
37bfb448
LC
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
75sampled sound (such as MS Windows WAV and the Apple/SGI AIFF format) through
76one standard library interface.
77
78It was designed to handle both little-endian (such as WAV) and
79big-endian (such as AIFF) data, and to compile and run correctly on
80little-endian (such as Intel and DEC/Compaq Alpha) processor systems as well
81as big-endian processor systems such as Motorola 68k, Power PC, MIPS and
82SPARC. Hopefully the design of the library will also make it easy to extend
83for reading and writing new sound file formats.")
84 (license l:gpl2+)))
85
0160458b 86(define-public libsamplerate
37bfb448
LC
87 (package
88 (name "libsamplerate") ; aka. Secret Rabbit Code (SRC)
e1f68c96 89 (version "0.1.9")
37bfb448
LC
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
e1f68c96 96 "1ha46i0nbibq0pl0pjwcqiyny4hj8lp1bnl4dpxm64zjw9lb2zha"))))
37bfb448 97 (build-system gnu-build-system)
d7e92b87
ML
98 (native-inputs
99 `(("pkg-config" ,pkg-config)))
37bfb448
LC
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
107audio. One example of where such a thing would be useful is converting audio
108from the CD sample rate of 44.1kHz to the 48kHz sample rate used by DAT
109players.
110
111SRC is capable of arbitrary and time varying conversions; from downsampling by
112a factor of 256 to upsampling by the same factor. Arbitrary in this case means
113that the ratio of input and output sample rates can be an irrational
114number. The conversion ratio can also vary with time for speeding up and
115slowing down effects.
116
117SRC provides a small set of converters to allow quality to be traded off
118against computation cost. The current best converter provides a
119signal-to-noise ratio of 145dB with -3dB passband extending from DC to 96% of
120the theoretical best bandwidth for a given pair of input and output sample
e881752c 121rates.")
0802f3a0 122 (license l:bsd-2)))
37bfb448 123
0160458b 124(define-public pulseaudio
37bfb448
LC
125 (package
126 (name "pulseaudio")
eeda24e1 127 (version "12.2")
37bfb448
LC
128 (source (origin
129 (method url-fetch)
130 (uri (string-append
9dd61217
EF
131 "https://freedesktop.org/software/pulseaudio/releases/"
132 name "-" version ".tar.xz"))
37bfb448
LC
133 (sha256
134 (base32
eeda24e1 135 "0ma0p8iry7fil7qb4pm2nx2pm65kq9hk9xc4r5wkf14nqbzni5l0"))
3f9d63df
LC
136 (modules '((guix build utils)))
137 (snippet
138 ;; Disable console-kit support by default since it's deprecated
139 ;; anyway.
6cbee49d
MW
140 '(begin
141 (substitute* "src/daemon/default.pa.in"
142 (("load-module module-console-kit" all)
143 (string-append "#" all "\n")))
144 #t))
fc1adab1
AK
145 (patches (search-patches
146 "pulseaudio-fix-mult-test.patch"
147 "pulseaudio-longer-test-timeout.patch"))))
37bfb448
LC
148 (build-system gnu-build-system)
149 (arguments
5a74d239
LC
150 `(#:configure-flags (list "--localstatedir=/var" ;"--sysconfdir=/etc"
151 "--disable-oss-output"
de1b319d 152 "--enable-bluez5"
5a74d239
LC
153 (string-append "--with-udev-rules-dir="
154 (assoc-ref %outputs "out")
155 "/lib/udev/rules.d"))
277cf3dc 156 #:phases (modify-phases %standard-phases
0ace73f1
MB
157 (add-before 'configure 'fix-alsa-include
158 (lambda _
159 (substitute* '("configure" "src/modules/alsa/alsa-ucm.h")
160 (("use-case\\.h") "alsa/use-case.h"))
161 #t))
277cf3dc
MB
162 (add-before 'check 'pre-check
163 (lambda _
164 ;; 'tests/lock-autospawn-test.c' wants to create a file
165 ;; under ~/.config/pulse.
166 (setenv "HOME" (getcwd))
167 ;; 'thread-test' needs more time on hydra and on slower
168 ;; machines, so we set the default timeout to 120 seconds.
169 (setenv "CK_DEFAULT_TIMEOUT" "120")
170 #t)))))
37bfb448
LC
171 (inputs
172 ;; TODO: Add optional inputs (GTK+?).
de1b319d
RW
173 `(("alsa-lib" ,alsa-lib)
174 ("bluez" ,bluez)
175 ("sbc" ,sbc)
7136f3e6 176 ("speexdsp" ,speexdsp)
37bfb448 177 ("libsndfile" ,libsndfile)
d5e60a2a 178 ("jack" ,jack-1) ; For routing the output to jack.
37bfb448
LC
179 ("dbus" ,dbus)
180 ("glib" ,glib)
3246cc91 181 ("libltdl" ,libltdl)
7569c5cb 182 ("fftwf" ,fftwf)
37bfb448 183 ("avahi" ,avahi)
7136f3e6 184 ("eudev" ,eudev))) ;for the detection of hardware audio devices
d7e92b87 185 (native-inputs
7136f3e6
MB
186 `(("check" ,check)
187 ("glib:bin" ,glib "bin")
188 ("intltool" ,intltool)
189 ("m4" ,m4)
190 ("pkg-config" ,pkg-config)))
37bfb448
LC
191 (propagated-inputs
192 ;; 'libpulse*.la' contain `-lgdbm' and `-lcap', so propagate them.
09767fb5 193 `(("libcap" ,libcap)
37bfb448
LC
194 ("gdbm" ,gdbm)))
195 (home-page "http://www.pulseaudio.org/")
196 (synopsis "Sound server")
197 (description
e881752c
AK
198 "PulseAudio is a sound server. It is basically a proxy for your sound
199applications. It allows you to do advanced operations on your sound data as
200it passes between your application and your hardware. Things like
201transferring the audio to a different machine, changing the sample format or
202channel count and mixing several sounds into one are easily achieved using a
203sound server.")
37bfb448
LC
204
205 ;; PulseAudio is LGPLv2+, but some of the optional dependencies (GNU dbm,
206 ;; FFTW, etc.) are GPL'd, so the result is effectively GPLv2+. See
207 ;; 'LICENSE' for details.
208 (license l:gpl2+)))
66fb2d23
LC
209
210(define-public pavucontrol
211 (package
212 (name "pavucontrol")
08cc159a 213 (version "3.0")
66fb2d23
LC
214 (source (origin
215 (method url-fetch)
216 (uri (string-append
5cc3096c 217 "https://freedesktop.org/software/pulseaudio/pavucontrol/pavucontrol-"
66fb2d23
LC
218 version
219 ".tar.xz"))
220 (sha256
221 (base32
08cc159a 222 "14486c6lmmirkhscbfygz114f6yzf97h35n3h3pdr27w4mdfmlmk"))))
66fb2d23 223 (build-system gnu-build-system)
d8c317df
SB
224 (arguments
225 '(#:configure-flags '("CXXFLAGS=-std=c++11"))) ; required by gtkmm
66fb2d23 226 (inputs
c4c4cc05 227 `(("libcanberra" ,libcanberra)
66fb2d23 228 ("gtkmm" ,gtkmm)
c4c4cc05
JD
229 ("pulseaudio" ,pulseaudio)))
230 (native-inputs
231 `(("intltool" ,intltool)
66fb2d23 232 ("pkg-config" ,pkg-config)))
57e7d748 233 (home-page "https://www.freedesktop.org/software/pulseaudio/pavucontrol/")
66fb2d23
LC
234 (synopsis "PulseAudio volume control")
235 (description
236 "PulseAudio Volume Control (pavucontrol) provides a GTK+
237graphical user interface to connect to a PulseAudio server and
238easily control the volume of all clients, sinks, etc.")
239 (license l:gpl2+)))
05bdb5e6
SR
240
241(define-public ponymix
242 (package
243 (name "ponymix")
244 (version "5")
245 (source (origin
246 (method url-fetch)
247 (uri (string-append "https://github.com/falconindy/ponymix/"
248 "archive/" version ".tar.gz"))
249 (sha256
250 (base32
251 "1c0ch98zry3c4ixywwynjid1n1nh4xl4l1p548giq2w3zwflaghn"))
252 (file-name (string-append name "-" version ".tar.gz"))))
253 (build-system gnu-build-system)
254 (arguments
255 `(#:tests? #f ; There is no test suite.
256 #:make-flags (let ((out (assoc-ref %outputs "out")))
257 (list (string-append "DESTDIR=" out)))
258 #:phases
259 (modify-phases %standard-phases
260 (add-after 'unpack 'patch-paths
261 (lambda _
262 (substitute* "Makefile"
263 (("/usr") ""))))
264 (delete 'configure)))) ; There's no configure phase.
265 (inputs
266 `(("pulseaudio" ,pulseaudio)))
267 (native-inputs
268 `(("pkg-config" ,pkg-config)))
269 (home-page "https://github.com/falconindy/ponymix")
270 (synopsis "Console-based PulseAudio mixer")
271 (description "Ponymix is a PulseAudio mixer and volume controller with a
272command-line interface. In addition, it is possible to use named sources and
273sinks.")
274 (license l:expat)))
df71c88c
LF
275
276(define-public pulsemixer
277 (package
278 (name "pulsemixer")
27a976ed 279 (version "1.4.0")
df71c88c
LF
280 (source (origin
281 (method url-fetch)
282 (uri (string-append "https://github.com/GeorgeFilipkin/"
283 "pulsemixer/archive/" version ".tar.gz"))
f45ceced 284 (file-name (string-append name "-" version ".tar.gz"))
df71c88c
LF
285 (sha256
286 (base32
27a976ed 287 "1lpad90ifr2xfldyf39sbwx1v85rif2gm9w774gwwpjv53zfgk1g"))))
df71c88c
LF
288 (build-system python-build-system)
289 (arguments
290 `(#:phases
291 (modify-phases %standard-phases
292 (add-after 'unpack 'patch-path
293 (lambda* (#:key inputs #:allow-other-keys)
294 (let ((pulse (assoc-ref inputs "pulseaudio")))
295 (substitute* "pulsemixer"
296 (("libpulse.so.0")
297 (string-append pulse "/lib/libpulse.so.0")))
298 #t))))))
299 (inputs
300 `(("pulseaudio" ,pulseaudio)))
301 (home-page "https://github.com/GeorgeFilipkin/pulsemixer/")
302 (synopsis "Command-line and curses mixer for PulseAudio")
303 (description "Pulsemixer is a PulseAudio mixer with command-line and
304curses-style interfaces.")
305 (license l:expat)))