perl-file-mimeinfo: Fix cross-compilation.

* gnu/packages/freedesktop.scm
(perl-file-mimeinfo)[arguments]<#:phases>: Make it a G-exp to avoid messy nested
quasiquotation.
{wrap-programs}: When cross-compiling, don't use the PELRL5LIB environment
variable, instead use 'search-path-as-list'.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
This commit is contained in:
Maxime Devos 2022-08-02 14:13:28 +02:00 committed by Mathieu Othacehe
parent 607f9a9af9
commit b914ccc915
No known key found for this signature in database
GPG Key ID: 8354763531769CA6

View File

@ -1948,17 +1948,29 @@ applications define in those files.")
(arguments
;; Some tests fail due to requiring the mimetype of perl files to be
;; text/plain when they are actually application/x-perl.
`(#:tests? #f
(list #:tests? #f
#:phases
(modify-phases %standard-phases
#~(modify-phases %standard-phases
(add-after 'install 'wrap-programs
(lambda* (#:key outputs #:allow-other-keys)
;; TODO(staging): Make unconditional.
(lambda* (#:key #$@(if (%current-target-system)
#~(inputs)
#~()) outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
(for-each (lambda (prog)
(for-each
(lambda (prog)
(wrap-program (string-append out "/bin/" prog)
`("PERL5LIB" ":" prefix
(,(string-append (getenv "PERL5LIB") ":" out
"/lib/perl5/site_perl")))))
;; PERL5LIB looks in 'native-inputs', not 'inputs',
;; whereas the latter is required for
;; cross-compilation.
#$(if (%current-target-system)
#~,(search-path-as-list
'("lib/perl5/site_perl")
(map cdr (append inputs outputs)))
#~(,(string-append
(getenv "PERL5LIB")
":" out "/lib/perl5/site_perl"))))))
'("mimeopen" "mimetype")))
#t)))))
(home-page "https://metacpan.org/release/File-MimeInfo")