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