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