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