xiph.scm 20 KB

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