unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: 56882@debbugs.gnu.org
Cc: Maxime Devos <maximedevos@telenet.be>
Subject: [bug#56882] [PATCH 3/4] perl-file-mimeinfo: Fix cross-compilation.
Date: Tue,  2 Aug 2022 14:13:28 +0200	[thread overview]
Message-ID: <20220802121329.22276-3-maximedevos@telenet.be> (raw)
In-Reply-To: <20220802121329.22276-1-maximedevos@telenet.be>

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





  parent reply	other threads:[~2022-08-02 12:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-02 11:54 [bug#56882] [PATCH 0/4] build-system/perl: Support some cross-compilation, and test with xdg-utils Maxime Devos
2022-08-02 12:13 ` [bug#56882] [PATCH 1/4] build-system/perl: Support cross-compilation of some Perl packages Maxime Devos
2022-08-02 12:13   ` [bug#56882] [PATCH 2/4] gnu: freedesktop: Add 'bash' input for 'wrap-program' Maxime Devos
2022-08-02 12:13   ` Maxime Devos [this message]
2022-08-02 12:13   ` [bug#56882] [PATCH 4/4] xdg-utils: Support cross-compilation Maxime Devos
2022-08-06 16:25 ` bug#56882: [PATCH 0/4] build-system/perl: Support some cross-compilation, and test with xdg-utils Mathieu Othacehe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220802121329.22276-3-maximedevos@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=56882@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).