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