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