gnu: python-deepmerge: Use pyproject-build-system.
[jackhill/guix/guix.git] / gnu / packages / xiph.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
4 ;;; Copyright © 2013 David Thompson <dthompson2@worcester.edu>
5 ;;; Copyright © 2014 Sree Harsha Totakura <sreeharsha@totakura.in>
6 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
7 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
8 ;;; Copyright © 2015, 2016, 2017, 2019 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2017, 2018, 2019, 2020 Marius Bakke <marius@gnu.org>
10 ;;; Copyright © 2018–2022 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2018 Leo Famulari <leo@famulari.name>
12 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
13 ;;; Copyright © 2021 Brendan Tildesley <mail@brendan.scot>
14 ;;; Copyright © 2021 Matthew James Kraai <kraai@ftbfs.org>
15 ;;; Copyright © 2021 Vinicius Monego <monego@posteo.net>
16 ;;;
17 ;;; This file is part of GNU Guix.
18 ;;;
19 ;;; GNU Guix is free software; you can redistribute it and/or modify it
20 ;;; under the terms of the GNU General Public License as published by
21 ;;; the Free Software Foundation; either version 3 of the License, or (at
22 ;;; your option) any later version.
23 ;;;
24 ;;; GNU Guix is distributed in the hope that it will be useful, but
25 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
26 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 ;;; GNU General Public License for more details.
28 ;;;
29 ;;; You should have received a copy of the GNU General Public License
30 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
31
32 (define-module (gnu packages xiph)
33 #:use-module (gnu packages)
34 #:use-module (gnu packages autotools)
35 #:use-module (gnu packages bison)
36 #:use-module (gnu packages compression)
37 #:use-module (gnu packages curl)
38 #:use-module (gnu packages documentation)
39 #:use-module (gnu packages image)
40 #:use-module (gnu packages pkg-config)
41 #:use-module (gnu packages python)
42 #:use-module (gnu packages linux)
43 #:use-module (gnu packages pulseaudio)
44 #:use-module (gnu packages tls)
45 #:use-module (gnu packages xml)
46 #:use-module ((guix licenses) #:prefix license:)
47 #:use-module (guix packages)
48 #:use-module (guix download)
49 #:use-module (guix git-download)
50 #:use-module (guix build-system gnu))
51
52 (define-public libogg
53 (package
54 (name "libogg")
55 (version "1.3.5")
56 (source (origin
57 (method url-fetch)
58 (uri (string-append "https://downloads.xiph.org/releases/ogg/libogg-"
59 version ".tar.xz"))
60 (sha256
61 (base32
62 "01b7050bghdvbxvw0gzv588fn4a27zh42ljpwzm4vrf8dziipnf4"))))
63 (build-system gnu-build-system)
64 (arguments
65 '(#:configure-flags '("--disable-static")))
66 (synopsis "Library for manipulating the ogg multimedia format")
67 (description
68 "The libogg library manipulates the ogg multimedia container
69 format, which encapsulates raw compressed data and allows the interleaving of
70 audio and video data. In addition to encapsulation and interleaving of
71 multiple data streams, ogg provides packet framing, error detection, and
72 periodic timestamps for seeking.")
73 (license (license:non-copyleft "file://COPYING"
74 "See COPYING in the distribution."))
75 (home-page "https://xiph.org/ogg/")))
76
77 (define-public libvorbis
78 (package
79 (name "libvorbis")
80 (version "1.3.7")
81 (source (origin
82 (method url-fetch)
83 (uri (string-append "https://downloads.xiph.org/releases/vorbis/"
84 "libvorbis-" version ".tar.xz"))
85 (sha256
86 (base32
87 "0jwmf87x5sdis64rbv0l87mdpah1rbilkkxszipbzg128f9w8g5k"))))
88 (build-system gnu-build-system)
89 (propagated-inputs (list libogg))
90 (arguments `(#:configure-flags '("LDFLAGS=-lm"
91 "--disable-static")
92 #:parallel-tests? #f))
93 (synopsis "Library implementing the vorbis audio format")
94 (description
95 "The libvorbis library implements the ogg vorbis audio format,
96 a fully open, non-proprietary, patent-and-royalty-free, general-purpose
97 compressed audio format for mid to high quality (8kHz-48.0kHz, 16+ bit,
98 polyphonic) audio and music at fixed and variable bitrates from 16 to
99 128 kbps/channel.")
100 (license (license:non-copyleft "file://COPYING"
101 "See COPYING in the distribution."))
102 (home-page "https://xiph.org/vorbis/")))
103
104 (define-public libtheora
105 (package
106 (name "libtheora")
107 (version "1.1.1")
108 (source (origin
109 (method url-fetch)
110 (uri (string-append "https://downloads.xiph.org/releases/theora/"
111 "libtheora-" version ".tar.xz"))
112 (sha256
113 (base32
114 "0q8wark9ribij57dciym5vdikg2464p8q2mgqvfb78ksjh4s8vgk"))
115 (patches (search-patches "libtheora-config-guess.patch"))))
116 (build-system gnu-build-system)
117 (arguments
118 '(#:configure-flags '("--disable-static")))
119 (inputs (list libvorbis))
120 ;; The .pc files refer to libogg.
121 (propagated-inputs (list libogg))
122 (synopsis "Library implementing the Theora video format")
123 (description
124 "The libtheora library implements the ogg theora video format,
125 a fully open, non-proprietary, patent-and-royalty-free, general-purpose
126 compressed video format.")
127 (license license:bsd-3)
128 (home-page "https://xiph.org/theora/")))
129
130 (define-public speex
131 (package
132 (name "speex")
133 (version "1.2.0")
134 (source
135 (origin
136 (method url-fetch)
137 (uri (string-append "https://downloads.xiph.org/releases/speex/speex-"
138 version ".tar.gz"))
139 (sha256
140 (base32
141 "150047wnllz4r94whb9r73l5qf0z5z3rlhy98bawfbblmkq8mbpa"))))
142 (build-system gnu-build-system)
143 (arguments
144 '(#:configure-flags '("--disable-static")))
145 (native-inputs
146 (list pkg-config))
147 (inputs
148 (list libogg speexdsp))
149 (home-page "https://gnu.org/software/speex")
150 (synopsis "Library for patent-free audio compression format")
151 (description
152 "GNU Speex is a patent-free audio compression codec specially designed
153 for speech. It is well-adapted to internet applications, such as VoIP. It
154 features compression of different bands in the same bitstream, intensity
155 stereo encoding, and voice activity detection.")
156 ;; 'src/getopt.c' is under LGPLv2+
157 (license (license:non-copyleft "file://COPYING"
158 "See COPYING in the distribution."))))
159
160 (define-public speexdsp
161 (package
162 (name "speexdsp")
163 (version "1.2.0")
164 (source (origin
165 (method url-fetch)
166 (uri (string-append "https://downloads.xiph.org/releases/speex/"
167 "speexdsp-" version ".tar.gz"))
168 (sha256
169 (base32
170 "0wa7sqpk3x61zz99m7lwkgr6yv62ml6lfgs5xja65vlvdzy44838"))))
171 (build-system gnu-build-system)
172 (arguments
173 `(#:configure-flags '("--disable-static"
174 ,@(if (string=? "aarch64-linux"
175 (%current-system))
176 '("--enable-neon=no") ; neon defaults to armv7-a
177 '()))))
178 (home-page "https://speex.org/")
179 (synopsis "Speex processing library")
180 (description
181 "SpeexDSP is a @dfn{DSP} (Digital Signal Processing) library based on
182 work from the @code{speex} codec.")
183 (license (license:non-copyleft "file://COPYING"
184 "See COPYING in the distribution."))))
185
186 (define-public ao
187 (package
188 (name "ao")
189 ;; We need a few commits on top of 1.2.2 to fix CVE-2017-11548.
190 (version "1.2.2-5-g20dc8ed")
191 (source (origin
192 (method git-fetch)
193 (uri (git-reference
194 (url "https://gitlab.xiph.org/xiph/libao")
195 (commit version)))
196 (file-name (git-file-name name version))
197 (sha256
198 (base32
199 "1d1b3g2a7jd43c32242yq6nfysqsmp7rjslhvbrmpgk119l5fnbj"))))
200 (build-system gnu-build-system)
201 ;; FIXME: Add further backends, see the summary printed after configure.
202 ;; XXX: Should back-ends be pushed to different outputs? For instance,
203 ;; "out" would include only the ALSA back-end, while "pulse" would
204 ;; contain 'lib/ao/plugins-4/libpulse.*'.
205 (inputs
206 (list alsa-lib pulseaudio))
207 (native-inputs
208 (list pkg-config autoconf automake libtool))
209 (synopsis "Cross platform audio library")
210 (description
211 "Libao is a cross-platform audio library that allows programs to
212 output audio using a simple API on a wide variety of platforms.
213 It currently supports:
214 @enumerate
215 @item Null output (handy for testing without a sound device),
216 @item WAV files,
217 @item AU files,
218 @item RAW files,
219 @item OSS (Open Sound System, used on Linux and FreeBSD),
220 @item ALSA (Advanced Linux Sound Architecture),
221 @item aRts (Analog RealTime Synth, used by KDE),
222 @item PulseAudio (next generation GNOME sound server),
223 @item esd (EsounD or Enlightened Sound Daemon),
224 @item Mac OS X,
225 @item Windows (98 and later),
226 @item AIX,
227 @item Sun/NetBSD/OpenBSD,
228 @item IRIX,
229 @item NAS (Network Audio Server),
230 @item RoarAudio (Modern, multi-OS, networked Sound System),
231 @item OpenBSD's sndio.
232 @end enumerate
233 ")
234 (license license:gpl2+)
235 (properties '((cpe-name . "libao")))
236 (home-page "https://www.xiph.org/ao/")))
237
238 (define-public flac
239 (package
240 (name "flac")
241 (version "1.3.3")
242 (source (origin
243 (method url-fetch)
244 (uri (string-append "https://downloads.xiph.org/releases/flac/flac-"
245 version ".tar.xz"))
246 (sha256
247 (base32
248 "0j0p9sf56a2fm2hkjnf7x3py5ir49jyavg4q5zdyd7bcf6yq4gi1"))))
249 (build-system gnu-build-system)
250 (arguments
251 `(#:parallel-tests? #f))
252 ;; FIXME: configure also looks for xmms, input could be added once it exists
253 (propagated-inputs (list libogg)) ; required by flac.pc
254 (synopsis "Free lossless audio codec")
255 (description
256 "FLAC stands for Free Lossless Audio Codec, an audio format that is lossless,
257 meaning that audio is compressed in FLAC without any loss in quality.")
258 (license (license:non-copyleft "file://COPYING"
259 "See COPYING in the distribution.")) ; and LGPL and GPL
260 (home-page "https://xiph.org/flac/")))
261
262 (define-public libkate
263 (package
264 (name "libkate")
265 (version "0.4.1")
266 (source (origin
267 (method url-fetch)
268 (uri (string-append "https://downloads.xiph.org/releases/kate/"
269 "libkate-" version ".tar.gz"))
270 (sha256
271 (base32
272 "0s3vr2nxfxlf1k75iqpp4l78yf4gil3f0v778kvlngbchvaq23n4"))))
273 (build-system gnu-build-system)
274 (native-inputs (list doxygen bison pkg-config))
275 ;; FIXME: Add optional input liboggz
276 (inputs (list libogg libpng python-wrapper zlib))
277 (synopsis "Karaoke and text codec for embedding in ogg")
278 (description
279 "Kate is an overlay codec, originally designed for karaoke and text,
280 that can be multiplixed in Ogg. Text and images can be carried by a Kate
281 stream, and animated. Most of the time, this would be multiplexed with
282 audio/video to carry subtitles, song lyrics (with or without karaoke data),
283 etc., but doesn't have to be.
284
285 Series of curves (splines, segments, etc.) may be attached to various
286 properties (text position, font size, etc.) to create animated overlays.
287 This allows scrolling or fading text to be defined. This can even be used
288 to draw arbitrary shapes, so hand drawing can also be represented by a
289 Kate stream.")
290 (license license:bsd-3)
291 (home-page "https://wiki.xiph.org/OggKate")))
292
293 (define-public vorbis-tools
294 (package
295 (name "vorbis-tools")
296 (version "1.4.2")
297 (source (origin
298 (method url-fetch)
299 (uri (string-append "https://downloads.xiph.org/releases/vorbis/"
300 "vorbis-tools-" version ".tar.gz"))
301 (sha256
302 (base32
303 "1c7h4ivgfdyygz2hyh6nfibxlkz8kdk868a576qkkjgj5gn78xyv"))))
304 (build-system gnu-build-system)
305 (inputs (list ao
306 curl
307 flac
308 libkate
309 libogg
310 libvorbis
311 speex))
312 (native-inputs (list pkg-config))
313 (synopsis "Ogg vorbis tools")
314 (description
315 "Ogg vorbis is a non-proprietary, patent-and-royalty-free,
316 general-purpose compressed audio format.
317
318 The package vorbis-tools contains
319 ogg123, an ogg vorbis command line audio player;
320 oggenc, the ogg vorbis encoder;
321 oggdec, a simple, portable command line decoder (to wav and raw);
322 ogginfo, to obtain information (tags, bitrate, length, etc.) about
323 an ogg vorbis file.")
324 (license license:gpl2)
325 (home-page "https://xiph.org/vorbis/")))
326
327 (define-public opus
328 (package
329 (name "opus")
330 (version "1.3.1")
331 (source (origin
332 (method url-fetch)
333 (uri (string-append "https://archive.mozilla.org/pub/opus/opus-"
334 version ".tar.gz"))
335 (sha256
336 (base32
337 "17gz8kxs4i7icsc1gj713gadiapyklynlwqlf0ai98dj4lg8xdb5"))))
338 (build-system gnu-build-system)
339 (arguments
340 '(#:configure-flags '("--disable-static")))
341 (synopsis "Versatile audio codec")
342 (description
343 "Opus is a totally open, royalty-free, highly versatile audio codec. Opus
344 is unmatched for interactive speech and music transmission over the Internet,
345 but is also intended for storage and streaming applications. It is
346 standardized by the Internet Engineering Task Force (IETF) as RFC 6716 which
347 incorporated technology from Skype's SILK codec and Xiph.Org's CELT codec.")
348 (license license:bsd-3)
349 (home-page "https://www.opus-codec.org")))
350
351 (define-public opus-tools
352 (package
353 (name "opus-tools")
354 (version "0.2")
355 (source (origin
356 (method url-fetch)
357 (uri (string-append
358 "https://downloads.xiph.org/releases/opus/opus-tools-"
359 version ".tar.gz"))
360 (sha256
361 (base32
362 "11pzl27s4vcz4m18ch72nivbhww2zmzn56wspb7rll1y1nq6rrdl"))))
363 (build-system gnu-build-system)
364 (arguments
365 ;; The package developers misuse pkg-config such that it doesn't work
366 ;; when cross compiling. Therefore we avoid it completly and set the
367 ;; necessary flags ourselves.
368 `(#:configure-flags (list (string-append "CFLAGS=-I"
369 (assoc-ref %build-inputs "libogg")
370 "/include -I"
371 (assoc-ref %build-inputs "opus")
372 "/include/opus"))))
373 (native-inputs
374 (list pkg-config))
375 (inputs
376 (list libopusenc opusfile flac))
377 (synopsis
378 "Command line utilities to encode, inspect, and decode .opus files")
379 (description "Opus is a royalty-free, highly versatile audio codec.
380 Opus-tools provide command line utilities for creating, inspecting and
381 decoding .opus files.")
382 (license license:bsd-3)
383 (home-page "https://www.opus-codec.org")))
384
385 (define-public opusfile
386 (package
387 (name "opusfile")
388 (version "0.12")
389 (source (origin
390 (method url-fetch)
391 (uri (string-append
392 "https://downloads.xiph.org/releases/opus/opusfile-" version
393 ".tar.gz"))
394 (sha256
395 (base32
396 "02smwc5ah8nb3a67mnkjzqmrzk43j356hgj2a97s9midq40qd38i"))))
397 (build-system gnu-build-system)
398 (arguments
399 '(#:configure-flags '("--disable-static")
400 #:phases
401 (modify-phases %standard-phases
402 (add-after 'unpack 'fix-multistream
403 ;; Opus include directory should be passed explicitly:
404 ;; https://github.com/xiph/opusfile/issues/10 however,
405 ;; opus_multistream.h still can't be found by the compiler.
406 (lambda _
407 (substitute* "include/opusfile.h"
408 (("opus_multistream\\.h") "opus/opus_multistream.h")))))))
409 ;; Required by opusfile.pc and opusurl.pc.
410 (propagated-inputs
411 (list libogg openssl opus))
412 (native-inputs
413 (list pkg-config))
414 (synopsis "Versatile audio codec")
415 (description
416 "The opusfile library provides seeking, decode, and playback of Opus
417 streams in the Ogg container (.opus files) including over http(s) on posix and
418 windows systems.")
419 (license license:bsd-3)
420 (home-page "https://www.opus-codec.org")))
421
422 (define-public libopusenc
423 (package
424 (name "libopusenc")
425 (version "0.2.1")
426 (source (origin
427 (method url-fetch)
428 (uri (string-append "https://archive.mozilla.org/pub/opus/"
429 "libopusenc-" version ".tar.gz"))
430 (sha256
431 (base32
432 "1ffb0vhlymlsq70pxsjj0ksz77yfm2x0a1x8q50kxmnkm1hxp642"))))
433 (build-system gnu-build-system)
434 (native-inputs
435 (list pkg-config))
436 (propagated-inputs
437 (list opus))
438 (synopsis "Library for encoding Opus audio files and streams")
439 (description "The libopusenc libraries provide a high-level API for
440 encoding Opus files and streams.")
441 (home-page "https://www.opus-codec.org/")
442 (license license:bsd-3)))
443
444 (define-public icecast
445 (package
446 (name "icecast")
447 (version "2.4.4")
448 (source (origin
449 (method url-fetch)
450 (uri (string-append
451 "https://downloads.xiph.org/releases/icecast/icecast-"
452 version ".tar.gz"))
453 (sha256
454 (base32
455 "0i2d9rhav0x6js2qhjf5iy6j2a7f0d11ail0lfv40hb1kygrgda9"))))
456 (build-system gnu-build-system)
457 (native-inputs
458 (list pkg-config))
459 (inputs
460 (list libxslt
461 libxml2
462 openssl
463 curl
464 libogg
465 libvorbis
466 libtheora
467 speex))
468 (synopsis "Streaming media server")
469 (description "Icecast is a streaming media server which currently supports
470 Ogg (Vorbis and Theora), Opus, WebM and MP3 audio streams. It can be used to
471 create an Internet radio station or a privately running jukebox and many
472 things in between.")
473 (home-page "https://icecast.org/")
474 (license license:gpl2)))
475
476 (define-public libshout
477 (package
478 (name "libshout")
479 (version "2.4.6")
480 (source (origin
481 (method url-fetch)
482 (uri (string-append
483 "https://downloads.xiph.org/releases/libshout/"
484 "libshout-" version ".tar.gz"))
485 (sha256
486 (base32
487 "0469yzc1csm25f5dbyb7ly7i1mzjz13pw8c8bmswkpfzxzqd9jrr"))))
488 (build-system gnu-build-system)
489 (native-inputs
490 (list pkg-config))
491 (propagated-inputs
492 ;; shout.pc refers to all these.
493 (list libtheora libvorbis speex))
494 (home-page "https://icecast.org/")
495 (synopsis "Audio streaming library for icecast encoders")
496 (description
497 "Libshout is a library for communicating with and sending data to an
498 icecast server. It handles the socket connection, the timing of the data,
499 and prevents bad data from getting to the icecast server.")
500 (license license:gpl2+)))
501
502 (define-public rnnoise
503 ;; No upstream release
504 (let ((commit "7f449bf8bd3b933891d12c30112268c4090e4d59")
505 (revision "0"))
506 (package
507 (name "rnnoise")
508 (version (git-version "0" revision commit))
509 (source (origin
510 (method git-fetch)
511 (uri (git-reference
512 (url "https://gitlab.xiph.org/xiph/rnnoise")
513 (commit commit)))
514 (file-name (git-file-name name version))
515 (sha256
516 (base32
517 "0y8jdvxd9namw4f9hcmcmm2q0f32mnhfyjap8906hl308cws3rkj"))))
518 (build-system gnu-build-system)
519 (native-inputs
520 (list autoconf automake libtool))
521 (home-page "https://gitlab.xiph.org/xiph/rnnoise")
522 (synopsis "Real-time noise suppression")
523 (description "RNNoise is a noise suppression library based on a recurrent
524 neural network. The algorithm is described in Jean-Marc Valin's paper
525 @cite{A Hybrid DSP/Deep Learning Approach to Real-Time Full-Band Speech
526 Enhancement}.")
527 (license license:bsd-3))))