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