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