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