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