gnu: json-c: Upgrade to 0.12.
[jackhill/guix/guix.git] / gnu / packages / pulseaudio.scm
CommitLineData
37bfb448 1;;; GNU Guix --- Functional package management for GNU
f5ac2352 2;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org>
b0364911 3;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
37bfb448
LC
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)
b645425f 26 #:use-module (gnu packages)
54ff0b7d
AE
27 #:use-module (gnu packages algebra)
28 #:use-module ((gnu packages autotools) #:select (libtool))
37bfb448 29 #:use-module (gnu packages avahi)
54ff0b7d
AE
30 #:use-module (gnu packages check)
31 #:use-module (gnu packages gdbm)
37bfb448 32 #:use-module (gnu packages glib)
66fb2d23
LC
33 #:use-module (gnu packages gtk)
34 #:use-module (gnu packages libcanberra)
54ff0b7d 35 #:use-module (gnu packages linux)
37bfb448 36 #:use-module (gnu packages m4)
54ff0b7d
AE
37 #:use-module (gnu packages pkg-config)
38 #:use-module (gnu packages xiph)
37bfb448
LC
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
65sampled sound (such as MS Windows WAV and the Apple/SGI AIFF format) through
66one standard library interface.
67
68It was designed to handle both little-endian (such as WAV) and
69big-endian (such as AIFF) data, and to compile and run correctly on
70little-endian (such as Intel and DEC/Compaq Alpha) processor systems as well
71as big-endian processor systems such as Motorola 68k, Power PC, MIPS and
72SPARC. Hopefully the design of the library will also make it easy to extend
73for 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
96audio. One example of where such a thing would be useful is converting audio
97from the CD sample rate of 44.1kHz to the 48kHz sample rate used by DAT
98players.
99
100SRC is capable of arbitrary and time varying conversions; from downsampling by
101a factor of 256 to upsampling by the same factor. Arbitrary in this case means
102that the ratio of input and output sample rates can be an irrational
103number. The conversion ratio can also vary with time for speeding up and
104slowing down effects.
105
106SRC provides a small set of converters to allow quality to be traded off
107against computation cost. The current best converter provides a
108signal-to-noise ratio of 145dB with -3dB passband extending from DC to 96% of
109the theoretical best bandwidth for a given pair of input and output sample
110rates. ")
111 (license l:gpl2+)))
112
113(define json-c
114 (package
115 (name "json-c")
9ab74153 116 (version "0.12")
37bfb448
LC
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
9ab74153
LC
123 "0gwzic3ifg2d0w32ya3agpxh8i083cgvf7kmc51cnbgqnfr02300"))
124 (modules '((guix build utils)))
125 (snippet
126 '(begin
127 ;; Somehow 'config.h.in' is older than
128 ;; 'aclocal.m4', which would trigger a rule to
129 ;; run 'autoheader'.
130 (set-file-time "config.h.in"
131 (stat "aclocal.m4"))
132
133 ;; Don't try to build with -Werror.
134 (substitute* (find-files "." "Makefile\\.in")
135 (("-Werror") ""))))))
37bfb448
LC
136 (build-system gnu-build-system)
137 (arguments '(#:parallel-build? #f
138 #:parallel-tests? #f))
139 (home-page "https://github.com/json-c/json-c/wiki")
140 (synopsis "JSON implementation in C")
141 (description
142 "JSON-C implements a reference counting object model that allows you to
143easily construct JSON objects in C, output them as JSON formatted strings and
144parse JSON formatted strings back into the C representation of JSON objects.")
145 (license l:x11)))
146
147(define pulseaudio
148 (package
149 (name "pulseaudio")
7c516af6 150 (version "5.0")
37bfb448
LC
151 (source (origin
152 (method url-fetch)
153 (uri (string-append
154 "http://freedesktop.org/software/pulseaudio/releases/pulseaudio-"
155 version ".tar.xz"))
156 (sha256
157 (base32
7c516af6 158 "0fgrr8v7yfh0byhzdv4c87v9lkj8g7gpjm8r9xrbvpa92a5kmhcr"))))
37bfb448
LC
159 (build-system gnu-build-system)
160 (arguments
c01f7678 161 `(#:configure-flags '("--localstatedir=/var" ;"--sysconfdir=/etc"
37bfb448
LC
162 "--disable-oss-output")
163 #:phases (alist-cons-before
164 'check 'pre-check
165 (lambda _
166 ;; 'tests/lock-autospawn-test.c' wants to create a file
167 ;; under ~/.config/pulse.
b0364911
MW
168 (setenv "HOME" (getcwd))
169 ;; 'thread-test' needs more time on hydra and on slower
170 ;; machines, so we set the default timeout to 120 seconds.
171 (setenv "CK_DEFAULT_TIMEOUT" "120"))
f5ac2352 172 %standard-phases)))
37bfb448
LC
173 (inputs
174 ;; TODO: Add optional inputs (GTK+?).
175 `(;; ("sbc" ,sbc)
176 ("alsa-lib" ,alsa-lib)
177 ("json-c" ,json-c)
178 ("speex" ,speex)
179 ("libsndfile" ,libsndfile)
180 ("libsamplerate" ,libsamplerate)
181 ("dbus" ,dbus)
182 ("glib" ,glib)
183 ("intltool" ,intltool)
184 ("pkg-config" ,pkg-config)
185 ("m4" ,m4)
186 ("libtool" ,libtool)
7569c5cb 187 ("fftwf" ,fftwf)
37bfb448
LC
188 ("avahi" ,avahi)
189 ("check" ,check)))
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
197 "PulseAudio is a sound server. It is basically a proxy for your sound applications.
198It allows you to do advanced operations on your sound data as it passes
199between your application and your hardware. Things like transferring the
200audio to a different machine, changing the sample format or channel count and
201mixing several sounds into one are easily achieved using a 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+)))
66fb2d23
LC
207
208(define-public pavucontrol
209 (package
210 (name "pavucontrol")
211 (version "2.0")
212 (source (origin
213 (method url-fetch)
214 (uri (string-append
215 "http://freedesktop.org/software/pulseaudio/pavucontrol/pavucontrol-"
216 version
217 ".tar.xz"))
218 (sha256
219 (base32
220 "02s775m1531sshwlbvfddk3pz8zjmwkv1sgzggn386ja3gc9vwi2"))))
221 (build-system gnu-build-system)
222 (inputs
c4c4cc05 223 `(("libcanberra" ,libcanberra)
66fb2d23 224 ("gtkmm" ,gtkmm)
c4c4cc05
JD
225 ("pulseaudio" ,pulseaudio)))
226 (native-inputs
227 `(("intltool" ,intltool)
66fb2d23
LC
228 ("pkg-config" ,pkg-config)))
229 (home-page "http://freedesktop.org/software/pulseaudio/pavucontrol/")
230 (synopsis "PulseAudio volume control")
231 (description
232 "PulseAudio Volume Control (pavucontrol) provides a GTK+
233graphical user interface to connect to a PulseAudio server and
234easily control the volume of all clients, sinks, etc.")
235 (license l:gpl2+)))