xiph.scm 19 KB

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