mp3.scm 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708
  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 (list 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 (list 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 (list 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. (list pkg-config))
  291. (inputs
  292. (list gtk+-2 ncurses))
  293. (home-page "https://www.ibiblio.org/mp3info/")
  294. (synopsis "MP3 technical info viewer and ID3 1.x tag editor")
  295. (description
  296. "MP3Info is a little utility used to read and modify the ID3 tags of MP3
  297. files. MP3Info can also display various technical aspects of an MP3 file
  298. including playing time, bit-rate, sampling frequency and other attributes in a
  299. pre-defined or user-specifiable output format.")
  300. (license license:gpl2+)))
  301. (define-public libmp3splt
  302. (package
  303. (name "libmp3splt")
  304. (version "0.9.2")
  305. (source (origin
  306. (method url-fetch)
  307. (uri (string-append "mirror://sourceforge/mp3splt/libmp3splt/"
  308. version "/libmp3splt-"
  309. version ".tar.gz"))
  310. (sha256
  311. (base32
  312. "1p1mn2hsmj5cp40fnc8g1yfvk72p8pjxi866gjdkgjsqrr7xdvih"))))
  313. (build-system gnu-build-system)
  314. (inputs (list flac
  315. libid3tag
  316. libmad
  317. libogg
  318. libltdl
  319. libvorbis
  320. pcre))
  321. (native-inputs
  322. (list pkg-config))
  323. (synopsis "Library for splitting mp3 and ogg vorbis files")
  324. (description
  325. "Mp3splt is a utility to split mp3 and ogg vorbis files selecting a begin
  326. and an end time position, without decoding. For splitting an album, one may
  327. select split points and file names manually or obtain them automatically from
  328. CDDB (internet or a local file) or from .cue files. The tool also supports
  329. automatic silence split, that can be used also to adjust cddb/cue splitpoints.
  330. This package contains the library.")
  331. (license license:gpl2+)
  332. (home-page "http://mp3splt.sourceforge.net/mp3splt_page/home.php")))
  333. (define-public mp3splt
  334. (package
  335. (name "mp3splt")
  336. (version "2.6.2")
  337. (source (origin
  338. (method url-fetch)
  339. (uri (string-append "mirror://sourceforge/mp3splt/mp3splt/"
  340. version "/mp3splt-"
  341. version ".tar.gz"))
  342. (sha256
  343. (base32
  344. "1aiv20gypb6r84qabz8gblk8vi42cg3x333vk2pi3fyqvl82phry"))))
  345. (build-system gnu-build-system)
  346. (native-inputs (list pkg-config))
  347. (inputs (list libmp3splt))
  348. (synopsis "Utility for splitting mp3 and ogg vorbis files")
  349. (description
  350. "Mp3splt is a utility to split mp3 and ogg vorbis files selecting a begin
  351. and an end time position, without decoding. For splitting an album, one may
  352. select split points and file names manually or obtain them automatically from
  353. CDDB (internet or a local file) or from .cue files. The tool also supports
  354. automatic silence split, that can be used also to adjust cddb/cue splitpoints.
  355. This package contains the binary.")
  356. (license license:gpl2+)
  357. (home-page "http://mp3splt.sourceforge.net/mp3splt_page/home.php")))
  358. (define-public mpg123
  359. (package
  360. (name "mpg123")
  361. (version "1.28.2")
  362. (source
  363. (origin
  364. (method url-fetch)
  365. (uri (list (string-append "mirror://sourceforge/mpg123/mpg123/"
  366. version "/mpg123-" version ".tar.bz2")
  367. (string-append
  368. "https://www.mpg123.org/download/mpg123-"
  369. version ".tar.bz2")))
  370. (sha256
  371. (base32 "006v44nz4nkpgvxz1k2vbbrfpa2m47hyydscs0wf3iysiyvd9vvy"))))
  372. (build-system gnu-build-system)
  373. (arguments '(#:configure-flags '("--with-default-audio=pulse")))
  374. (native-inputs
  375. (list pkg-config))
  376. (inputs
  377. (list alsa-lib pulseaudio))
  378. (home-page "https://www.mpg123.org/")
  379. (synopsis "Console MP3 player and decoder library")
  380. (description
  381. "Mpg123 is a real time MPEG 1.0/2.0/2.5 audio player/decoder for layers
  382. 1,2 and 3 (MPEG 1.0 layer 3 aka MP3 most commonly tested). It comes with a
  383. command-line tool as well as a C library, libmpg123.")
  384. (license license:lgpl2.1)))
  385. (define-public mpg321
  386. (package
  387. (name "mpg321")
  388. (version "0.3.2")
  389. (source (origin
  390. (method url-fetch)
  391. (uri (string-append "mirror://sourceforge/mpg321/mpg321/"
  392. version "/mpg321_" version ".orig.tar.gz"))
  393. (file-name (string-append "mpg321-" version ".tar.gz"))
  394. (sha256
  395. (base32
  396. "0ki8mh76bbmdh77qsiw682dvi8y468yhbdabqwg05igmwc1wqvq5"))
  397. (patches
  398. (search-patches "mpg321-CVE-2019-14247.patch"
  399. "mpg321-gcc-10.patch"))))
  400. (build-system gnu-build-system)
  401. (arguments '(#:configure-flags '("--disable-alsa")))
  402. (inputs
  403. `(("zlib" ,zlib)
  404. ("libmad" ,libmad)
  405. ("libid3tag" ,libid3tag)
  406. ("libao" ,ao)))
  407. (home-page "http://mpg321.sourceforge.net/")
  408. (synopsis "Command-line MP3 player")
  409. (description "Mpg321 is a command-line mp3 player. mpg321 is used for
  410. frontends, as an mp3 player and as an mp3 to wave file decoder (primarily for
  411. use with CD-recording software).")
  412. (license license:gpl2)))
  413. (define-public lame
  414. (package
  415. (name "lame")
  416. (version "3.100")
  417. (source (origin
  418. (method url-fetch)
  419. (uri (string-append "mirror://sourceforge/lame/lame/"
  420. (version-major+minor version) "/lame-"
  421. version ".tar.gz"))
  422. (sha256
  423. (base32
  424. "07nsn5sy3a8xbmw1bidxnsj5fj6kg9ai04icmqw40ybkp353dznx"))))
  425. (build-system gnu-build-system)
  426. (arguments
  427. `(#:phases
  428. (modify-phases %standard-phases
  429. (add-after 'install 'install-pkg-config
  430. (lambda* (#:key outputs #:allow-other-keys)
  431. (let* ((out (assoc-ref outputs "out"))
  432. (pkg-config-dir (string-append out "/lib/pkgconfig")))
  433. (mkdir-p pkg-config-dir)
  434. (with-output-to-file (string-append pkg-config-dir "/lame.pc")
  435. (lambda _
  436. (format #t
  437. "prefix=~@*~a~@
  438. libdir=${prefix}/lib~@
  439. includedir=${prefix}/include~@
  440. Name: lame~@
  441. Description:~@
  442. Version: ~a~@
  443. Libs: -L${libdir} -lmp3lame~@
  444. Cflags: -I${includedir}~%"
  445. out ,version)))))))))
  446. (home-page "http://lame.sourceforge.net/")
  447. (synopsis "MPEG Audio Layer III (MP3) encoder")
  448. (description "LAME is a high quality MPEG Audio Layer III (MP3) encoder.")
  449. (license license:lgpl2.0)))
  450. (define-public ripperx
  451. (package
  452. (name "ripperx")
  453. (version "2.8.0")
  454. (source (origin
  455. (method url-fetch)
  456. (uri (string-append "mirror://sourceforge/ripperx/ripperx/"
  457. version "/ripperx-"
  458. version ".tar.bz2"))
  459. (sha256
  460. (base32
  461. "1ss3c1a5hx6c99q1cryxg0jhbnbdj6ga9xyz0dzlz9qhzg5qswfs"))
  462. (patches (search-patches "ripperx-missing-file.patch"))))
  463. (build-system gnu-build-system)
  464. (propagated-inputs
  465. (list font-ghostscript cdparanoia flac lame vorbis-tools))
  466. (inputs
  467. (list glib gtk+-2 id3lib taglib))
  468. (native-inputs
  469. (list pkg-config))
  470. (synopsis "GTK program to rip and encode CD audio tracks")
  471. (description
  472. "RipperX is a GTK program to rip CD audio tracks and encode them to the
  473. Ogg, MP3, or FLAC formats. Its goal is to be easy to use, requiring only
  474. a few mouse clicks to convert an entire album. It supports CDDB lookups
  475. for album and track information.")
  476. (license license:gpl2)
  477. (home-page "https://sourceforge.net/projects/ripperx/")))
  478. (define-public libmpcdec
  479. (package
  480. (name "libmpcdec")
  481. (version "1.2.6")
  482. (source (origin
  483. (method url-fetch)
  484. (uri (string-append
  485. "https://files.musepack.net/source/libmpcdec-"
  486. version ".tar.bz2"))
  487. (sha256
  488. (base32
  489. "1a0jdyga1zfi4wgkg3905y6inghy3s4xfs5m4x7pal08m0llkmab"))))
  490. (build-system gnu-build-system)
  491. (synopsis "Decoding library for the Musepack audio format")
  492. (description
  493. "This library supports decoding of the Musepack (MPC) audio compression
  494. format.")
  495. (license license:bsd-3)
  496. (home-page "https://musepack.net")))
  497. (define-public mpc123
  498. (package
  499. (name "mpc123")
  500. (version "0.2.4")
  501. (source (origin
  502. (method url-fetch)
  503. (uri (list (string-append "mirror://sourceforge/mpc123/version%20"
  504. version "/mpc123-" version ".tar.gz")
  505. (string-append "mirror://debian/pool/main/m/" name
  506. "/" name "_" version ".orig.tar.gz")))
  507. (sha256
  508. (base32
  509. "0sf4pns0245009z6mbxpx7kqy4kwl69bc95wz9v23wgappsvxgy1"))
  510. (patches (search-patches "mpc123-initialize-ao.patch"))))
  511. (build-system gnu-build-system)
  512. (arguments
  513. '(#:phases
  514. (modify-phases %standard-phases
  515. (replace 'configure
  516. (lambda _
  517. (substitute* "Makefile"
  518. (("CC[[:blank:]]*:=.*")
  519. "CC := gcc\n"))
  520. (setenv "CFLAGS" "-fcommon -g"))) ;allow compilation with GCC 10
  521. (replace 'install
  522. (lambda* (#:key outputs #:allow-other-keys)
  523. (let* ((out (assoc-ref outputs "out"))
  524. (bin (string-append out "/bin")))
  525. (install-file "mpc123" bin)))))
  526. #:tests? #f))
  527. (native-inputs
  528. `(("gettext" ,gettext-minimal)))
  529. (inputs
  530. `(("libao" ,ao)
  531. ("libmpcdec" ,libmpcdec)))
  532. (home-page "https://github.com/bucciarati/mpc123")
  533. (synopsis "Audio player for Musepack-formatted files")
  534. (description
  535. "Mpc123 is a command-line player for files in the Musepack audio
  536. compression format (.mpc files).")
  537. (license license:gpl2+)))
  538. (define-public eyed3
  539. (package
  540. (name "eyed3")
  541. (version "0.8.12")
  542. (source
  543. (origin
  544. (method url-fetch)
  545. (uri (pypi-uri "eyeD3" version))
  546. (sha256
  547. (base32 "0vabr7hh6vy1w8gn35vmx9qwiyrfv734d5ahifg7x3pv0c5fqkp5"))))
  548. (build-system python-build-system)
  549. (arguments
  550. `(#:tests? #f)) ; the required test data contains copyrighted material
  551. (propagated-inputs
  552. (list python-grako python-magic python-pathlib python-six))
  553. (synopsis "MP3 tag ID3 metadata editor")
  554. (description "eyeD3 is a Python tool for working with audio files,
  555. specifically mp3 files containing ID3 metadata (i.e. song info). It provides a
  556. command-line tool (eyeD3) and a Python library (import eyed3) that can be used
  557. to write your own applications or plugins that are callable from the
  558. command-line tool.")
  559. (home-page "https://eyed3.readthedocs.io/en/latest/")
  560. (license license:gpl2+)))
  561. (define-public chromaprint
  562. (package
  563. (name "chromaprint")
  564. (version "1.5.1")
  565. (source (origin
  566. (method url-fetch)
  567. (uri (string-append
  568. "https://github.com/acoustid/chromaprint/releases/download/v"
  569. version "/chromaprint-" version ".tar.gz"))
  570. (sha256
  571. (base32 "072y6c7ijkm6r674f6z089rbdazrmxzpdcsm6y6vf64b7gxdiam1"))))
  572. (build-system cmake-build-system)
  573. (arguments
  574. `(#:tests? #f ; tests require googletest *sources*
  575. ;;#:configure-flags '("-DBUILD_TESTS=ON") ; for building the tests
  576. #:configure-flags '("-DBUILD_TOOLS=ON") ; for fpcalc
  577. #:test-target "check"))
  578. (inputs
  579. ;; requires one of FFmpeg (prefered), FFTW3 or vDSP
  580. ;; use the same ffmpeg version as for acoustid-fingerprinter
  581. (list ffmpeg boost))
  582. (home-page "https://acoustid.org/chromaprint")
  583. (synopsis "Audio fingerprinting library")
  584. (description "Chromaprint is a library for calculating audio
  585. fingerprints which are used by the Acoustid service. Its main purpose
  586. is to provide an accurate identifier for record tracks.")
  587. (license license:lgpl2.1+)))
  588. (define-public python-audioread
  589. (package
  590. (name "python-audioread")
  591. (version "2.1.9")
  592. (source
  593. (origin
  594. (method url-fetch)
  595. (uri (pypi-uri "audioread" version))
  596. (sha256
  597. (base32 "129hab8x9sb3plff2bkq4xnzc3i8k9rgcm1a36l813kc0m10wj53"))))
  598. (build-system python-build-system)
  599. (arguments `(#:tests? #f)) ; there is no "audiofile" fixture
  600. (native-inputs
  601. (list python-pytest python-pytest-runner))
  602. (home-page "https://github.com/sampsyo/audioread")
  603. (synopsis "Decode audio files using whichever backend is available")
  604. (description
  605. "This package provides a Python library for audo decoding. It uses
  606. whatever audio backend is available, such as GStreamer, Core Audio, MAD,
  607. FFmpeg, etc.")
  608. (license license:expat)))
  609. (define-public python-pyacoustid
  610. (package
  611. (name "python-pyacoustid")
  612. (version "1.2.2")
  613. (source
  614. (origin
  615. (method url-fetch)
  616. (uri (pypi-uri "pyacoustid" version))
  617. (sha256
  618. (base32
  619. "0ha15m41r8ckmanc4k9nrlb9hprvhdjxndzw40a1yj3z1b1xjyf2"))))
  620. (build-system python-build-system)
  621. (arguments
  622. `(#:phases
  623. (modify-phases %standard-phases
  624. (add-after 'unpack 'chromaprint-path
  625. (lambda* (#:key inputs #:allow-other-keys)
  626. (substitute* "chromaprint.py"
  627. (("libchromaprint.so.1")
  628. (string-append (assoc-ref inputs "chromaprint")
  629. "/lib/libchromaprint.so.1")))
  630. (substitute* "acoustid.py"
  631. (("'fpcalc'")
  632. (string-append "'" (assoc-ref inputs "chromaprint")
  633. "/bin/fpcalc'")))
  634. #t)))))
  635. (inputs (list chromaprint))
  636. (propagated-inputs
  637. (list python-audioread python-requests))
  638. (home-page "https://github.com/beetbox/pyacoustid")
  639. (synopsis "Bindings for Chromaprint acoustic fingerprinting")
  640. (description
  641. "This package provides bindings for the Chromaprint acoustic
  642. fingerprinting library and the Acoustid API.")
  643. (license license:expat)))
  644. (define-public python-pytaglib
  645. (package
  646. (name "python-pytaglib")
  647. (version "1.4.6")
  648. (source
  649. (origin
  650. (method url-fetch)
  651. (uri (pypi-uri "pytaglib" version))
  652. (sha256
  653. (base32
  654. "0li970qslfymz4vk1wrij2nfqw3l15cpc3fjjci48mpvg17gbnhn"))
  655. ;; Delete file generated by Cython.
  656. (modules '((guix build utils)))
  657. (snippet
  658. '(begin
  659. (delete-file "src/taglib.cpp")))))
  660. (build-system python-build-system)
  661. (arguments
  662. '(#:phases
  663. (modify-phases %standard-phases
  664. ;; Ensure that the Cython file is regenerated.
  665. (add-after 'unpack 'setup-environment
  666. (lambda _
  667. (setenv "PYTAGLIB_CYTHONIZE" "1"))))))
  668. (native-inputs
  669. (list python-cython python-pytest))
  670. (inputs
  671. (list taglib))
  672. (home-page
  673. "https://github.com/supermihi/pytaglib")
  674. (synopsis
  675. "Python bindings for taglib")
  676. (description
  677. "This package is a Python audio tagging library. It is
  678. cross-platform, works with all Python versions, and is very
  679. simple to use yet fully featured.")
  680. (license license:gpl3)))