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