xiph.scm 19 KB

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