GNU bug report logs - #56882
[PATCH 0/4] build-system/perl: Support some cross-compilation, and test with xdg-utils

Previous Next

Package: guix-patches;

Reported by: Maxime Devos <maximedevos <at> telenet.be>

Date: Tue, 2 Aug 2022 11:55:02 UTC

Severity: normal

Tags: patch

Done: Mathieu Othacehe <othacehe <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 56882 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: 56882 <at> debbugs.gnu.org
Cc: Maxime Devos <maximedevos <at> telenet.be>
Subject: [PATCH 3/4] perl-file-mimeinfo: Fix cross-compilation.
Date: Tue,  2 Aug 2022 14:13:28 +0200
The result of "guix style" was ignored, as it put #~(modify-phases ...) on the
same line as #:phases, causing it to go beyond to 80 columns limit.

* 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'.
---
 gnu/packages/freedesktop.scm | 37 +++++++++++++++++++++++-------------
 1 file changed, 24 insertions(+), 13 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index 577b354f66..2d12567a42 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -1946,19 +1946,30 @@ (define-public perl-file-mimeinfo
     (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
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'install 'wrap-programs
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let ((out (assoc-ref outputs "out")))
-               (for-each (lambda (prog)
-                           (wrap-program (string-append out "/bin/" prog)
-                             `("PERL5LIB" ":" prefix
-                               (,(string-append (getenv "PERL5LIB") ":" out
-                                                "/lib/perl5/site_perl")))))
-                         '("mimeopen" "mimetype")))
-             #t)))))
+     (list #:tests? #f
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'install 'wrap-programs
+                 ;; 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)
+                        (wrap-program (string-append out "/bin/" prog)
+                          `("PERL5LIB" ":" prefix
+                            ;; 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")
     (synopsis "Determine file type from the file name")
     (description
-- 
2.37.0





This bug report was last modified 2 years and 294 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.