Merge branch 'master' into staging
[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 (native-inputs
147 `(("pkg-config" ,pkg-config)))
148 (inputs
149 `(("libogg" ,libogg)
150 ("speexdsp" ,speexdsp)))
151 (home-page "https://gnu.org/software/speex")
152 (synopsis "Library for patent-free audio compression format")
153 (description
154 "GNU Speex is a patent-free audio compression codec specially designed
155 for speech. It is well-adapted to internet applications, such as VoIP. It
156 features compression of different bands in the same bitstream, intensity
157 stereo encoding, and voice activity detection.")
158 ;; 'src/getopt.c' is under LGPLv2+
159 (license (license:non-copyleft "file://COPYING"
160 "See COPYING in the distribution."))))
161
162 (define speexdsp
163 (package
164 (name "speexdsp")
165 (version "1.2.0")
166 (source (origin
167 (method url-fetch)
168 (uri (string-append "https://downloads.xiph.org/releases/speex/"
169 "speexdsp-" version ".tar.gz"))
170 (sha256
171 (base32
172 "0wa7sqpk3x61zz99m7lwkgr6yv62ml6lfgs5xja65vlvdzy44838"))))
173 (build-system gnu-build-system)
174 (arguments
175 `(#:configure-flags '(,@(if (string=? "aarch64-linux"
176 (%current-system))
177 '("--enable-neon=no") ; neon defaults to armv7-a
178 '()))))
179 (home-page "https://speex.org/")
180 (synopsis "Speex processing library")
181 (description
182 "SpeexDSP is a @dfn{DSP} (Digital Signal Processing) library based on
183 work from the @code{speex} codec.")
184 (license (license:non-copyleft "file://COPYING"
185 "See COPYING in the distribution."))))
186
187 (define ao
188 (package
189 (name "ao")
190 ;; We need a few commits on top of 1.2.2 to fix CVE-2017-11548.
191 (version "1.2.2-5-g20dc8ed")
192 (source (origin
193 (method git-fetch)
194 (uri (git-reference
195 (url "https://git.xiph.org/libao.git")
196 (commit version)))
197 (file-name (git-file-name name version))
198 (sha256
199 (base32
200 "1d1b3g2a7jd43c32242yq6nfysqsmp7rjslhvbrmpgk119l5fnbj"))))
201 (build-system gnu-build-system)
202 ;; FIXME: Add further backends, see the summary printed after configure.
203 ;; XXX: Should back-ends be pushed to different outputs? For instance,
204 ;; "out" would include only the ALSA back-end, while "pulse" would
205 ;; contain 'lib/ao/plugins-4/libpulse.*'.
206 (inputs
207 `(("alsa-lib" ,alsa-lib)
208 ("pulseaudio" ,pulseaudio)))
209 (native-inputs
210 `(("pkg-config" ,pkg-config)
211 ("autoconf" ,autoconf)
212 ("automake" ,automake)
213 ("libtool" ,libtool)))
214 (synopsis "Cross platform audio library")
215 (description
216 "Libao is a cross-platform audio library that allows programs to
217 output audio using a simple API on a wide variety of platforms.
218 It currently supports:
219 @enumerate
220 @item Null output (handy for testing without a sound device),
221 @item WAV files,
222 @item AU files,
223 @item RAW files,
224 @item OSS (Open Sound System, used on Linux and FreeBSD),
225 @item ALSA (Advanced Linux Sound Architecture),
226 @item aRts (Analog RealTime Synth, used by KDE),
227 @item PulseAudio (next generation GNOME sound server),
228 @item esd (EsounD or Enlightened Sound Daemon),
229 @item Mac OS X,
230 @item Windows (98 and later),
231 @item AIX,
232 @item Sun/NetBSD/OpenBSD,
233 @item IRIX,
234 @item NAS (Network Audio Server),
235 @item RoarAudio (Modern, multi-OS, networked Sound System),
236 @item OpenBSD's sndio.
237 @end enumerate
238 ")
239 (license license:gpl2+)
240 (properties '((cpe-name . "libao")))
241 (home-page "https://www.xiph.org/ao/")))
242
243 (define flac
244 (package
245 (name "flac")
246 (version "1.3.3")
247 (source (origin
248 (method url-fetch)
249 (uri (string-append "https://downloads.xiph.org/releases/flac/flac-"
250 version ".tar.xz"))
251 (sha256
252 (base32
253 "0j0p9sf56a2fm2hkjnf7x3py5ir49jyavg4q5zdyd7bcf6yq4gi1"))))
254 (build-system gnu-build-system)
255 (arguments
256 `(#:parallel-tests? #f))
257 ;; FIXME: configure also looks for xmms, input could be added once it exists
258 (propagated-inputs `(("libogg" ,libogg))) ; required by flac.pc
259 (synopsis "Free lossless audio codec")
260 (description
261 "FLAC stands for Free Lossless Audio Codec, an audio format that is lossless,
262 meaning that audio is compressed in FLAC without any loss in quality.")
263 (license (license:non-copyleft "file://COPYING"
264 "See COPYING in the distribution.")) ; and LGPL and GPL
265 (home-page "https://xiph.org/flac/")))
266
267 (define libkate
268 (package
269 (name "libkate")
270 (version "0.4.1")
271 (source (origin
272 (method url-fetch)
273 (uri (string-append "https://downloads.xiph.org/releases/kate/"
274 "libkate-" version ".tar.gz"))
275 (sha256
276 (base32
277 "0s3vr2nxfxlf1k75iqpp4l78yf4gil3f0v778kvlngbchvaq23n4"))))
278 (build-system gnu-build-system)
279 (native-inputs `(("doxygen" ,doxygen)
280 ("pkg-config" ,pkg-config)))
281 ;; FIXME: Add optional input liboggz
282 (inputs `(("bison" ,bison)
283 ("libogg" ,libogg)
284 ("libpng" ,libpng)
285 ("python" ,python-wrapper)
286 ("zlib" ,zlib)))
287 (synopsis "Karaoke and text codec for embedding in ogg")
288 (description
289 "Kate is an overlay codec, originally designed for karaoke and text,
290 that can be multiplixed in Ogg. Text and images can be carried by a Kate
291 stream, and animated. Most of the time, this would be multiplexed with
292 audio/video to carry subtitles, song lyrics (with or without karaoke data),
293 etc., but doesn't have to be.
294
295 Series of curves (splines, segments, etc.) may be attached to various
296 properties (text position, font size, etc.) to create animated overlays.
297 This allows scrolling or fading text to be defined. This can even be used
298 to draw arbitrary shapes, so hand drawing can also be represented by a
299 Kate stream.")
300 (license license:bsd-3)
301 (home-page "https://wiki.xiph.org/OggKate")))
302
303 (define vorbis-tools
304 (package
305 (name "vorbis-tools")
306 (version "1.4.0")
307 (source (origin
308 (method url-fetch)
309 (uri (string-append "https://downloads.xiph.org/releases/vorbis/"
310 "vorbis-tools-" version ".tar.gz"))
311 (sha256
312 (base32
313 "1g12bnh5ah08v529y72kfdz5lhvy75iaz7f9jskyby23m9dkk2d3"))
314 (patches (search-patches
315 "vorbis-tools-CVE-2014-9638+CVE-2014-9639.patch"
316 "vorbis-tools-CVE-2014-9640.patch"
317 "vorbis-tools-CVE-2015-6749.patch"))))
318 (build-system gnu-build-system)
319 (inputs `(("ao" ,ao)
320 ("curl" ,curl)
321 ("flac" ,flac)
322 ("libkate" ,libkate)
323 ("libogg" ,libogg)
324 ("libvorbis" ,libvorbis)
325 ("speex" ,speex)))
326 (native-inputs `(("pkg-config" ,pkg-config)))
327 (synopsis "Ogg vorbis tools")
328 (description
329 "Ogg vorbis is a non-proprietary, patent-and-royalty-free,
330 general-purpose compressed audio format.
331
332 The package vorbis-tools contains
333 ogg123, an ogg vorbis command line audio player;
334 oggenc, the ogg vorbis encoder;
335 oggdec, a simple, portable command line decoder (to wav and raw);
336 ogginfo, to obtain information (tags, bitrate, length, etc.) about
337 an ogg vorbis file.")
338 (license license:gpl2)
339 (home-page "https://xiph.org/vorbis/")))
340
341 (define opus
342 (package
343 (name "opus")
344 (version "1.3.1")
345 (source (origin
346 (method url-fetch)
347 (uri (string-append "https://archive.mozilla.org/pub/opus/opus-"
348 version ".tar.gz"))
349 (sha256
350 (base32
351 "17gz8kxs4i7icsc1gj713gadiapyklynlwqlf0ai98dj4lg8xdb5"))))
352 (build-system gnu-build-system)
353 (synopsis "Versatile audio codec")
354 (description
355 "Opus is a totally open, royalty-free, highly versatile audio codec. Opus
356 is unmatched for interactive speech and music transmission over the Internet,
357 but is also intended for storage and streaming applications. It is
358 standardized by the Internet Engineering Task Force (IETF) as RFC 6716 which
359 incorporated technology from Skype's SILK codec and Xiph.Org's CELT codec.")
360 (license license:bsd-3)
361 (home-page "https://www.opus-codec.org")))
362
363 (define opus-tools
364 (package
365 (name "opus-tools")
366 (version "0.2")
367 (source (origin
368 (method url-fetch)
369 (uri (string-append
370 "https://downloads.xiph.org/releases/opus/opus-tools-"
371 version ".tar.gz"))
372 (sha256
373 (base32
374 "11pzl27s4vcz4m18ch72nivbhww2zmzn56wspb7rll1y1nq6rrdl"))))
375 (build-system gnu-build-system)
376 (arguments
377 ;; The package developers misuse pkg-config such that it doesn't work
378 ;; when cross compiling. Therefore we avoid it completly and set the
379 ;; necessary flags ourselves.
380 `(#:configure-flags (list (string-append "CFLAGS=-I"
381 (assoc-ref %build-inputs "libogg")
382 "/include -I"
383 (assoc-ref %build-inputs "opus")
384 "/include/opus"))))
385 (native-inputs
386 `(("pkg-config" ,pkg-config)))
387 (inputs
388 `(("libopusenc" ,libopusenc)
389 ("opusfile" ,opusfile)
390 ("flac" ,flac)))
391 (synopsis
392 "Command line utilities to encode, inspect, and decode .opus files")
393 (description "Opus is a royalty-free, highly versatile audio codec.
394 Opus-tools provide command line utilities for creating, inspecting and
395 decoding .opus files.")
396 (license license:bsd-3)
397 (home-page "https://www.opus-codec.org")))
398
399 (define opusfile
400 (package
401 (name "opusfile")
402 (version "0.11")
403 (source (origin
404 (method url-fetch)
405 (uri (string-append
406 "https://downloads.xiph.org/releases/opus/opusfile-" version
407 ".tar.gz"))
408 (sha256
409 (base32
410 "1gq3aszzl5glgbajw5p1f5a1kdyf23w5vjdmwwrk246syin9pkkl"))))
411 (build-system gnu-build-system)
412 ;; Required by opusfile.pc and opusurl.pc.
413 (propagated-inputs
414 `(("libogg" ,libogg)
415 ("openssl" ,openssl)
416 ("opus" ,opus)))
417 (native-inputs
418 `(("pkg-config" ,pkg-config)))
419 (synopsis "Versatile audio codec")
420 (description
421 "The opusfile library provides seeking, decode, and playback of Opus
422 streams in the Ogg container (.opus files) including over http(s) on posix and
423 windows systems.")
424 (license license:bsd-3)
425 (home-page "https://www.opus-codec.org")))
426
427 (define-public libopusenc
428 (package
429 (name "libopusenc")
430 (version "0.2.1")
431 (source (origin
432 (method url-fetch)
433 (uri (string-append "https://archive.mozilla.org/pub/opus/"
434 "libopusenc-" version ".tar.gz"))
435 (sha256
436 (base32
437 "1ffb0vhlymlsq70pxsjj0ksz77yfm2x0a1x8q50kxmnkm1hxp642"))))
438 (build-system gnu-build-system)
439 (native-inputs
440 `(("pkg-config" ,pkg-config)))
441 (propagated-inputs
442 `(("opus" ,opus)))
443 (synopsis "Library for encoding Opus audio files and streams ")
444 (description "The libopusenc libraries provide a high-level API for
445 encoding Opus files and streams.")
446 (home-page "https://www.opus-codec.org/")
447 (license license:bsd-3)))
448
449 (define-public icecast
450 (package
451 (name "icecast")
452 (version "2.4.4")
453 (source (origin
454 (method url-fetch)
455 (uri (string-append
456 "https://downloads.xiph.org/releases/icecast/icecast-"
457 version ".tar.gz"))
458 (sha256
459 (base32
460 "0i2d9rhav0x6js2qhjf5iy6j2a7f0d11ail0lfv40hb1kygrgda9"))))
461 (build-system gnu-build-system)
462 (native-inputs
463 `(("pkg-config" ,pkg-config)))
464 (inputs
465 `(("libxslt" ,libxslt)
466 ("libxml2" ,libxml2)
467 ("openssl" ,openssl)
468 ("curl" ,curl)
469 ("libogg" ,libogg)
470 ("libvorbis" ,libvorbis)
471 ("libtheora" ,libtheora)
472 ("speex" ,speex)))
473 (synopsis "Streaming media server")
474 (description "Icecast is a streaming media server which currently supports
475 Ogg (Vorbis and Theora), Opus, WebM and MP3 audio streams. It can be used to
476 create an Internet radio station or a privately running jukebox and many
477 things in between.")
478 (home-page "https://icecast.org/")
479 (license license:gpl2)))
480
481 (define-public libshout
482 (package
483 (name "libshout")
484 (version "2.4.2")
485 (source (origin
486 (method url-fetch)
487 (uri (string-append
488 "https://downloads.xiph.org/releases/libshout/"
489 "libshout-" version ".tar.gz"))
490 (sha256
491 (base32
492 "0qgwarqp2p6jy3zadds6dzj8z1jfb2mbwc3lsdlidf527h0a86ym"))))
493 (build-system gnu-build-system)
494 (native-inputs
495 `(("pkg-config" ,pkg-config)))
496 (propagated-inputs
497 ;; shout.pc refers to all these.
498 `(("libtheora" ,libtheora)
499 ("libvorbis" ,libvorbis)
500 ("speex" ,speex)))
501 (home-page "https://icecast.org/")
502 (synopsis "Audio streaming library for icecast encoders")
503 (description
504 "Libshout is a library for communicating with and sending data to an
505 icecast server. It handles the socket connection, the timing of the data,
506 and prevents bad data from getting to the icecast server.")
507 (license license:gpl2+)))