pulseaudio.scm 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  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. ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
  7. ;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
  8. ;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
  9. ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
  10. ;;; Copyright © 2018 Pierre Langlois <pierre.langlois@gmx.com>
  11. ;;;
  12. ;;; This file is part of GNU Guix.
  13. ;;;
  14. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  15. ;;; under the terms of the GNU General Public License as published by
  16. ;;; the Free Software Foundation; either version 3 of the License, or (at
  17. ;;; your option) any later version.
  18. ;;;
  19. ;;; GNU Guix is distributed in the hope that it will be useful, but
  20. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  21. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. ;;; GNU General Public License for more details.
  23. ;;;
  24. ;;; You should have received a copy of the GNU General Public License
  25. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  26. (define-module (gnu packages pulseaudio)
  27. #:use-module (guix packages)
  28. #:use-module (guix download)
  29. #:use-module ((guix licenses) #:prefix l:)
  30. #:use-module (guix build-system gnu)
  31. #:use-module (guix build-system python)
  32. #:use-module (gnu packages)
  33. #:use-module (gnu packages algebra)
  34. #:use-module (gnu packages audio)
  35. #:use-module (gnu packages autotools)
  36. #:use-module (gnu packages avahi)
  37. #:use-module (gnu packages check)
  38. #:use-module (gnu packages dbm)
  39. #:use-module (gnu packages glib)
  40. #:use-module (gnu packages gtk)
  41. #:use-module (gnu packages libcanberra)
  42. #:use-module (gnu packages web)
  43. #:use-module (gnu packages linux)
  44. #:use-module (gnu packages m4)
  45. #:use-module (gnu packages pkg-config)
  46. #:use-module (gnu packages xiph))
  47. (define-public libsndfile
  48. (package
  49. (name "libsndfile")
  50. (version "1.0.28")
  51. (source (origin
  52. (method url-fetch)
  53. (uri (string-append "http://www.mega-nerd.com/libsndfile/files/libsndfile-"
  54. version ".tar.gz"))
  55. (patches (search-patches "libsndfile-armhf-type-checks.patch"
  56. "libsndfile-CVE-2017-8361-8363-8365.patch"
  57. "libsndfile-CVE-2017-8362.patch"
  58. "libsndfile-CVE-2017-12562.patch"))
  59. (sha256
  60. (base32
  61. "1afzm7jx34jhqn32clc5xghyjglccam2728yxlx37yj2y0lkkwqz"))))
  62. (build-system gnu-build-system)
  63. (inputs
  64. `(("libvorbis" ,libvorbis)
  65. ("libogg" ,libogg)
  66. ("flac" ,flac)))
  67. (native-inputs
  68. `(("pkg-config" ,pkg-config)))
  69. (home-page "http://www.mega-nerd.com/libsndfile/")
  70. (synopsis "Reading and writing files containing sampled sound")
  71. (description
  72. "Libsndfile is a C library for reading and writing files containing
  73. sampled sound (such as MS Windows WAV and the Apple/SGI AIFF format) through
  74. one standard library interface.
  75. It was designed to handle both little-endian (such as WAV) and
  76. big-endian (such as AIFF) data, and to compile and run correctly on
  77. little-endian (such as Intel and DEC/Compaq Alpha) processor systems as well
  78. as big-endian processor systems such as Motorola 68k, Power PC, MIPS and
  79. SPARC. Hopefully the design of the library will also make it easy to extend
  80. for reading and writing new sound file formats.")
  81. (license l:gpl2+)))
  82. (define-public libsamplerate
  83. (package
  84. (name "libsamplerate") ; aka. Secret Rabbit Code (SRC)
  85. (version "0.1.9")
  86. (source (origin
  87. (method url-fetch)
  88. (uri (string-append "http://www.mega-nerd.com/SRC/libsamplerate-"
  89. version ".tar.gz"))
  90. (sha256
  91. (base32
  92. "1ha46i0nbibq0pl0pjwcqiyny4hj8lp1bnl4dpxm64zjw9lb2zha"))))
  93. (build-system gnu-build-system)
  94. (native-inputs
  95. `(("pkg-config" ,pkg-config)))
  96. (propagated-inputs
  97. `(("libsndfile" ,libsndfile)
  98. ("fftw" ,fftw)))
  99. (home-page "http://www.mega-nerd.com/SRC/index.html")
  100. (synopsis "Audio sample rate conversion library")
  101. (description
  102. "Secret Rabbit Code (aka. libsamplerate) is a Sample Rate Converter for
  103. audio. One example of where such a thing would be useful is converting audio
  104. from the CD sample rate of 44.1kHz to the 48kHz sample rate used by DAT
  105. players.
  106. SRC is capable of arbitrary and time varying conversions; from downsampling by
  107. a factor of 256 to upsampling by the same factor. Arbitrary in this case means
  108. that the ratio of input and output sample rates can be an irrational
  109. number. The conversion ratio can also vary with time for speeding up and
  110. slowing down effects.
  111. SRC provides a small set of converters to allow quality to be traded off
  112. against computation cost. The current best converter provides a
  113. signal-to-noise ratio of 145dB with -3dB passband extending from DC to 96% of
  114. the theoretical best bandwidth for a given pair of input and output sample
  115. rates.")
  116. (license l:bsd-2)))
  117. (define-public pulseaudio
  118. (package
  119. (name "pulseaudio")
  120. (version "12.2")
  121. (source (origin
  122. (method url-fetch)
  123. (uri (string-append
  124. "https://freedesktop.org/software/pulseaudio/releases/"
  125. name "-" version ".tar.xz"))
  126. (sha256
  127. (base32
  128. "0ma0p8iry7fil7qb4pm2nx2pm65kq9hk9xc4r5wkf14nqbzni5l0"))
  129. (modules '((guix build utils)))
  130. (snippet
  131. ;; Disable console-kit support by default since it's deprecated
  132. ;; anyway.
  133. '(begin
  134. (substitute* "src/daemon/default.pa.in"
  135. (("load-module module-console-kit" all)
  136. (string-append "#" all "\n")))
  137. #t))
  138. (patches (search-patches
  139. "pulseaudio-fix-mult-test.patch"
  140. "pulseaudio-longer-test-timeout.patch"))))
  141. (build-system gnu-build-system)
  142. (arguments
  143. `(#:configure-flags (list "--localstatedir=/var" ;"--sysconfdir=/etc"
  144. "--disable-oss-output"
  145. "--enable-bluez5"
  146. (string-append "--with-udev-rules-dir="
  147. (assoc-ref %outputs "out")
  148. "/lib/udev/rules.d"))
  149. #:phases (modify-phases %standard-phases
  150. (add-before 'check 'pre-check
  151. (lambda _
  152. ;; 'tests/lock-autospawn-test.c' wants to create a file
  153. ;; under ~/.config/pulse.
  154. (setenv "HOME" (getcwd))
  155. ;; 'thread-test' needs more time on hydra and on slower
  156. ;; machines, so we set the default timeout to 120 seconds.
  157. (setenv "CK_DEFAULT_TIMEOUT" "120")
  158. #t)))))
  159. (inputs
  160. ;; TODO: Add optional inputs (GTK+?).
  161. `(("alsa-lib" ,alsa-lib)
  162. ("bluez" ,bluez)
  163. ("sbc" ,sbc)
  164. ("speexdsp" ,speexdsp)
  165. ("libsndfile" ,libsndfile)
  166. ("jack" ,jack-1) ; For routing the output to jack.
  167. ("dbus" ,dbus)
  168. ("glib" ,glib)
  169. ("libltdl" ,libltdl)
  170. ("fftwf" ,fftwf)
  171. ("avahi" ,avahi)
  172. ("eudev" ,eudev))) ;for the detection of hardware audio devices
  173. (native-inputs
  174. `(("check" ,check)
  175. ("glib:bin" ,glib "bin")
  176. ("intltool" ,intltool)
  177. ("m4" ,m4)
  178. ("pkg-config" ,pkg-config)))
  179. (propagated-inputs
  180. ;; 'libpulse*.la' contain `-lgdbm' and `-lcap', so propagate them.
  181. `(("libcap" ,libcap)
  182. ("gdbm" ,gdbm)))
  183. (home-page "http://www.pulseaudio.org/")
  184. (synopsis "Sound server")
  185. (description
  186. "PulseAudio is a sound server. It is basically a proxy for your sound
  187. applications. It allows you to do advanced operations on your sound data as
  188. it passes between your application and your hardware. Things like
  189. transferring the audio to a different machine, changing the sample format or
  190. channel count and mixing several sounds into one are easily achieved using a
  191. sound server.")
  192. ;; PulseAudio is LGPLv2+, but some of the optional dependencies (GNU dbm,
  193. ;; FFTW, etc.) are GPL'd, so the result is effectively GPLv2+. See
  194. ;; 'LICENSE' for details.
  195. (license l:gpl2+)))
  196. (define-public pavucontrol
  197. (package
  198. (name "pavucontrol")
  199. (version "3.0")
  200. (source (origin
  201. (method url-fetch)
  202. (uri (string-append
  203. "https://freedesktop.org/software/pulseaudio/pavucontrol/pavucontrol-"
  204. version
  205. ".tar.xz"))
  206. (sha256
  207. (base32
  208. "14486c6lmmirkhscbfygz114f6yzf97h35n3h3pdr27w4mdfmlmk"))))
  209. (build-system gnu-build-system)
  210. (arguments
  211. '(#:configure-flags '("CXXFLAGS=-std=c++11"))) ; required by gtkmm
  212. (inputs
  213. `(("libcanberra" ,libcanberra)
  214. ("gtkmm" ,gtkmm)
  215. ("pulseaudio" ,pulseaudio)))
  216. (native-inputs
  217. `(("intltool" ,intltool)
  218. ("pkg-config" ,pkg-config)))
  219. (home-page "https://www.freedesktop.org/software/pulseaudio/pavucontrol/")
  220. (synopsis "PulseAudio volume control")
  221. (description
  222. "PulseAudio Volume Control (pavucontrol) provides a GTK+
  223. graphical user interface to connect to a PulseAudio server and
  224. easily control the volume of all clients, sinks, etc.")
  225. (license l:gpl2+)))
  226. (define-public ponymix
  227. (package
  228. (name "ponymix")
  229. (version "5")
  230. (source (origin
  231. (method url-fetch)
  232. (uri (string-append "https://github.com/falconindy/ponymix/"
  233. "archive/" version ".tar.gz"))
  234. (sha256
  235. (base32
  236. "1c0ch98zry3c4ixywwynjid1n1nh4xl4l1p548giq2w3zwflaghn"))
  237. (file-name (string-append name "-" version ".tar.gz"))))
  238. (build-system gnu-build-system)
  239. (arguments
  240. `(#:tests? #f ; There is no test suite.
  241. #:make-flags (let ((out (assoc-ref %outputs "out")))
  242. (list (string-append "DESTDIR=" out)))
  243. #:phases
  244. (modify-phases %standard-phases
  245. (add-after 'unpack 'patch-paths
  246. (lambda _
  247. (substitute* "Makefile"
  248. (("/usr") ""))))
  249. (delete 'configure)))) ; There's no configure phase.
  250. (inputs
  251. `(("pulseaudio" ,pulseaudio)))
  252. (native-inputs
  253. `(("pkg-config" ,pkg-config)))
  254. (home-page "https://github.com/falconindy/ponymix")
  255. (synopsis "Console-based PulseAudio mixer")
  256. (description "Ponymix is a PulseAudio mixer and volume controller with a
  257. command-line interface. In addition, it is possible to use named sources and
  258. sinks.")
  259. (license l:expat)))
  260. (define-public pulsemixer
  261. (package
  262. (name "pulsemixer")
  263. (version "1.4.0")
  264. (source (origin
  265. (method url-fetch)
  266. (uri (string-append "https://github.com/GeorgeFilipkin/"
  267. "pulsemixer/archive/" version ".tar.gz"))
  268. (file-name (string-append name "-" version ".tar.gz"))
  269. (sha256
  270. (base32
  271. "1lpad90ifr2xfldyf39sbwx1v85rif2gm9w774gwwpjv53zfgk1g"))))
  272. (build-system python-build-system)
  273. (arguments
  274. `(#:phases
  275. (modify-phases %standard-phases
  276. (add-after 'unpack 'patch-path
  277. (lambda* (#:key inputs #:allow-other-keys)
  278. (let ((pulse (assoc-ref inputs "pulseaudio")))
  279. (substitute* "pulsemixer"
  280. (("libpulse.so.0")
  281. (string-append pulse "/lib/libpulse.so.0")))
  282. #t))))))
  283. (inputs
  284. `(("pulseaudio" ,pulseaudio)))
  285. (home-page "https://github.com/GeorgeFilipkin/pulsemixer/")
  286. (synopsis "Command-line and curses mixer for PulseAudio")
  287. (description "Pulsemixer is a PulseAudio mixer with command-line and
  288. curses-style interfaces.")
  289. (license l:expat)))