gnu: packages: Use 'search-patches' everywhere.
[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 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
5 ;;;
6 ;;; This file is part of GNU Guix.
7 ;;;
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
12 ;;;
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
17 ;;;
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21 (define-module (gnu packages mp3)
22 #:use-module ((guix licenses) #:prefix license:)
23 #:use-module (gnu packages)
24 #:use-module (gnu packages autotools)
25 #:use-module (gnu packages base)
26 #:use-module (gnu packages gcc)
27 #:use-module (gnu packages cdrom)
28 #:use-module (gnu packages compression)
29 #:use-module (gnu packages gettext)
30 #:use-module (gnu packages ghostscript)
31 #:use-module (gnu packages ncurses)
32 #:use-module (gnu packages glib)
33 #:use-module (gnu packages gtk)
34 #:use-module (gnu packages pcre)
35 #:use-module (gnu packages pkg-config)
36 #:use-module (gnu packages python)
37 #:use-module (gnu packages xiph)
38 #:use-module (gnu packages pulseaudio)
39 #:use-module (gnu packages linux) ;alsa-lib
40 #:use-module (guix packages)
41 #:use-module (guix download)
42 #:use-module (guix build-system gnu)
43 #:use-module (guix build-system python)
44 #:use-module (guix build-system cmake))
45
46 (define-public libmad
47 (package
48 (name "libmad")
49 (version "0.15.1b")
50 (source (origin
51 (method url-fetch)
52 (uri (string-append "mirror://sourceforge/mad/libmad/"
53 version "/libmad-"
54 version ".tar.gz"))
55 (sha256
56 (base32
57 "14460zhacxhswnzb36qfpd1f2wbk10qvksvm6wyq5hpvdgnw7ymv"))
58 (patches (search-patches "libmad-armv7-thumb-pt1.patch"
59 "libmad-armv7-thumb-pt2.patch"
60 "libmad-frame-length.patch"
61 "libmad-mips-newgcc.patch"))))
62 (build-system gnu-build-system)
63 (arguments
64 `(#:phases
65 (alist-cons-before
66 'configure 'remove-unsupported-gcc-flags
67 (lambda _
68 ;; remove option that is not supported by gcc any more
69 (substitute* "configure" ((" -fforce-mem") "")))
70 %standard-phases)))
71 (synopsis "MPEG audio decoder")
72 (description
73 "MAD (MPEG Audio Decoder) supports MPEG-1 and the MPEG-2 extension to
74 lower sampling frequencies, as well as the de facto MPEG 2.5 format.
75 All three audio layers — Layer I, Layer II, and Layer III (i.e. MP3) — are
76 fully implemented.
77
78 This package contains the library.")
79 (license license:gpl2+)
80 (home-page "http://www.underbit.com/products/mad/")))
81
82 (define-public libid3tag
83 (package
84 (name "libid3tag")
85 (version "0.15.1b")
86 (source (origin
87 (method url-fetch)
88 (uri (string-append "mirror://sourceforge/mad/libid3tag/"
89 version "/libid3tag-"
90 version ".tar.gz"))
91 (sha256
92 (base32
93 "0lb1w883dc46dajbdvnia5870brl5lvnlk7g7y58y9wpg5p4znk3"))))
94 (build-system gnu-build-system)
95 (inputs `(("zlib" ,zlib)))
96 (synopsis "Library for reading ID3 tags")
97 (description
98 "Libid3tag is a library for reading ID3 tags, both ID3v1 and the various
99 versions of ID3v2.")
100 (license license:gpl2+)
101 (home-page "http://www.underbit.com/products/mad/")))
102
103 (define-public id3lib
104 (package
105 (name "id3lib")
106 (version "3.8.3")
107 (source (origin
108 (method url-fetch)
109 (uri (string-append "mirror://sourceforge/id3lib/id3lib/"
110 version "/id3lib-"
111 version ".tar.gz"))
112 (sha256
113 (base32
114 "0yfhqwk0w8q2hyv1jib1008jvzmwlpsxvc8qjllhna6p1hycqj97"))))
115 (build-system gnu-build-system)
116 (arguments
117 `(#:phases
118 (alist-cons-before
119 'configure 'apply-patches
120 ;; TODO: create a patch for origin instead?
121 (lambda _
122 (substitute* "configure"
123 (("iomanip.h") "")) ; drop check for unused header
124 ;; see http://www.linuxfromscratch.org/patches/downloads/id3lib/
125 (substitute* "include/id3/id3lib_strings.h"
126 (("include <string>") "include <cstring>\n#include <string>"))
127 (substitute* "include/id3/writers.h"
128 (("//\\#include <string.h>") "#include <cstring>"))
129 (substitute* "examples/test_io.cpp"
130 (("dami;") "dami;\nusing namespace std;")))
131 %standard-phases)))
132 (synopsis "Library for reading, writing, and manipulating ID3v1 and ID3v2 tags")
133 (description
134 "Id3lib is a cross-platform software development library for reading,
135 writing, and manipulating ID3v1 and ID3v2 tags. It is an on-going project
136 whose primary goals are full compliance with the ID3v2 standard, portability
137 across several platforms, and providing a powerful and feature-rich API with
138 a highly stable and efficient implementation.")
139 (license license:lgpl2.0+)
140 (home-page "http://id3lib.sourceforge.net/")))
141
142 (define-public taglib
143 (package
144 (name "taglib")
145 (version "1.9.1")
146 (source (origin
147 (method url-fetch)
148 (uri (string-append "http://taglib.github.io/releases/taglib-"
149 version ".tar.gz"))
150 (sha256
151 (base32
152 "06n7gnbcqa3r6c9gv00y0y1r48dyyazm6yj403i7ma0r2k6p3lvj"))))
153 (build-system cmake-build-system)
154 (arguments '(#:tests? #f)) ;no 'test' target
155 (inputs `(("zlib" ,zlib)))
156 (home-page "http://developer.kde.org/~wheeler/taglib.html")
157 (synopsis "Library to access audio file meta-data")
158 (description
159 "TagLib is a C++ library for reading and editing the meta-data of several
160 popular audio formats. Currently it supports both ID3v1 and ID3v2 for MP3
161 files, Ogg Vorbis comments and ID3 tags and Vorbis comments in FLAC, MPC,
162 Speex, WavPack TrueAudio, WAV, AIFF, MP4 and ASF files.")
163
164 ;; Dual-licensed: user may choose between LGPLv2.1 or MPLv1.1.
165 (license (list license:lgpl2.1 license:mpl1.1))))
166
167 (define-public mp3info
168 (package
169 (name "mp3info")
170 (version "0.8.5a")
171 (source (origin
172 (method url-fetch)
173 (uri (string-append
174 "http://ibiblio.org"
175 "/pub/linux/apps/sound/mp3-utils/mp3info/mp3info-"
176 version ".tgz"))
177 (sha256
178 (base32
179 "042f1czcs9n2sbqvg4rsvfwlqib2gk976mfa2kxlfjghx5laqf04"))
180 (modules '((guix build utils)))
181 (snippet
182 '(substitute* "Makefile"
183 (("/bin/rm") "rm")
184 (("/usr/bin/install") "install")
185 (("man/man1") "share/man/man1")))))
186 (build-system gnu-build-system)
187 (outputs '("out" "gui")) ;GTK+ interface in "gui"
188 (arguments
189 '(#:phases (alist-replace
190 'configure
191 (lambda* (#:key outputs #:allow-other-keys)
192 (let ((out (assoc-ref outputs "out")))
193 (substitute* "Makefile"
194 (("prefix=.*")
195 (string-append "prefix := " out "\n")))))
196 (alist-cons-before
197 'install 'pre-install
198 (lambda* (#:key outputs #:allow-other-keys)
199 (let ((out (assoc-ref outputs "out")))
200 (mkdir-p (string-append out "/bin"))
201 (mkdir-p (string-append out "/share/man/man1"))))
202 (alist-cons-after
203 'install 'post-install
204 (lambda* (#:key outputs #:allow-other-keys)
205 ;; Move the GTK+ interface to "gui".
206 (let ((out (assoc-ref outputs "out"))
207 (gui (assoc-ref outputs "gui")))
208 (mkdir-p (string-append gui "/bin"))
209 (rename-file (string-append out "/bin/gmp3info")
210 (string-append gui "/bin/gmp3info"))))
211 %standard-phases)))
212 #:tests? #f))
213 (native-inputs
214 `(("pkg-config" ,pkg-config)))
215 (inputs
216 `(("gtk+" ,gtk+-2)
217 ("ncurses" ,ncurses)))
218 (home-page "http://www.ibiblio.org/mp3info/")
219 (synopsis "MP3 technical info viewer and ID3 1.x tag editor")
220 (description
221 "MP3Info is a little utility used to read and modify the ID3 tags of MP3
222 files. MP3Info can also display various technical aspects of an MP3 file
223 including playing time, bit-rate, sampling frequency and other attributes in a
224 pre-defined or user-specifiable output format.")
225 (license license:gpl2+)))
226
227 (define-public libmp3splt
228 (package
229 (name "libmp3splt")
230 (version "0.8.1a")
231 (source (origin
232 (method url-fetch)
233 (uri (string-append "mirror://sourceforge/mp3splt/libmp3splt/"
234 version "/libmp3splt-"
235 version ".tar.gz"))
236 (sha256
237 (base32
238 "0d20r1bd4fgp9kp7w3qixjgll34czck9dgw59mx2kbhb0mhh00d8"))))
239 (build-system gnu-build-system)
240 (inputs `(("libid3tag" ,libid3tag)
241 ("libmad" ,libmad)
242 ("libogg" ,libogg)
243 ("libltdl" ,libltdl)
244 ("libvorbis" ,libvorbis)
245 ("pcre" ,pcre)))
246 (native-inputs
247 `(("pkg-config" ,pkg-config)))
248 (synopsis "Library for splitting mp3 and ogg vorbis files")
249 (description
250 "Mp3splt is a utility to split mp3 and ogg vorbis files selecting a begin
251 and an end time position, without decoding. For splitting an album, one may
252 select split points and file names manually or obtain them automatically from
253 CDDB (internet or a local file) or from .cue files. The tool also supports
254 automatic silence split, that can be used also to adjust cddb/cue splitpoints.
255
256 This package contains the library.")
257 (license license:gpl2+)
258 (home-page "http://mp3splt.sourceforge.net/mp3splt_page/home.php")))
259
260 (define-public mp3splt
261 (package
262 (name "mp3splt")
263 (version "2.5.1")
264 (source (origin
265 (method url-fetch)
266 (uri (string-append "mirror://sourceforge/mp3splt/mp3splt/"
267 version "/mp3splt-"
268 version ".tar.gz"))
269 (sha256
270 (base32
271 "106dnka56prlc9nsfh300f8841am2lmkwlzgl9lkr25mgnc35wwh"))))
272 (build-system gnu-build-system)
273 (inputs `(("libmp3splt" ,libmp3splt)))
274 (synopsis "Utility for splitting mp3 and ogg vorbis files")
275 (description
276 "Mp3splt is a utility to split mp3 and ogg vorbis files selecting a begin
277 and an end time position, without decoding. For splitting an album, one may
278 select split points and file names manually or obtain them automatically from
279 CDDB (internet or a local file) or from .cue files. The tool also supports
280 automatic silence split, that can be used also to adjust cddb/cue splitpoints.
281
282 This package contains the binary.")
283 (license license:gpl2+)
284 (home-page "http://mp3splt.sourceforge.net/mp3splt_page/home.php")))
285
286 (define-public mpg123
287 (package
288 (name "mpg123")
289 (version "1.22.4")
290 (source (origin
291 (method url-fetch)
292 (uri (string-append "mirror://sourceforge/mpg123/mpg123-"
293 version ".tar.bz2"))
294 (sha256
295 (base32
296 "1lj0xv0b6sgqsbhx10dg60cnzgz98i76gxy51kqh11hka0pf0sah"))))
297 (build-system gnu-build-system)
298 (arguments '(#:configure-flags '("--with-default-audio=pulse")))
299 (native-inputs `(("pkg-config" ,pkg-config)))
300 (inputs `(("pulseaudio" ,pulseaudio)
301 ("alsa-lib" ,alsa-lib)))
302 (home-page "http://www.mpg123.org/")
303 (synopsis "Console MP3 player and decoder library")
304 (description
305 "Mpg123 is a real time MPEG 1.0/2.0/2.5 audio player/decoder for layers
306 1,2 and 3 (MPEG 1.0 layer 3 aka MP3 most commonly tested). It comes with a
307 command-line tool as well as a C library, libmpg123.")
308 (license license:lgpl2.1)))
309
310 (define-public mpg321
311 (package
312 (name "mpg321")
313 (version "0.3.1")
314 (source (origin
315 (method url-fetch)
316 (uri (string-append "mirror://sourceforge/mpg321/"
317 version "/mpg321-" version ".tar.gz"))
318 (sha256
319 (base32
320 "0yamsqvj15nsxxnjs9mgyslzx7krgsfk3q1hk3g6l8w9bbbj770b"))))
321 (build-system gnu-build-system)
322 (arguments '(#:configure-flags '("--disable-alsa")))
323 (inputs
324 `(("zlib" ,zlib)
325 ("libmad" ,libmad)
326 ("libid3tag" ,libid3tag)
327 ("libao" ,ao)))
328 (home-page "http://mpg321.sourceforge.net/")
329 (synopsis "Command-line MP3 player")
330 (description "Mpg321 is a command-line mp3 player. mpg321 is used for
331 frontends, as an mp3 player and as an mp3 to wave file decoder (primarily for
332 use with CD-recording software).")
333 (license license:gpl2)))
334
335 (define-public lame
336 (package
337 (name "lame")
338 (version "3.99.5")
339 (source (origin
340 (method url-fetch)
341 (uri (string-append "mirror://sourceforge/lame/lame/3.99/lame-"
342 version ".tar.gz"))
343 (sha256
344 (base32
345 "1zr3kadv35ii6liia0bpfgxpag27xcivp571ybckpbz4b10nnd14"))))
346 (build-system gnu-build-system)
347 ;; XXX FIXME: Use gcc-4.8 on i686 to work around
348 ;; <http://bugs.gnu.org/20856>.
349 (native-inputs (if (and (not (%current-target-system))
350 (string-prefix? "i686-" (%current-system)))
351 `(("gcc" ,(canonical-package gcc-4.8)))
352 '()))
353 (home-page "http://lame.sourceforge.net/")
354 (synopsis "MPEG Audio Layer III (MP3) encoder")
355 (description "LAME is a high quality MPEG Audio Layer III (MP3) encoder.")
356 (license license:lgpl2.0)))
357
358 (define-public ripperx
359 (package
360 (name "ripperx")
361 (version "2.8.0")
362 (source (origin
363 (method url-fetch)
364 (uri (string-append "mirror://sourceforge/ripperx/ripperx/"
365 version "/ripperx-"
366 version ".tar.bz2"))
367 (sha256
368 (base32
369 "1ss3c1a5hx6c99q1cryxg0jhbnbdj6ga9xyz0dzlz9qhzg5qswfs"))
370 (patches (search-patches "ripperx-missing-file.patch"))))
371 (build-system gnu-build-system)
372 (propagated-inputs
373 `(("gs-fonts" ,gs-fonts)
374 ("cdparanoia" ,cdparanoia)
375 ("flac" ,flac)
376 ("lame" ,lame)
377 ("vorbis-tools" ,vorbis-tools)))
378 (inputs
379 `(("glib" ,glib)
380 ("gtk+" ,gtk+-2)
381 ("id3lib" ,id3lib)
382 ("taglib" ,taglib)))
383 (native-inputs
384 `(("pkg-config" ,pkg-config)))
385 (synopsis "GTK program to rip and encode CD audio tracks")
386 (description
387 "RipperX is a GTK program to rip CD audio tracks and encode them to the
388 Ogg, MP3, or FLAC formats. Its goal is to be easy to use, requiring only
389 a few mouse clicks to convert an entire album. It supports CDDB lookups
390 for album and track information.")
391 (license license:gpl2)
392 (home-page "http://sourceforge.net/projects/ripperx/")))
393
394 (define-public libmpcdec
395 (package
396 (name "libmpcdec")
397 (version "1.2.6")
398 (source (origin
399 (method url-fetch)
400 (uri (string-append
401 "http://files.musepack.net/source/libmpcdec-"
402 version ".tar.bz2"))
403 (sha256
404 (base32
405 "1a0jdyga1zfi4wgkg3905y6inghy3s4xfs5m4x7pal08m0llkmab"))))
406 (build-system gnu-build-system)
407 (synopsis "Decoding library for the Musepack audio format")
408 (description
409 "This library supports decoding of the Musepack (MPC) audio compression
410 format.")
411 (license license:bsd-3)
412 (home-page "http://musepack.net")))
413
414 (define-public mpc123
415 (package
416 (name "mpc123")
417 (version "0.2.4")
418 (source (origin
419 (method url-fetch)
420 (uri (string-append "mirror://sourceforge/mpc123/version%20"
421 version "/mpc123-" version ".tar.gz"))
422 (sha256
423 (base32
424 "0sf4pns0245009z6mbxpx7kqy4kwl69bc95wz9v23wgappsvxgy1"))
425 (patches (search-patches "mpc123-initialize-ao.patch"))))
426 (build-system gnu-build-system)
427 (arguments
428 '(#:phases (alist-replace
429 'configure
430 (lambda _
431 (substitute* "Makefile"
432 (("CC[[:blank:]]*:=.*")
433 "CC := gcc\n")))
434 (alist-replace
435 'install
436 (lambda* (#:key outputs #:allow-other-keys)
437 (let* ((out (assoc-ref outputs "out"))
438 (bin (string-append out "/bin")))
439 (mkdir-p bin)
440 (install-file "mpc123" bin)))
441 %standard-phases))
442 #:tests? #f))
443
444 (native-inputs
445 `(("gettext" ,gnu-gettext)))
446 (inputs
447 `(("libao" ,ao)
448 ("libmpcdec" ,libmpcdec)))
449 (home-page "http://mpc123.sourceforge.net/")
450 (synopsis "Audio player for Musepack-formatted files")
451 (description
452 "Mpc123 is a command-line player for files in the Musepack audio
453 compression format (.mpc files).")
454 (license license:gpl2+)))
455
456 (define-public eyed3
457 (package
458 (name "eyed3")
459 (version "0.7.8")
460 (source (origin
461 (method url-fetch)
462 (uri (string-append
463 "http://eyed3.nicfit.net/releases/eyeD3-"
464 version ".tar.gz"))
465 (sha256
466 (base32
467 "1nv7nhfn1d0qm7rgkzksbccgqisng8klf97np0nwaqwd5dbmdf86"))))
468 (build-system python-build-system)
469 (arguments
470 `(#:python ,python-2))
471 (native-inputs
472 `(("python2-setuptools" ,python2-setuptools)
473 ("python2-nose" ,python2-nose)
474 ("python2-sphinx" ,python2-sphinx)
475 ("python2-coverage" ,python2-coverage)))
476 (synopsis "MP3 tag ID3 metadata editor")
477 (description "eyeD3 is a Python tool for working with audio files,
478 specifically mp3 files containing ID3 metadata (i.e. song info). It provides a
479 command-line tool (eyeD3) and a Python library (import eyed3) that can be used
480 to write your own applications or plugins that are callable from the
481 command-line tool.")
482 (home-page "http://eyed3.nicfit.net/")
483 (license license:gpl2+)))