summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-11-25 18:01:38 +0100
committerLudovic Courtès <ludo@gnu.org>2014-11-25 18:01:59 +0100
commit77c9286d4afcad942c01dbfc243b010fc52124eb (patch)
tree78f4d6a4f4ea2b84431ee805548521d5015190f2 /gnu
parent4d6b879cb5313c30910330763dca1f1642623c4d (diff)
gnu: Add EMMS.
* gnu/packages/emacs.scm (emms): New variable.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/emacs.scm123
1 files changed, 123 insertions, 0 deletions
diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 119c613128b..8092d8bcfce 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -44,6 +44,10 @@
44 #:use-module (gnu packages xml) 44 #:use-module (gnu packages xml)
45 #:use-module (gnu packages glib) 45 #:use-module (gnu packages glib)
46 #:use-module (gnu packages acl) 46 #:use-module (gnu packages acl)
47 #:use-module (gnu packages perl)
48 #:use-module (gnu packages linux) ;alsa
49 #:use-module (gnu packages xiph)
50 #:use-module (gnu packages mp3)
47 #:use-module (guix utils) 51 #:use-module (guix utils)
48 #:use-module (srfi srfi-1)) 52 #:use-module (srfi srfi-1))
49 53
@@ -365,3 +369,122 @@ operations.")
365 (description 369 (description
366 "Emacs-wget is an emacs interface for the wget file downloader.") 370 "Emacs-wget is an emacs interface for the wget file downloader.")
367 (license gpl2+))) 371 (license gpl2+)))
372
373
374;;;
375;;; Multimedia.
376;;;
377
378(define-public emms
379 (package
380 (name "emms")
381 (version "4.0")
382 (source (origin
383 (method url-fetch)
384 (uri (string-append "mirror://gnu/emms/emms-"
385 version ".tar.gz"))
386 (sha256
387 (base32
388 "1q0n3iwva8bvai2rl9sm49sdjmk0wi7vajz4knz01l7g67nrp87l"))
389 (modules '((guix build utils)))
390 (snippet
391 '(substitute* "Makefile"
392 (("/usr/bin/install-info")
393 ;; No need to use 'install-info' since it would create a
394 ;; useless 'dir' file.
395 "true")
396 (("^INFODIR=.*")
397 ;; Install Info files to $out/share/info, not $out/info.
398 "INFODIR := $(PREFIX)/share/info\n")
399 (("/site-lisp/emms")
400 ;; Install directly in share/emacs/site-lisp, not in a
401 ;; sub-directory.
402 "/site-lisp")
403 (("^all: (.*)\n" _ rest)
404 ;; Build 'emms-print-metadata'.
405 (string-append "all: " rest " emms-print-metadata\n"))))))
406 (build-system gnu-build-system)
407 (arguments
408 '(#:modules ((guix build gnu-build-system)
409 (guix build utils)
410 (guix build emacs-utils))
411 #:imported-modules ((guix build gnu-build-system)
412 (guix build utils)
413 (guix build emacs-utils))
414
415 #:phases (alist-replace
416 'configure
417 (lambda* (#:key inputs outputs #:allow-other-keys)
418 (let ((out (assoc-ref outputs "out"))
419 (vorbis (assoc-ref inputs "vorbis-tools"))
420 (alsa (assoc-ref inputs "alsa-utils"))
421 (mpg321 (assoc-ref inputs "mpg321"))
422 (mp3info (assoc-ref inputs "mp3info")))
423 ;; Specify the installation directory.
424 (substitute* "Makefile"
425 (("PREFIX=.*$")
426 (string-append "PREFIX := " out "\n")))
427
428 (setenv "SHELL" (which "sh"))
429 (setenv "CC" "gcc")
430
431 ;; Specify the absolute file names of the various
432 ;; programs so that everything works out-of-the-box.
433 (with-directory-excursion "lisp"
434 (emacs-substitute-variables
435 "emms-player-mpg321-remote.el"
436 ("emms-player-mpg321-remote-command"
437 (string-append mpg321 "/bin/mpg321")))
438 (substitute* "emms-player-simple.el"
439 (("\"ogg123\"")
440 (string-append "\"" vorbis "/bin/ogg123\"")))
441 (emacs-substitute-variables "emms-info-ogginfo.el"
442 ("emms-info-ogginfo-program-name"
443 (string-append vorbis "/bin/ogginfo")))
444 (emacs-substitute-variables "emms-info-libtag.el"
445 ("emms-info-libtag-program-name"
446 (string-append out "/bin/emms-print-metadata")))
447 (substitute* "emms-volume-amixer.el"
448 (("\"amixer\"")
449 (string-append "\"" alsa "/bin/amixer\"")))
450 (substitute* "emms-tag-editor.el"
451 (("\"mp3info\"")
452 (string-append mp3info "/bin/mp3info"))))))
453 (alist-cons-before
454 'install 'pre-install
455 (lambda* (#:key outputs #:allow-other-keys)
456 ;; The 'install' rule expects 'emms-print-metadata.1' to
457 ;; be already installed.
458 (let* ((out (assoc-ref outputs "out"))
459 (man1 (string-append out "/share/man/man1")))
460 (mkdir-p man1)
461 (copy-file "emms-print-metadata.1"
462 (string-append man1 "/emms-print-metadata.1"))))
463 (alist-cons-after
464 'install 'post-install
465 (lambda* (#:key outputs #:allow-other-keys)
466 (let* ((out (assoc-ref outputs "out"))
467 (target (string-append
468 out "/bin/emms-print-metadata")))
469 (mkdir-p (dirname target))
470 (copy-file "src/emms-print-metadata" target)
471 (chmod target #o555)))
472 %standard-phases)))
473 #:tests? #f))
474 (native-inputs `(("emacs" ,emacs) ;for (guix build emacs-utils)
475 ("texinfo" ,texinfo)))
476 (inputs `(;("perl" ,perl) ;for 'emms-print-metadata.pl'
477 ("alsa-utils" ,alsa-utils)
478 ("vorbis-tools" ,vorbis-tools)
479 ("mpg321" ,mpg321)
480 ("taglib" ,taglib)
481 ("mp3info" ,mp3info)))
482 (synopsis "Emacs Multimedia System")
483 (description
484 "EMMS is the Emacs Multimedia System. It is a small front-end which
485can control one of the supported external players. Thus, it supports
486whatever formats are supported by your music player. It also
487supports tagging and playlist management, all behind a clean and
488light user interface.")
489 (home-page "http://www.gnu.org/software/emms/")
490 (license gpl3+)))