gnu: abcde: Improve style.

* gnu/packages/cdrom.scm (abcde):
[source]: Run guix style, remove snippet.
[arguments]<#:modules>: Add srfi-26.
<#:phases>: Remove 'configure, migrate it and the snippet to
<#:make-flags>. Rewrite the 'wrap phase.
[native-inputs]: Add coreutils-minimal.

Signed-off-by: jgart <jgart@dismail.de>
This commit is contained in:
Nicolas Graves 2025-08-14 13:27:27 +02:00 committed by jgart
parent 5940faa8d1
commit dd63521f33
No known key found for this signature in database
GPG key ID: A52AA2B477B6DD35

View file

@ -717,69 +717,44 @@ from an audio CD.")
(name "abcde") (name "abcde")
(version "2.9.3") (version "2.9.3")
(home-page "https://abcde.einval.com/") (home-page "https://abcde.einval.com/")
(source (origin (source
(origin
(method url-fetch) (method url-fetch)
(uri (string-append home-page "/download/abcde-" (uri (string-append home-page "/download/abcde-" version ".tar.gz"))
version ".tar.gz"))
(sha256 (sha256
(base32 (base32 "091ip2iwb6b67bhjsj05l0sxyq2whqjycbzqpkfbpm4dlyxx0v04"))))
"091ip2iwb6b67bhjsj05l0sxyq2whqjycbzqpkfbpm4dlyxx0v04"))
(modules '((guix build utils)))
(snippet
'(begin
(substitute* "Makefile"
(("/usr/bin/install")
"install"))))))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
'(#:phases (list
(modify-phases %standard-phases #:tests? #f ; No test target.
(replace 'configure #:modules `((guix build gnu-build-system)
(lambda* (#:key outputs inputs #:allow-other-keys) (guix build utils)
(substitute* "Makefile" (srfi srfi-26))
(("^prefix = .*$") #:make-flags
(string-append "prefix = " #~(list (string-append "INSTALL="
(assoc-ref outputs "out") #$(this-package-native-input "coreutils-minimal")
"\n")) "/bin/install -c")
(("^sysconfdir = .*$") (string-append "prefix = " #$output)
(string-append "sysconfdir = " (string-append "sysconfdir = " #$output "/etc/"))
(assoc-ref outputs "out") #:phases
"/etc/\n"))))) #~(modify-phases %standard-phases
(delete 'configure)
(add-after 'install 'wrap (add-after 'install 'wrap
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(let ((wget (assoc-ref inputs "wget")) (for-each
(vorbis (assoc-ref inputs "vorbis-tools")) (cut wrap-program <>
(parano (assoc-ref inputs "cdparanoia"))
(which (assoc-ref inputs "which"))
(discid (assoc-ref inputs "cd-discid"))
(perl-discid (assoc-ref inputs "perl-musicbrainz-discid"))
(perl-ws (assoc-ref inputs "perl-webservice-musicbrainz"))
(perl-mojo (assoc-ref inputs "perl-mojolicious"))
(flac (assoc-ref inputs "flac"))
(out (assoc-ref outputs "out")))
(define (wrap file)
(wrap-program file
`("PATH" ":" prefix `("PATH" ":" prefix
(,(string-append out "/bin:" ,(map (compose dirname (cut search-input-file inputs <>))
wget "/bin:" (list "/bin/wget"
flac "/bin:" "/bin/flac"
which "/bin:" "/bin/which"
vorbis "/bin:" "/bin/ogginfo"
discid "/bin:" "/bin/cd-discid"
parano "/bin"))) "/bin/cdparanoia")))
`("PERL5LIB" ":" prefix `("PERL5LIB" ":" prefix
(,(string-append perl-discid (,(getenv "PERL5LIB"))))
"/lib/perl5/site_perl:" (find-files (string-append #$output "/bin"))))))))
perl-ws (native-inputs (list coreutils-minimal))
"/lib/perl5/site_perl:"
perl-mojo
"/lib/perl5/site_perl")))))
(for-each wrap
(find-files (string-append out "/bin")
".*"))))))
#:tests? #f)) ; no test target
(inputs (list bash-minimal (inputs (list bash-minimal
wget wget
which which
@ -793,7 +768,6 @@ from an audio CD.")
;; A couple of Python and Perl scripts are included. ;; A couple of Python and Perl scripts are included.
python python
perl)) perl))
(synopsis "Command-line audio CD ripper") (synopsis "Command-line audio CD ripper")
(description (description
"abcde is a front-end command-line utility (actually, a shell script) "abcde is a front-end command-line utility (actually, a shell script)