me
/
guix
Archived
1
0
Fork 0

gnu: emms: Use 'modify-phases'.

* gnu/packages/emacs.scm (emms)[arguments]: Use 'modify-phases'.
master
Efraim Flashner 2016-05-31 22:05:26 +03:00
parent 0985f5269c
commit 2fe176be0f
No known key found for this signature in database
GPG Key ID: F4C1D3917EACEE93
1 changed files with 58 additions and 61 deletions

View File

@ -859,69 +859,66 @@ provides an optional IDE-like error list.")
#:imported-modules (,@%gnu-build-system-modules
(guix build emacs-utils))
#:phases (alist-replace
'configure
(lambda* (#:key inputs outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))
(vorbis (assoc-ref inputs "vorbis-tools"))
(alsa (assoc-ref inputs "alsa-utils"))
(mpg321 (assoc-ref inputs "mpg321"))
(mp3info (assoc-ref inputs "mp3info")))
;; Specify the installation directory.
(substitute* "Makefile"
(("PREFIX=.*$")
(string-append "PREFIX := " out "\n")))
#:phases
(modify-phases %standard-phases
(replace 'configure
(lambda* (#:key inputs outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))
(vorbis (assoc-ref inputs "vorbis-tools"))
(alsa (assoc-ref inputs "alsa-utils"))
(mpg321 (assoc-ref inputs "mpg321"))
(mp3info (assoc-ref inputs "mp3info")))
;; Specify the installation directory.
(substitute* "Makefile"
(("PREFIX=.*$")
(string-append "PREFIX := " out "\n")))
(setenv "SHELL" (which "sh"))
(setenv "CC" "gcc")
(setenv "SHELL" (which "sh"))
(setenv "CC" "gcc")
;; Specify the absolute file names of the various
;; programs so that everything works out-of-the-box.
(with-directory-excursion "lisp"
(emacs-substitute-variables
"emms-player-mpg321-remote.el"
("emms-player-mpg321-remote-command"
(string-append mpg321 "/bin/mpg321")))
(substitute* "emms-player-simple.el"
(("\"ogg123\"")
(string-append "\"" vorbis "/bin/ogg123\"")))
(emacs-substitute-variables "emms-info-ogginfo.el"
("emms-info-ogginfo-program-name"
(string-append vorbis "/bin/ogginfo")))
(emacs-substitute-variables "emms-info-libtag.el"
("emms-info-libtag-program-name"
(string-append out "/bin/emms-print-metadata")))
(emacs-substitute-variables "emms-info-mp3info.el"
("emms-info-mp3info-program-name"
(string-append mp3info "/bin/mp3info")))
(substitute* "emms-volume-amixer.el"
(("\"amixer\"")
(string-append "\"" alsa "/bin/amixer\"")))
(substitute* "emms-tag-editor.el"
(("\"mp3info\"")
(string-append "\"" mp3info "/bin/mp3info\""))))))
(alist-cons-before
'install 'pre-install
(lambda* (#:key outputs #:allow-other-keys)
;; The 'install' rule expects the target directory to
;; exist.
(let* ((out (assoc-ref outputs "out"))
(man1 (string-append out "/share/man/man1")))
(mkdir-p man1)
#t))
(alist-cons-after
'install 'post-install
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(target (string-append
out "/bin/emms-print-metadata")))
(symlink "emms-auto.el"
(string-append out "/share/emacs/site-lisp/"
"emms-autoloads.el"))
(mkdir-p (dirname target))
(copy-file "src/emms-print-metadata" target)
(chmod target #o555)))
%standard-phases)))
;; Specify the absolute file names of the various
;; programs so that everything works out-of-the-box.
(with-directory-excursion "lisp"
(emacs-substitute-variables
"emms-player-mpg321-remote.el"
("emms-player-mpg321-remote-command"
(string-append mpg321 "/bin/mpg321")))
(substitute* "emms-player-simple.el"
(("\"ogg123\"")
(string-append "\"" vorbis "/bin/ogg123\"")))
(emacs-substitute-variables "emms-info-ogginfo.el"
("emms-info-ogginfo-program-name"
(string-append vorbis "/bin/ogginfo")))
(emacs-substitute-variables "emms-info-libtag.el"
("emms-info-libtag-program-name"
(string-append out "/bin/emms-print-metadata")))
(emacs-substitute-variables "emms-info-mp3info.el"
("emms-info-mp3info-program-name"
(string-append mp3info "/bin/mp3info")))
(substitute* "emms-volume-amixer.el"
(("\"amixer\"")
(string-append "\"" alsa "/bin/amixer\"")))
(substitute* "emms-tag-editor.el"
(("\"mp3info\"")
(string-append "\"" mp3info "/bin/mp3info\"")))))))
(add-before 'install 'pre-install
(lambda* (#:key outputs #:allow-other-keys)
;; The 'install' rule expects the target directory to exist.
(let* ((out (assoc-ref outputs "out"))
(man1 (string-append out "/share/man/man1")))
(mkdir-p man1)
#t)))
(add-after 'install 'post-install
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(target (string-append
out "/bin/emms-print-metadata")))
(symlink "emms-auto.el"
(string-append out "/share/emacs/site-lisp/"
"emms-autoloads.el"))
(mkdir-p (dirname target))
(copy-file "src/emms-print-metadata" target)
(chmod target #o555)))))
#:tests? #f))
(native-inputs `(("emacs" ,emacs-minimal) ;for (guix build emacs-utils)
("texinfo" ,texinfo)))