gnu: perl-critic: Make the perlcritic command available.

* gnu/packages/perl.scm (perl-critic)[arguments]<#:phases>: Add phases to wrap
the perlcritic command and test it works.
[inputs]: Add bash-minimal for wrap-program.

Change-Id: I8c506e655fdf2b1c33e850579c6a5adcbbd37192
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
gemmaro 2024-08-31 11:07:55 +09:00 committed by Ludovic Courtès
parent 3daab04414
commit 034eb1b0b6
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -2294,7 +2294,22 @@ (define-public perl-critic
(base32 (base32
"1nzxpn71mrpp85yxrxlraj52q2skvf9ja887ls11d57h6smg1vmz")))) "1nzxpn71mrpp85yxrxlraj52q2skvf9ja887ls11d57h6smg1vmz"))))
(build-system perl-build-system) (build-system perl-build-system)
(arguments
(list
#:phases #~(modify-phases %standard-phases
(add-after 'install 'wrap-perlcritic
(lambda _
(wrap-program (string-append #$output "/bin/perlcritic")
`("PERL5LIB" ":" prefix
(,(getenv "PERL5LIB") ,(string-append #$output
"/lib/perl5/site_perl"))))))
(add-after 'wrap-perlcritic 'check-perlcritic
(lambda* (#:key tests? #:allow-other-keys)
(when tests?
(invoke (string-append #$output "/bin/perlcritic")
"--version")))))))
(native-inputs (list perl-module-build perl-test-deep)) (native-inputs (list perl-module-build perl-test-deep))
(inputs (list bash-minimal))
(propagated-inputs (list perltidy (propagated-inputs (list perltidy
perl-exception-class perl-exception-class
perl-io-string perl-io-string