pulseaudio.scm 23 KB

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