mp3.scm 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
  3. ;;; Copyright © 2014, 2015, 2017, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
  4. ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
  5. ;;; Copyright © 2016, 2021 Efraim Flashner <efraim@flashner.co.il>
  6. ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
  7. ;;; Copyright © 2017, 2019, 2020 Pierre Langlois <pierre.langlois@gmx.com>
  8. ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
  9. ;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
  10. ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
  11. ;;; Copyright © 2021 Simon Streit <simon@netpanic.org>
  12. ;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
  13. ;;;
  14. ;;; This file is part of GNU Guix.
  15. ;;;
  16. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  17. ;;; under the terms of the GNU General Public License as published by
  18. ;;; the Free Software Foundation; either version 3 of the License, or (at
  19. ;;; your option) any later version.
  20. ;;;
  21. ;;; GNU Guix is distributed in the hope that it will be useful, but
  22. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  23. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24. ;;; GNU General Public License for more details.
  25. ;;;
  26. ;;; You should have received a copy of the GNU General Public License
  27. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  28. (define-module (gnu packages mp3)
  29. #:use-module ((guix licenses) #:prefix license:)
  30. #:use-module (gnu packages)
  31. #:use-module (gnu packages autotools)
  32. #:use-module (gnu packages base)
  33. #:use-module (gnu packages gcc)
  34. #:use-module (gnu packages boost)
  35. #:use-module (gnu packages cdrom)
  36. #:use-module (gnu packages check)
  37. #:use-module (gnu packages compression)
  38. #:use-module (gnu packages gettext)
  39. #:use-module (gnu packages ghostscript)
  40. #:use-module (gnu packages ncurses)
  41. #:use-module (gnu packages glib)
  42. #:use-module (gnu packages gtk)
  43. #:use-module (gnu packages pcre)
  44. #:use-module (gnu packages pkg-config)
  45. #:use-module (gnu packages python)
  46. #:use-module (gnu packages python-web)
  47. #:use-module (gnu packages python-xyz)
  48. #:use-module (gnu packages xiph)
  49. #:use-module (gnu packages pulseaudio)
  50. #:use-module (gnu packages linux) ;alsa-lib
  51. #:use-module (gnu packages video) ;ffmpeg
  52. #:use-module (guix packages)
  53. #:use-module (guix download)
  54. #:use-module (guix git-download)
  55. #:use-module (guix utils)
  56. #:use-module (guix build-system gnu)
  57. #:use-module (guix build-system python)
  58. #:use-module (guix build-system cmake))
  59. (define-public libmad
  60. (package
  61. (name "libmad")
  62. (version "0.15.1b")
  63. (source (origin
  64. (method url-fetch)
  65. (uri (string-append "mirror://sourceforge/mad/libmad/"
  66. version "/libmad-"
  67. version ".tar.gz"))
  68. (sha256
  69. (base32
  70. "14460zhacxhswnzb36qfpd1f2wbk10qvksvm6wyq5hpvdgnw7ymv"))
  71. (patches (search-patches "libmad-armv7-thumb-pt1.patch"
  72. "libmad-armv7-thumb-pt2.patch"
  73. "libmad-md_size.patch"
  74. "libmad-length-check.patch"
  75. "libmad-mips-newgcc.patch"))))
  76. (build-system gnu-build-system)
  77. (arguments
  78. `(#:phases
  79. (modify-phases %standard-phases
  80. (add-before 'configure 'remove-unsupported-gcc-flags
  81. (lambda _
  82. ;; remove option that is not supported by gcc any more
  83. (substitute* "configure" ((" -fforce-mem") ""))
  84. #t))
  85. ;; Normally one should not add a pkg-config file if one is not provided
  86. ;; by upstream developers, but Audacity expects a pkg-config file for
  87. ;; this package, and other major GNU/Linux distributions already provide
  88. ;; such a file.
  89. (add-after 'install 'install-pkg-config
  90. (lambda* (#:key outputs #:allow-other-keys)
  91. (let* ((out (assoc-ref outputs "out"))
  92. (pkg-config-dir (string-append out "/lib/pkgconfig")))
  93. (mkdir-p pkg-config-dir)
  94. (with-output-to-file (string-append pkg-config-dir "/mad.pc")
  95. (lambda _
  96. (format #t
  97. "prefix=~@*~a~@
  98. libdir=${prefix}/lib~@
  99. includedir=${prefix}/include~@
  100. Name: libmad~@
  101. Description:~@
  102. Version: ~a~@
  103. Libs: -L${libdir} -lmad~@
  104. Cflags: -I${includedir}~%"
  105. out ,version)))))))))
  106. (synopsis "MPEG audio decoder")
  107. (description
  108. "MAD (MPEG Audio Decoder) supports MPEG-1 and the MPEG-2 extension to
  109. lower sampling frequencies, as well as the de facto MPEG 2.5 format.
  110. All three audio layers — Layer I, Layer II, and Layer III (i.e. MP3) — are
  111. fully implemented.
  112. This package contains the library.")
  113. (license license:gpl2+)
  114. (home-page "https://www.underbit.com/products/mad/")))
  115. (define-public libid3tag
  116. (package
  117. (name "libid3tag")
  118. (version "0.15.1b")
  119. (source (origin
  120. (method url-fetch)
  121. (uri (string-append "mirror://sourceforge/mad/libid3tag/"
  122. version "/libid3tag-"
  123. version ".tar.gz"))
  124. (sha256
  125. (base32
  126. "0lb1w883dc46dajbdvnia5870brl5lvnlk7g7y58y9wpg5p4znk3"))))
  127. (build-system gnu-build-system)
  128. (arguments
  129. `(#:phases
  130. (modify-phases %standard-phases
  131. ;; Normally one should not add a pkg-config file if one is not provided
  132. ;; by upstream developers, but Audacity expects a pkg-config file for
  133. ;; this package, and other major GNU/Linux distributions already provide
  134. ;; such a file.
  135. (add-after 'install 'install-pkg-config
  136. (lambda* (#:key outputs #:allow-other-keys)
  137. (let* ((out (assoc-ref outputs "out"))
  138. (pkg-config-dir (string-append out "/lib/pkgconfig")))
  139. (mkdir-p pkg-config-dir)
  140. (with-output-to-file (string-append pkg-config-dir "/id3tag.pc")
  141. (lambda _
  142. (format #t
  143. "prefix=~@*~a~@
  144. libdir=${prefix}/lib~@
  145. includedir=${prefix}/include~@
  146. Name: libid3tag~@
  147. Description:~@
  148. Version: ~a~@
  149. Libs: -L${libdir} -lid3tag -lz~@
  150. Cflags: -I${includedir}~%"
  151. out ,version)))))))))
  152. (inputs `(("zlib" ,zlib)))
  153. (synopsis "Library for reading ID3 tags")
  154. (description
  155. "Libid3tag is a library for reading ID3 tags, both ID3v1 and the various
  156. versions of ID3v2.")
  157. (license license:gpl2+)
  158. (home-page "https://www.underbit.com/products/mad/")))
  159. (define-public id3lib
  160. (package
  161. (name "id3lib")
  162. (version "3.8.3")
  163. (source (origin
  164. (method url-fetch)
  165. (uri (string-append "mirror://sourceforge/id3lib/id3lib/"
  166. version "/id3lib-" version ".tar.gz"))
  167. (sha256
  168. (base32
  169. "0yfhqwk0w8q2hyv1jib1008jvzmwlpsxvc8qjllhna6p1hycqj97"))
  170. (modules '((guix build utils)))
  171. ;; Don't use bundled zlib
  172. (snippet '(begin (delete-file-recursively "zlib") #t))
  173. (patches (search-patches "id3lib-CVE-2007-4460.patch"
  174. "id3lib-UTF16-writing-bug.patch"))))
  175. (build-system gnu-build-system)
  176. (inputs `(("zlib" ,zlib)))
  177. (arguments
  178. `(#:phases
  179. (modify-phases %standard-phases
  180. (add-before 'configure 'apply-patches
  181. ;; TODO: create a patch for origin instead?
  182. (lambda _
  183. (substitute* "configure"
  184. (("iomanip.h") "")) ; drop check for unused header
  185. ;; see http://www.linuxfromscratch.org/patches/downloads/id3lib/
  186. (substitute* "include/id3/id3lib_strings.h"
  187. (("include <string>") "include <cstring>\n#include <string>"))
  188. (substitute* "include/id3/writers.h"
  189. (("//\\#include <string.h>") "#include <cstring>"))
  190. (substitute* "examples/test_io.cpp"
  191. (("dami;") "dami;\nusing namespace std;"))
  192. #t)))))
  193. (synopsis "Library for reading, writing, and manipulating ID3v1 and ID3v2 tags")
  194. (description
  195. "Id3lib is a cross-platform software development library for reading,
  196. writing, and manipulating ID3v1 and ID3v2 tags. It is an on-going project
  197. whose primary goals are full compliance with the ID3v2 standard, portability
  198. across several platforms, and providing a powerful and feature-rich API with
  199. a highly stable and efficient implementation.")
  200. (license license:lgpl2.0+)
  201. (home-page "http://id3lib.sourceforge.net/")))
  202. (define-public taglib
  203. (package
  204. (name "taglib")
  205. (version "1.12")
  206. (source (origin
  207. (method git-fetch)
  208. (uri (git-reference
  209. (url "https://github.com/taglib/taglib")
  210. (commit (string-append "v" version))))
  211. (file-name (git-file-name name version))
  212. (sha256
  213. (base32
  214. "0q7dkn5rh9v6b0scmcp2qmjv3iransafmpn6jvgid0yq75m2nqd2"))))
  215. (build-system cmake-build-system)
  216. (arguments
  217. '(#:tests? #f ; Tests are not ran with BUILD_SHARED_LIBS on.
  218. #:configure-flags (list "-DBUILD_SHARED_LIBS=ON")
  219. #:phases (modify-phases %standard-phases
  220. (add-before 'configure 'adjust-zlib-ldflags
  221. (lambda* (#:key inputs #:allow-other-keys)
  222. ;; Make sure users of 'taglib-config --libs' get the -L
  223. ;; flag for zlib.
  224. (substitute* "CMakeLists.txt"
  225. (("set\\(ZLIB_LIBRARIES_FLAGS -lz\\)")
  226. (string-append "set(ZLIB_LIBRARIES_FLAGS \"-L"
  227. (assoc-ref inputs "zlib")
  228. "/lib -lz\")")))
  229. #t)))))
  230. (inputs `(("zlib" ,zlib)))
  231. (home-page "https://taglib.org")
  232. (synopsis "Library to access audio file meta-data")
  233. (description
  234. "TagLib is a C++ library for reading and editing the meta-data of several
  235. popular audio formats. Currently it supports both ID3v1 and ID3v2 for MP3
  236. files, Ogg Vorbis comments and ID3 tags and Vorbis comments in FLAC, MPC,
  237. Speex, WavPack TrueAudio, WAV, AIFF, MP4 and ASF files.")
  238. ;; Dual-licensed: user may choose between LGPLv2.1 or MPLv1.1.
  239. (license (list license:lgpl2.1 license:mpl1.1))))
  240. (define-public mp3info
  241. (package
  242. (name "mp3info")
  243. (version "0.8.5a")
  244. (source (origin
  245. (method url-fetch)
  246. (uri (string-append
  247. "https://ibiblio.org"
  248. "/pub/linux/apps/sound/mp3-utils/mp3info/mp3info-"
  249. version ".tgz"))
  250. (sha256
  251. (base32
  252. "042f1czcs9n2sbqvg4rsvfwlqib2gk976mfa2kxlfjghx5laqf04"))
  253. (modules '((guix build utils)))
  254. (snippet
  255. '(begin
  256. (substitute* "Makefile"
  257. (("/bin/rm") "rm")
  258. (("/usr/bin/install") "install")
  259. (("man/man1") "share/man/man1"))
  260. #t))))
  261. (build-system gnu-build-system)
  262. (outputs '("out" "gui")) ;GTK+ interface in "gui"
  263. (arguments
  264. '(#:phases
  265. (modify-phases %standard-phases
  266. (replace 'configure
  267. (lambda* (#:key outputs #:allow-other-keys)
  268. (let ((out (assoc-ref outputs "out")))
  269. (substitute* "Makefile"
  270. (("prefix=.*")
  271. (string-append "prefix := " out "\n"))))
  272. #t))
  273. (add-before 'install 'pre-install
  274. (lambda* (#:key outputs #:allow-other-keys)
  275. (let ((out (assoc-ref outputs "out")))
  276. (mkdir-p (string-append out "/bin"))
  277. (mkdir-p (string-append out "/share/man/man1")))
  278. #t))
  279. (add-after 'install 'post-install
  280. (lambda* (#:key outputs #:allow-other-keys)
  281. ;; Move the GTK+ interface to "gui".
  282. (let ((out (assoc-ref outputs "out"))
  283. (gui (assoc-ref outputs "gui")))
  284. (mkdir-p (string-append gui "/bin"))
  285. (rename-file (string-append out "/bin/gmp3info")
  286. (string-append gui "/bin/gmp3info")))
  287. #t)))
  288. #:tests? #f))
  289. (native-inputs
  290. `(("pkg-config" ,pkg-config)))
  291. (inputs
  292. `(("gtk+" ,gtk+-2)
  293. ("ncurses" ,ncurses)))
  294. (home-page "https://www.ibiblio.org/mp3info/")
  295. (synopsis "MP3 technical info viewer and ID3 1.x tag editor")
  296. (description
  297. "MP3Info is a little utility used to read and modify the ID3 tags of MP3
  298. files. MP3Info can also display various technical aspects of an MP3 file
  299. including playing time, bit-rate, sampling frequency and other attributes in a
  300. pre-defined or user-specifiable output format.")
  301. (license license:gpl2+)))
  302. (define-public libmp3splt
  303. (package
  304. (name "libmp3splt")
  305. (version "0.9.2")
  306. (source (origin
  307. (method url-fetch)
  308. (uri (string-append "mirror://sourceforge/mp3splt/libmp3splt/"
  309. version "/libmp3splt-"
  310. version ".tar.gz"))
  311. (sha256
  312. (base32
  313. "1p1mn2hsmj5cp40fnc8g1yfvk72p8pjxi866gjdkgjsqrr7xdvih"))))
  314. (build-system gnu-build-system)
  315. (inputs `(("flac" ,flac)
  316. ("libid3tag" ,libid3tag)
  317. ("libmad" ,libmad)
  318. ("libogg" ,libogg)
  319. ("libltdl" ,libltdl)
  320. ("libvorbis" ,libvorbis)
  321. ("pcre" ,pcre)))
  322. (native-inputs
  323. `(("pkg-config" ,pkg-config)))
  324. (synopsis "Library for splitting mp3 and ogg vorbis files")
  325. (description
  326. "Mp3splt is a utility to split mp3 and ogg vorbis files selecting a begin
  327. and an end time position, without decoding. For splitting an album, one may
  328. select split points and file names manually or obtain them automatically from
  329. CDDB (internet or a local file) or from .cue files. The tool also supports
  330. automatic silence split, that can be used also to adjust cddb/cue splitpoints.
  331. This package contains the library.")
  332. (license license:gpl2+)
  333. (home-page "http://mp3splt.sourceforge.net/mp3splt_page/home.php")))
  334. (define-public mp3splt
  335. (package
  336. (name "mp3splt")
  337. (version "2.6.2")
  338. (source (origin
  339. (method url-fetch)
  340. (uri (string-append "mirror://sourceforge/mp3splt/mp3splt/"
  341. version "/mp3splt-"
  342. version ".tar.gz"))
  343. (sha256
  344. (base32
  345. "1aiv20gypb6r84qabz8gblk8vi42cg3x333vk2pi3fyqvl82phry"))))
  346. (build-system gnu-build-system)
  347. (native-inputs `(("pkg-config" ,pkg-config)))
  348. (inputs `(("libmp3splt" ,libmp3splt)))
  349. (synopsis "Utility for splitting mp3 and ogg vorbis files")
  350. (description
  351. "Mp3splt is a utility to split mp3 and ogg vorbis files selecting a begin
  352. and an end time position, without decoding. For splitting an album, one may
  353. select split points and file names manually or obtain them automatically from
  354. CDDB (internet or a local file) or from .cue files. The tool also supports
  355. automatic silence split, that can be used also to adjust cddb/cue splitpoints.
  356. This package contains the binary.")
  357. (license license:gpl2+)
  358. (home-page "http://mp3splt.sourceforge.net/mp3splt_page/home.php")))
  359. (define-public mpg123
  360. (package
  361. (name "mpg123")
  362. (version "1.28.2")
  363. (source
  364. (origin
  365. (method url-fetch)
  366. (uri (list (string-append "mirror://sourceforge/mpg123/mpg123/"
  367. version "/mpg123-" version ".tar.bz2")
  368. (string-append
  369. "https://www.mpg123.org/download/mpg123-"
  370. version ".tar.bz2")))
  371. (sha256
  372. (base32 "006v44nz4nkpgvxz1k2vbbrfpa2m47hyydscs0wf3iysiyvd9vvy"))))
  373. (build-system gnu-build-system)
  374. (arguments '(#:configure-flags '("--with-default-audio=pulse")))
  375. (native-inputs
  376. `(("pkg-config" ,pkg-config)))
  377. (inputs
  378. `(("alsa-lib" ,alsa-lib)
  379. ("pulseaudio" ,pulseaudio)))
  380. (home-page "https://www.mpg123.org/")
  381. (synopsis "Console MP3 player and decoder library")
  382. (description
  383. "Mpg123 is a real time MPEG 1.0/2.0/2.5 audio player/decoder for layers
  384. 1,2 and 3 (MPEG 1.0 layer 3 aka MP3 most commonly tested). It comes with a
  385. command-line tool as well as a C library, libmpg123.")
  386. (license license:lgpl2.1)))
  387. (define-public mpg321
  388. (package
  389. (name "mpg321")
  390. (version "0.3.2")
  391. (source (origin
  392. (method url-fetch)
  393. (uri (string-append "mirror://sourceforge/mpg321/mpg321/"
  394. version "/mpg321_" version ".orig.tar.gz"))
  395. (file-name (string-append "mpg321-" version ".tar.gz"))
  396. (sha256
  397. (base32
  398. "0ki8mh76bbmdh77qsiw682dvi8y468yhbdabqwg05igmwc1wqvq5"))
  399. (patches
  400. (search-patches "mpg321-CVE-2019-14247.patch"
  401. "mpg321-gcc-10.patch"))))
  402. (build-system gnu-build-system)
  403. (arguments '(#:configure-flags '("--disable-alsa")))
  404. (inputs
  405. `(("zlib" ,zlib)
  406. ("libmad" ,libmad)
  407. ("libid3tag" ,libid3tag)
  408. ("libao" ,ao)))
  409. (home-page "http://mpg321.sourceforge.net/")
  410. (synopsis "Command-line MP3 player")
  411. (description "Mpg321 is a command-line mp3 player. mpg321 is used for
  412. frontends, as an mp3 player and as an mp3 to wave file decoder (primarily for
  413. use with CD-recording software).")
  414. (license license:gpl2)))
  415. (define-public lame
  416. (package
  417. (name "lame")
  418. (version "3.100")
  419. (source (origin
  420. (method url-fetch)
  421. (uri (string-append "mirror://sourceforge/lame/lame/"
  422. (version-major+minor version) "/lame-"
  423. version ".tar.gz"))
  424. (sha256
  425. (base32
  426. "07nsn5sy3a8xbmw1bidxnsj5fj6kg9ai04icmqw40ybkp353dznx"))))
  427. (build-system gnu-build-system)
  428. (arguments
  429. `(#:phases
  430. (modify-phases %standard-phases
  431. (add-after 'install 'install-pkg-config
  432. (lambda* (#:key outputs #:allow-other-keys)
  433. (let* ((out (assoc-ref outputs "out"))
  434. (pkg-config-dir (string-append out "/lib/pkgconfig")))
  435. (mkdir-p pkg-config-dir)
  436. (with-output-to-file (string-append pkg-config-dir "/lame.pc")
  437. (lambda _
  438. (format #t
  439. "prefix=~@*~a~@
  440. libdir=${prefix}/lib~@
  441. includedir=${prefix}/include~@
  442. Name: lame~@
  443. Description:~@
  444. Version: ~a~@
  445. Libs: -L${libdir} -lmp3lame~@
  446. Cflags: -I${includedir}~%"
  447. out ,version)))))))))
  448. (home-page "http://lame.sourceforge.net/")
  449. (synopsis "MPEG Audio Layer III (MP3) encoder")
  450. (description "LAME is a high quality MPEG Audio Layer III (MP3) encoder.")
  451. (license license:lgpl2.0)))
  452. (define-public ripperx
  453. (package
  454. (name "ripperx")
  455. (version "2.8.0")
  456. (source (origin
  457. (method url-fetch)
  458. (uri (string-append "mirror://sourceforge/ripperx/ripperx/"
  459. version "/ripperx-"
  460. version ".tar.bz2"))
  461. (sha256
  462. (base32
  463. "1ss3c1a5hx6c99q1cryxg0jhbnbdj6ga9xyz0dzlz9qhzg5qswfs"))
  464. (patches (search-patches "ripperx-missing-file.patch"))))
  465. (build-system gnu-build-system)
  466. (propagated-inputs
  467. `(("font-ghostscript" ,font-ghostscript)
  468. ("cdparanoia" ,cdparanoia)
  469. ("flac" ,flac)
  470. ("lame" ,lame)
  471. ("vorbis-tools" ,vorbis-tools)))
  472. (inputs
  473. `(("glib" ,glib)
  474. ("gtk+" ,gtk+-2)
  475. ("id3lib" ,id3lib)
  476. ("taglib" ,taglib)))
  477. (native-inputs
  478. `(("pkg-config" ,pkg-config)))
  479. (synopsis "GTK program to rip and encode CD audio tracks")
  480. (description
  481. "RipperX is a GTK program to rip CD audio tracks and encode them to the
  482. Ogg, MP3, or FLAC formats. Its goal is to be easy to use, requiring only
  483. a few mouse clicks to convert an entire album. It supports CDDB lookups
  484. for album and track information.")
  485. (license license:gpl2)
  486. (home-page "https://sourceforge.net/projects/ripperx/")))
  487. (define-public libmpcdec
  488. (package
  489. (name "libmpcdec")
  490. (version "1.2.6")
  491. (source (origin
  492. (method url-fetch)
  493. (uri (string-append
  494. "https://files.musepack.net/source/libmpcdec-"
  495. version ".tar.bz2"))
  496. (sha256
  497. (base32
  498. "1a0jdyga1zfi4wgkg3905y6inghy3s4xfs5m4x7pal08m0llkmab"))))
  499. (build-system gnu-build-system)
  500. (synopsis "Decoding library for the Musepack audio format")
  501. (description
  502. "This library supports decoding of the Musepack (MPC) audio compression
  503. format.")
  504. (license license:bsd-3)
  505. (home-page "https://musepack.net")))
  506. (define-public mpc123
  507. (package
  508. (name "mpc123")
  509. (version "0.2.4")
  510. (source (origin
  511. (method url-fetch)
  512. (uri (list (string-append "mirror://sourceforge/mpc123/version%20"
  513. version "/mpc123-" version ".tar.gz")
  514. (string-append "mirror://debian/pool/main/m/" name
  515. "/" name "_" version ".orig.tar.gz")))
  516. (sha256
  517. (base32
  518. "0sf4pns0245009z6mbxpx7kqy4kwl69bc95wz9v23wgappsvxgy1"))
  519. (patches (search-patches "mpc123-initialize-ao.patch"))))
  520. (build-system gnu-build-system)
  521. (arguments
  522. '(#:phases
  523. (modify-phases %standard-phases
  524. (replace 'configure
  525. (lambda _
  526. (substitute* "Makefile"
  527. (("CC[[:blank:]]*:=.*")
  528. "CC := gcc\n"))
  529. (setenv "CFLAGS" "-fcommon -g"))) ;allow compilation with GCC 10
  530. (replace 'install
  531. (lambda* (#:key outputs #:allow-other-keys)
  532. (let* ((out (assoc-ref outputs "out"))
  533. (bin (string-append out "/bin")))
  534. (install-file "mpc123" bin)))))
  535. #:tests? #f))
  536. (native-inputs
  537. `(("gettext" ,gettext-minimal)))
  538. (inputs
  539. `(("libao" ,ao)
  540. ("libmpcdec" ,libmpcdec)))
  541. (home-page "https://github.com/bucciarati/mpc123")
  542. (synopsis "Audio player for Musepack-formatted files")
  543. (description
  544. "Mpc123 is a command-line player for files in the Musepack audio
  545. compression format (.mpc files).")
  546. (license license:gpl2+)))
  547. (define-public eyed3
  548. (package
  549. (name "eyed3")
  550. (version "0.8.12")
  551. (source
  552. (origin
  553. (method url-fetch)
  554. (uri (pypi-uri "eyeD3" version))
  555. (sha256
  556. (base32 "0vabr7hh6vy1w8gn35vmx9qwiyrfv734d5ahifg7x3pv0c5fqkp5"))))
  557. (build-system python-build-system)
  558. (arguments
  559. `(#:tests? #f)) ; the required test data contains copyrighted material
  560. (propagated-inputs
  561. `(("python-grako" ,python-grako)
  562. ("python-magic" ,python-magic)
  563. ("python-pathlib" ,python-pathlib)
  564. ("python-six" ,python-six)))
  565. (synopsis "MP3 tag ID3 metadata editor")
  566. (description "eyeD3 is a Python tool for working with audio files,
  567. specifically mp3 files containing ID3 metadata (i.e. song info). It provides a
  568. command-line tool (eyeD3) and a Python library (import eyed3) that can be used
  569. to write your own applications or plugins that are callable from the
  570. command-line tool.")
  571. (home-page "https://eyed3.readthedocs.io/en/latest/")
  572. (license license:gpl2+)))
  573. (define-public chromaprint
  574. (package
  575. (name "chromaprint")
  576. (version "1.5.0")
  577. (source (origin
  578. (method url-fetch)
  579. (uri (string-append
  580. "https://github.com/acoustid/chromaprint/releases/download/v"
  581. version "/chromaprint-" version ".tar.gz"))
  582. (sha256
  583. (base32
  584. "0sknmyl5254rc55bvkhfwpl4dfvz45xglk1rq8zq5crmwq058fjp"))))
  585. (build-system cmake-build-system)
  586. (arguments
  587. `(#:tests? #f ; tests require googletest *sources*
  588. ;;#:configure-flags '("-DBUILD_TESTS=ON") ; for building the tests
  589. #:configure-flags '("-DBUILD_TOOLS=ON") ; for fpcalc
  590. #:test-target "check"))
  591. (inputs
  592. ;; requires one of FFmpeg (prefered), FFTW3 or vDSP
  593. ;; use the same ffmpeg version as for acoustid-fingerprinter
  594. `(("ffmpeg" ,ffmpeg)
  595. ("boost" ,boost)))
  596. (home-page "https://acoustid.org/chromaprint")
  597. (synopsis "Audio fingerprinting library")
  598. (description "Chromaprint is a library for calculating audio
  599. fingerprints which are used by the Acoustid service. Its main purpose
  600. is to provide an accurate identifier for record tracks.")
  601. (license license:lgpl2.1+)))
  602. (define-public python-audioread
  603. (package
  604. (name "python-audioread")
  605. (version "2.1.9")
  606. (source
  607. (origin
  608. (method url-fetch)
  609. (uri (pypi-uri "audioread" version))
  610. (sha256
  611. (base32 "129hab8x9sb3plff2bkq4xnzc3i8k9rgcm1a36l813kc0m10wj53"))))
  612. (build-system python-build-system)
  613. (arguments `(#:tests? #f)) ; there is no "audiofile" fixture
  614. (native-inputs
  615. `(("python-pytest" ,python-pytest)
  616. ("python-pytest-runner" ,python-pytest-runner)))
  617. (home-page "https://github.com/sampsyo/audioread")
  618. (synopsis "Decode audio files using whichever backend is available")
  619. (description
  620. "This package provides a Python library for audo decoding. It uses
  621. whatever audio backend is available, such as GStreamer, Core Audio, MAD,
  622. FFmpeg, etc.")
  623. (license license:expat)))
  624. (define-public python-pyacoustid
  625. (package
  626. (name "python-pyacoustid")
  627. (version "1.2.2")
  628. (source
  629. (origin
  630. (method url-fetch)
  631. (uri (pypi-uri "pyacoustid" version))
  632. (sha256
  633. (base32
  634. "0ha15m41r8ckmanc4k9nrlb9hprvhdjxndzw40a1yj3z1b1xjyf2"))))
  635. (build-system python-build-system)
  636. (arguments
  637. `(#:phases
  638. (modify-phases %standard-phases
  639. (add-after 'unpack 'chromaprint-path
  640. (lambda* (#:key inputs #:allow-other-keys)
  641. (substitute* "chromaprint.py"
  642. (("libchromaprint.so.1")
  643. (string-append (assoc-ref inputs "chromaprint")
  644. "/lib/libchromaprint.so.1")))
  645. (substitute* "acoustid.py"
  646. (("'fpcalc'")
  647. (string-append "'" (assoc-ref inputs "chromaprint")
  648. "/bin/fpcalc'")))
  649. #t)))))
  650. (inputs `(("chromaprint" ,chromaprint)))
  651. (propagated-inputs
  652. `(("python-audioread" ,python-audioread)
  653. ("python-requests" ,python-requests)))
  654. (home-page "https://github.com/beetbox/pyacoustid")
  655. (synopsis "Bindings for Chromaprint acoustic fingerprinting")
  656. (description
  657. "This package provides bindings for the Chromaprint acoustic
  658. fingerprinting library and the Acoustid API.")
  659. (license license:expat)))
  660. (define-public python-pytaglib
  661. (package
  662. (name "python-pytaglib")
  663. (version "1.4.6")
  664. (source
  665. (origin
  666. (method url-fetch)
  667. (uri (pypi-uri "pytaglib" version))
  668. (sha256
  669. (base32
  670. "0li970qslfymz4vk1wrij2nfqw3l15cpc3fjjci48mpvg17gbnhn"))
  671. ;; Delete file generated by Cython.
  672. (modules '((guix build utils)))
  673. (snippet
  674. '(begin
  675. (delete-file "src/taglib.cpp")))))
  676. (build-system python-build-system)
  677. (arguments
  678. '(#:phases
  679. (modify-phases %standard-phases
  680. ;; Ensure that the Cython file is regenerated.
  681. (add-after 'unpack 'setup-environment
  682. (lambda _
  683. (setenv "PYTAGLIB_CYTHONIZE" "1"))))))
  684. (native-inputs
  685. `(("python-cython" ,python-cython)
  686. ("python-pytest" ,python-pytest)))
  687. (inputs
  688. `(("taglib" ,taglib)))
  689. (home-page
  690. "https://github.com/supermihi/pytaglib")
  691. (synopsis
  692. "Python bindings for taglib")
  693. (description
  694. "This package is a Python audio tagging library. It is
  695. cross-platform, works with all Python versions, and is very
  696. simple to use yet fully featured.")
  697. (license license:gpl3)))