projects/guix·blob java-team · refs

600 lines · 23.3 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <[email protected]>
3;;; Copyright © 2014, 2015, 2016 Mark H Weaver <[email protected]>
4;;; Copyright © 2016, 2020 Efraim Flashner <[email protected]>
5;;; Copyright © 2016 Ricardo Wurmus <[email protected]>
6;;; Copyright © 2017 Thomas Danckaert <[email protected]>
7;;; Copyright © 2017 Leo Famulari <[email protected]>
8;;; Copyright © 2017 Stefan Reichör <[email protected]>
9;;; Copyright © 2017 Tobias Geerinckx-Rice <[email protected]>
10;;; Copyright © 2018 Pierre Langlois <[email protected]>
11;;; Copyright © 2019 Alex Griffin <[email protected]>
12;;; Copyright © 2019 Mathieu Othacehe <[email protected]>
13;;; Copyright © 2020 Amin Bandali <[email protected]>
14;;; Copyright © 2020 Michael Rohleder <[email protected]>
15;;; Copyright © 2020 Pierre Neidhardt <[email protected]>
16;;; Copyright © 2020 Marius Bakke <[email protected]>
17;;; Copyright © 2021, 2025 Brice Waegeneire <[email protected]>
18;;; Copyright © 2022 Maxim Cournoyer <[email protected]>
19;;; Copyright © 2025 Janneke Nieuwenhuizen <[email protected]>
20;;;
21;;; This file is part of GNU Guix.
22;;;
23;;; GNU Guix is free software; you can redistribute it and/or modify it
24;;; under the terms of the GNU General Public License as published by
25;;; the Free Software Foundation; either version 3 of the License, or (at
26;;; your option) any later version.
27;;;
28;;; GNU Guix is distributed in the hope that it will be useful, but
29;;; WITHOUT ANY WARRANTY; without even the implied warranty of
30;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31;;; GNU General Public License for more details.
32;;;
33;;; You should have received a copy of the GNU General Public License
34;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
35
36(define-module (gnu packages pulseaudio)
37 #:use-module (guix packages)
38 #:use-module (guix download)
39 #:use-module (guix gexp)
40 #:use-module (guix git-download)
41 #:use-module (guix utils)
42 #:use-module ((guix licenses) #:prefix l:)
43 #:use-module (guix build-system cmake)
44 #:use-module (guix build-system glib-or-gtk)
45 #:use-module (guix build-system gnu)
46 #:use-module (guix build-system go)
47 #:use-module (guix build-system meson)
48 #:use-module (guix build-system pyproject)
49 #:use-module (gnu packages)
50 #:use-module (gnu packages algebra)
51 #:use-module (gnu packages audio)
52 #:use-module (gnu packages autogen)
53 #:use-module (gnu packages autotools)
54 #:use-module (gnu packages check)
55 #:use-module (gnu packages cpp)
56 #:use-module (gnu packages databases)
57 #:use-module (gnu packages dns)
58 #:use-module (gnu packages documentation)
59 #:use-module (gnu packages freedesktop)
60 #:use-module (gnu packages glib)
61 #:use-module (gnu packages gettext)
62 #:use-module (gnu packages gnome)
63 #:use-module (gnu packages gtk)
64 #:use-module (gnu packages libcanberra)
65 #:use-module (gnu packages mp3)
66 #:use-module (gnu packages web)
67 #:use-module (gnu packages linux)
68 #:use-module (gnu packages m4)
69 #:use-module (gnu packages perl)
70 #:use-module (gnu packages protobuf)
71 #:use-module (gnu packages python)
72 #:use-module (gnu packages python-build)
73 #:use-module (gnu packages python-xyz)
74 #:use-module (gnu packages python-web)
75 #:use-module (gnu packages pkg-config)
76 #:use-module (gnu packages web-browsers)
77 #:use-module (gnu packages xiph)
78 #:use-module (gnu packages xml)
79 #:use-module (gnu packages xorg))
80
81(define-public libsndfile
82 (let ((commit "68f6c16fe1407eff4cdde158566694c3ed666c2f")
83 (revision "0"))
84 (package
85 (name "libsndfile")
86 ;; release request https://github.com/libsndfile/libsndfile/issues/1075
87 (version (git-version "1.2.2" revision commit))
88 (source
89 (origin
90 (method git-fetch)
91 (uri (git-reference
92 (url "https://github.com/libsndfile/libsndfile/")
93 (commit commit)))
94 (file-name (git-file-name name version))
95 (sha256
96 (base32 "1sn955p6l060yzdb4rvxqsmjp90sv69s9hc525py5vn1ylr2axaf"))
97 (patches (search-patches "libsndfile-CVE-2025-52194.patch"
98 "libsndfile-CVE-2026-37555.patch"))))
99 (build-system gnu-build-system)
100 (arguments
101 (list
102 #:configure-flags
103 #~(list
104 ;; sqlite is only required by sndfile-regtest
105 "--disable-sqlite")
106 #:phases
107 #~(modify-phases %standard-phases
108 (add-after 'unpack 'substitute-env-path
109 (lambda _
110 (substitute* "tests/test_wrapper.sh.in"
111 (("^/usr/bin/env")
112 "env"))))
113 (add-after 'unpack 'disable-failing-sdlcomp-test
114 (lambda _
115 ;; Disable failing sdlcomp test for opus until it is fixed.
116 ;; https://github.com/libsndfile/libsndfile/issues/1107
117 (substitute* "tests/lossy_comp_test.c"
118 (("sdlcomp_test_.*SF_FORMAT_OPUS.*;" match)
119 (string-append "/* " match " */"))))))))
120 (propagated-inputs (list flac
121 lame
122 libmpg123
123 libogg
124 libvorbis
125 opus))
126 (native-inputs (list autoconf
127 autogen
128 automake
129 libtool
130 pkg-config
131 python))
132 (home-page "https://libsndfile.github.io/libsndfile/")
133 (synopsis "Reading and writing files containing sampled sound")
134 (description
135 "Libsndfile is a C library for reading and writing files containing
136sampled sound (such as MS Windows WAV and the Apple/SGI AIFF format) through
137one standard library interface.
138
139It was designed to handle both little-endian (such as WAV) and
140big-endian (such as AIFF) data, and to compile and run correctly on
141little-endian (such as Intel and DEC/Compaq Alpha) processor systems as well
142as big-endian processor systems such as Motorola 68k, Power PC, MIPS and
143SPARC. Hopefully the design of the library will also make it easy to extend
144for reading and writing new sound file formats.")
145 (license l:lgpl2.1+))))
146
147(define-public libsamplerate
148 (package
149 (name "libsamplerate") ; aka. Secret Rabbit Code (SRC)
150 (version "0.1.9")
151 (source (origin
152 (method url-fetch)
153 (uri (string-append "http://www.mega-nerd.com/SRC/libsamplerate-"
154 version ".tar.gz"))
155 (sha256
156 (base32
157 "1ha46i0nbibq0pl0pjwcqiyny4hj8lp1bnl4dpxm64zjw9lb2zha"))))
158 (build-system gnu-build-system)
159 (native-inputs
160 (list pkg-config automake)) ;For up to date 'config.guess' and 'config.sub'.
161 (propagated-inputs
162 (list libsndfile fftw))
163 (arguments
164 `(#:phases
165 (modify-phases %standard-phases
166 (add-after 'unpack 'fix-configure
167 (lambda* (#:key inputs native-inputs #:allow-other-keys)
168 ;; Replace outdated config.sub and config.guess:
169 (with-directory-excursion "Cfg"
170 (for-each (lambda (file)
171 (install-file (string-append
172 (assoc-ref
173 (or native-inputs inputs) "automake")
174 "/share/automake-"
175 ,(version-major+minor
176 (package-version automake))
177 "/" file) "."))
178 '("config.sub" "config.guess")))
179 #t)))))
180 (home-page "http://www.mega-nerd.com/SRC/index.html")
181 (synopsis "Audio sample rate conversion library")
182 (description
183 "Secret Rabbit Code (aka. libsamplerate) is a Sample Rate Converter for
184audio. One example of where such a thing would be useful is converting audio
185from the CD sample rate of 44.1kHz to the 48kHz sample rate used by DAT
186players.
187
188SRC is capable of arbitrary and time varying conversions; from downsampling by
189a factor of 256 to upsampling by the same factor. Arbitrary in this case means
190that the ratio of input and output sample rates can be an irrational
191number. The conversion ratio can also vary with time for speeding up and
192slowing down effects.
193
194SRC provides a small set of converters to allow quality to be traded off
195against computation cost. The current best converter provides a
196signal-to-noise ratio of 145dB with -3dB passband extending from DC to 96% of
197the theoretical best bandwidth for a given pair of input and output sample
198rates.")
199 (license l:bsd-2)))
200
201(define-public pulseaudio
202 (package
203 (name "pulseaudio")
204 (version "17.0")
205 (source (origin
206 (method url-fetch)
207 (uri (string-append
208 "https://freedesktop.org/software/pulseaudio/releases/"
209 name "-" version ".tar.xz"))
210 (sha256
211 (base32
212 "1dc7xdfbn5rknwsvv5m2ijfwnqrap208liwyhiykjghsczb98dq5"))
213 (modules '((guix build utils)))
214 (snippet
215 ;; Disable console-kit support by default since it's deprecated
216 ;; anyway.
217 '(substitute* "src/daemon/default.pa.in"
218 (("load-module module-console-kit" all)
219 (string-append "#" all "\n"))))
220 (patches (search-patches
221 "pulseaudio-fix-mult-test.patch"
222 "pulseaudio-longer-test-timeout.patch"))))
223 (build-system meson-build-system)
224 (arguments
225 (list
226 #:configure-flags
227 #~(list "-Doss-output=disabled"
228 "-Dlocalstatedir=/var"
229 (string-append "-Dudevrulesdir="
230 #$output "/lib/udev/rules.d")
231 ;; Ensure the RUNPATH contains all installed library locations.
232 (string-append "-Dc_link_args=-Wl,-rpath="
233 #$output "/lib/pulseaudio:"
234 #$output "/lib:"
235 #$output "/lib/pulse-" #$version "/modules"))
236 #:phases
237 #~(modify-phases %standard-phases
238 (add-before 'check 'pre-check
239 (lambda _
240 ;; 'tests/lock-autospawn-test.c' wants to create a file
241 ;; under ~/.config/pulse.
242 (setenv "HOME" (getcwd))
243 ;; 'thread-test' needs more time on hydra and on slower
244 ;; machines, so we set the default timeout to 120 seconds.
245 (setenv "CK_DEFAULT_TIMEOUT" "120"))))))
246 (inputs
247 (list alsa-lib
248 bluez
249 sbc
250 speexdsp
251 libsndfile
252 jack-1 ; For routing the output to jack.
253 dbus
254 glib
255 libltdl
256 fftwf
257 avahi
258 webrtc-audio-processing
259 ;; For the optional X11 modules.
260 libice
261 libsm
262 libxcb
263 libxtst
264 elogind
265 eudev)) ;for the detection of hardware audio devices
266 (native-inputs
267 (list check
268 doxygen
269 gettext-minimal
270 `(,glib "bin")
271 m4
272 perl
273 perl-xml-parser
274 pkg-config))
275 (propagated-inputs
276 ;; 'libpulse*.la' contain `-ltdb' and `-lcap', so propagate them.
277 (list libcap tdb))
278 (home-page "https://www.pulseaudio.org/")
279 (synopsis "Sound server")
280 (description
281 "PulseAudio is a sound server. It is basically a proxy for your sound
282applications. It allows you to do advanced operations on your sound data as
283it passes between your application and your hardware. Things like
284transferring the audio to a different machine, changing the sample format or
285channel count and mixing several sounds into one are easily achieved using a
286sound server.")
287
288 ;; PulseAudio is LGPLv2+, but some of the optional dependencies (GNU dbm,
289 ;; FFTW, etc.) are GPL'd, so the result is effectively GPLv2+. See
290 ;; 'LICENSE' for details.
291 (license l:gpl2+)))
292
293(define-public pavucontrol
294 (package
295 (name "pavucontrol")
296 (version "6.2")
297 (source
298 (origin
299 (method url-fetch)
300 (uri (string-append
301 "https://freedesktop.org/software/pulseaudio/pavucontrol/pavucontrol-"
302 version ".tar.xz"))
303 (sha256
304 (base32 "0cjxy7a2zmcyx28bvykmqha2ackq13ncfpz9i74wnz9hqwv7hfp9"))))
305 (build-system meson-build-system)
306 (inputs
307 (list adwaita-icon-theme ;hard-coded theme
308 gtkmm
309 json-glib
310 libcanberra
311 pulseaudio))
312 (native-inputs
313 (list intltool
314 `(,glib "bin")
315 lynx
316 pkg-config))
317 (home-page "https://www.freedesktop.org/software/pulseaudio/pavucontrol/")
318 (synopsis "PulseAudio volume control")
319 (description
320 "PulseAudio Volume Control (pavucontrol) provides a GTK+
321graphical user interface to connect to a PulseAudio server and
322easily control the volume of all clients, sinks, etc.")
323 (license l:gpl2+)))
324
325(define-public ponymix
326 (package
327 (name "ponymix")
328 (version "5")
329 (source (origin
330 (method git-fetch)
331 (uri (git-reference
332 (url "https://github.com/falconindy/ponymix/")
333 (commit version)))
334 (file-name (git-file-name name version))
335 (sha256
336 (base32
337 "08yp7fprmzm6px5yx2rvzri0l60bra5h59l26pn0k071a37ks1rb"))))
338 (build-system gnu-build-system)
339 (arguments
340 `(#:tests? #f ; There is no test suite.
341 #:make-flags (let ((out (assoc-ref %outputs "out")))
342 (list (string-append "DESTDIR=" out)))
343 #:phases
344 (modify-phases %standard-phases
345 (add-after 'unpack 'patch-paths
346 (lambda _
347 (substitute* "Makefile"
348 (("/usr") ""))))
349 (delete 'configure)))) ; There's no configure phase.
350 (inputs
351 (list pulseaudio))
352 (native-inputs
353 (list pkg-config))
354 (home-page "https://github.com/falconindy/ponymix")
355 (synopsis "Console-based PulseAudio mixer")
356 (description "Ponymix is a PulseAudio mixer and volume controller with a
357command-line interface. In addition, it is possible to use named sources and
358sinks.")
359 (license l:expat)))
360
361;; XXX: The project is potentially abandoned, consider to remove when stops
362;; building, see: <https://github.com/GeorgeFilipkin/pulsemixer/issues/65>.
363(define-public pulsemixer
364 (package
365 (name "pulsemixer")
366 (version "1.5.1")
367 (source
368 (origin
369 (method git-fetch)
370 (uri (git-reference
371 (url "https://github.com/GeorgeFilipkin/pulsemixer")
372 (commit version)))
373 (file-name (git-file-name name version))
374 (sha256
375 (base32 "1jagx9zmz5pfsld8y2rj2kqg6ww9f6vqiawfy3vhqc49x3xx92p4"))))
376 (build-system pyproject-build-system)
377 (arguments
378 (list
379 #:tests? #f ;no tests.
380 #:phases
381 #~(modify-phases %standard-phases
382 (add-after 'unpack 'patch-path
383 (lambda* (#:key inputs #:allow-other-keys)
384 (substitute* "pulsemixer"
385 (("libpulse.so.0")
386 (search-input-file inputs "/lib/libpulse.so.0"))))))))
387 (native-inputs
388 (list python-setuptools))
389 (inputs
390 (list pulseaudio))
391 (home-page "https://github.com/GeorgeFilipkin/pulsemixer/")
392 (synopsis "Command-line and curses mixer for PulseAudio")
393 (description "Pulsemixer is a PulseAudio mixer with command-line and
394curses-style interfaces.")
395 (license l:expat)))
396
397(define-public pamixer
398 (package
399 (name "pamixer")
400 (version "1.6")
401 (source
402 (origin
403 (method git-fetch)
404 (uri (git-reference
405 (url "https://github.com/cdemoulins/pamixer")
406 (commit version)))
407 (file-name (git-file-name name version))
408 (sha256
409 (base32 "0d0fcqv9fri1y2701lasscgmvljxzpyg95vy90b3d2ccdnqn3d1d"))))
410 (build-system meson-build-system)
411 (native-inputs
412 (list pkg-config))
413 (inputs
414 (list cxxopts pulseaudio))
415 (home-page "https://github.com/cdemoulins/pamixer")
416 (synopsis "PulseAudio command line mixer")
417 (description
418 "pamixer is like amixer but for PulseAudio, allowing easy control of the
419volume levels of the sinks (get, set, decrease, increase, toggle mute, etc).")
420 (license l:gpl3+)))
421
422(define-public pasystray
423 (package
424 (name "pasystray")
425 (version "0.8.2")
426 (source
427 (origin
428 (method git-fetch)
429 (uri (git-reference
430 (url "https://github.com/christophgysin/pasystray")
431 (commit version)))
432 (file-name (git-file-name name version))
433 (sha256
434 (base32 "1zf79pfmm7wa1l9yyab2g6lf0j81v1mrp406262rd21g4prx1921"))
435 (patches (search-patches "pasystray-check-x11.patch"))))
436 (build-system gnu-build-system)
437 (arguments
438 (list
439 #:phases
440 #~(modify-phases %standard-phases
441 (add-before 'bootstrap 'remove-bootstrap.sh
442 (lambda _
443 ;; Interferes with the bootstrap phase.
444 (delete-file "bootstrap.sh"))))))
445 (native-inputs
446 (list autoconf automake pkg-config))
447 (inputs
448 (list avahi gtk+ libnotify libx11 pulseaudio libappindicator))
449 (home-page "https://github.com/christophgysin/pasystray")
450 (synopsis "PulseAudio controller for the system tray")
451 (description
452 "@command{pasystray} enables control of various PulseAudio server
453settings from the X11 system tray. See the project README.md for a detailed
454list of features.")
455 (license l:lgpl2.1+)))
456
457(define-public paprefs
458 (package
459 (name "paprefs")
460 (version "1.2")
461 (source
462 (origin
463 (method url-fetch)
464 (uri (string-append "https://www.freedesktop.org/software/pulseaudio/"
465 "paprefs/paprefs-" version ".tar.xz"))
466 (sha256
467 (base32 "0czn71vc2j59ass1axr8ij7bh53wq2q0z4gw7xgd2dirvi01xwmk"))))
468 (build-system meson-build-system)
469 (native-inputs
470 (list gettext-minimal pkg-config))
471 (inputs
472 (list gtkmm-3 pulseaudio))
473 (home-page "https://freedesktop.org/software/pulseaudio/paprefs/")
474 (synopsis "Simple GTK based configuration dialog for the PulseAudio sound
475server")
476 (description "@command{paprefs} is a simple GTK based configuration
477dialog for the PulseAudio sound server. Note that this program can
478only configure local servers, and requires that a special module
479module-gsettings is loaded in the sound server.")
480 (license l:gpl2)))
481
482(define-public noise-suppression-for-voice
483 (package
484 (name "noise-suppression-for-voice")
485 (version "0.91")
486 (source
487 (origin
488 (method git-fetch)
489 (uri (git-reference
490 (url "https://github.com/werman/noise-suppression-for-voice")
491 (commit (string-append "v" version))))
492 (file-name (git-file-name name version))
493 (sha256
494 (base32 "11pwisbcks7g0mdgcrrv49v3ci1l6m26bbb7f67xz4pr1hai5dwc"))))
495 (build-system cmake-build-system)
496 (arguments
497 ;; No tests.
498 '(#:tests? #f))
499 (inputs
500 (list ;; TODO: Package VST to build the corresponding plugin.
501 pulseaudio))
502 (home-page "https://github.com/werman/noise-suppression-for-voice")
503 (synopsis "Real-time Noise suppression plugin based on Xiph's RNNoise")
504 (description "This plug-in is meant to suppress a wide range of noise
505origins: computer fans, offices, crowds, airplanes, cars, trains,
506construction, and more.
507
508Mild background noise is always suppressed, loud sounds, like
509clicking of mechanical keyboard, are suppressed while there is no voice
510however they are only reduced in volume when voice is present.
511
512The plug-in is made to work with 1 or 2 channels (LADSPA plugin),
51316 bit, 48000 Hz audio input.")
514 (license l:gpl3)))
515
516(define-public noisetorch
517 (package
518 (name "noisetorch")
519 (version "0.12.2")
520 (source
521 (origin
522 (method git-fetch)
523 (uri (git-reference
524 (url "https://github.com/noisetorch/NoiseTorch")
525 (commit (string-append "v" version))))
526 (file-name (git-file-name name version))
527 (sha256
528 (base32 "1qwzqv4rww9xywkfnjr79489d35cypa1zm9rgm966g51zzwhxrck"))))
529 (build-system go-build-system)
530 (arguments
531 `(#:import-path "github.com/noisetorch/NoiseTorch"
532 #:install-source? #f
533 #:test-subdirs '(".")
534 #:phases
535 (modify-phases %standard-phases
536 (add-after 'unpack 'copy-rnnoise-library
537 (lambda* (#:key inputs #:allow-other-keys)
538 (with-directory-excursion "src/github.com/noisetorch/NoiseTorch"
539 (let ((lib (search-input-file inputs
540 "lib/ladspa/librnnoise_ladspa.so"))
541 (dir "c/ladspa"))
542 (mkdir-p dir)
543 ;; Symlinking won't work: ‘cannot embed irregular file’!
544 (copy-file lib (string-append dir "/rnnoise_ladspa.so"))))))
545 (add-after 'unpack 'disable-update-check.go
546 (lambda _
547 (with-directory-excursion "src/github.com/noisetorch/NoiseTorch"
548 (substitute* "main.go"
549 ((".*updateCheck.*") "")))))
550 (add-before 'build 'go-generate
551 (lambda _
552 (with-directory-excursion "src/github.com/noisetorch/NoiseTorch"
553 (invoke "go" "generate")))))))
554 (inputs
555 (list noise-suppression-for-voice))
556 (home-page "https://github.com/noisetorch/NoiseTorch")
557 (synopsis "Real-time microphone noise suppression")
558 (description "NoiseTorch creates a virtual PulseAudio microphone that
559suppresses noise, in any application. Use whichever conferencing or VOIP
560application you like and simply select the NoiseTorch Virtual Microphone as
561input to torch the sound of your mechanical keyboard, computer fans, trains
562and the likes.")
563 (license l:gpl3)))
564
565(define-public apulse
566 (package
567 (name "apulse")
568 (version "0.1.13")
569 (home-page "https://github.com/i-rinat/apulse")
570 (source
571 (origin
572 (method git-fetch)
573 (uri (git-reference
574 (url home-page)
575 (commit (string-append "v" version))))
576 (file-name (git-file-name name version))
577 (sha256
578 (base32 "1p6fh6ah5v3qz7dxhcsixx38bxg44ypbim4m03bxk3ls5i9xslmn"))))
579 (arguments
580 (list #:tests? #f ;no tests
581 #:configure-flags
582 ;; Ensure the RUNPATH contains the .../lib/apulse directory.
583 #~(list (string-append "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath="
584 #$output "/lib/apulse:"))))
585 (native-inputs (list pkg-config))
586 (inputs (list alsa-lib glib))
587 (build-system cmake-build-system)
588 (synopsis "PulseAudio emulation for ALSA")
589 (description " Apulse provides an alternative partial implementation of
590the PulseAudio API. It consists of a loader script and a number of shared
591libraries with the same names as from original PulseAudio, so applications
592could dynamically load them and think they are talking to PulseAudio.
593
594Internally, no separate sound mixing daemon is used. Instead, apulse relies
595on ALSA's dmix, dsnoop, and plug plugins to handle multiple sound sources and
596capture streams running at the same time. dmix plugin muxes multiple playback
597streams; dsnoop plugin allow multiple applications to capture from a single
598microphone; and plug plugin transparently converts audio between various
599sample formats, sample rates and channel numbers.")
600 (license l:expat)))