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