From patchwork Tue Aug 2 12:13:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: M X-Patchwork-Id: 41094 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4A81227BBEA; Tue, 2 Aug 2022 13:14:31 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id EE60927BBE9 for ; Tue, 2 Aug 2022 13:14:30 +0100 (BST) Received: from localhost ([::1]:50576 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oIqn8-0002QR-56 for patchwork@mira.cbaines.net; Tue, 02 Aug 2022 08:14:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39560) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oIqmh-0001XN-Fz for guix-patches@gnu.org; Tue, 02 Aug 2022 08:14:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53004) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oIqmg-0000A6-6t for guix-patches@gnu.org; Tue, 02 Aug 2022 08:14:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oIqmg-0008J6-27 for guix-patches@gnu.org; Tue, 02 Aug 2022 08:14:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56882] [PATCH 3/4] perl-file-mimeinfo: Fix cross-compilation. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 02 Aug 2022 12:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56882 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 56882@debbugs.gnu.org Cc: Maxime Devos Received: via spool by 56882-submit@debbugs.gnu.org id=B56882.165944241931866 (code B ref 56882); Tue, 02 Aug 2022 12:14:02 +0000 Received: (at 56882) by debbugs.gnu.org; 2 Aug 2022 12:13:39 +0000 Received: from localhost ([127.0.0.1]:42748 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oIqmI-0008Ho-T4 for submit@debbugs.gnu.org; Tue, 02 Aug 2022 08:13:39 -0400 Received: from andre.telenet-ops.be ([195.130.132.53]:54772) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oIqmC-0008HK-Ug for 56882@debbugs.gnu.org; Tue, 02 Aug 2022 08:13:38 -0400 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:5dba:d409:33f7:a16]) by andre.telenet-ops.be with bizsmtp id 2cDX2800520ykKC01cDXHe; Tue, 02 Aug 2022 14:13:31 +0200 From: Maxime Devos Date: Tue, 2 Aug 2022 14:13:28 +0200 Message-Id: <20220802121329.22276-3-maximedevos@telenet.be> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220802121329.22276-1-maximedevos@telenet.be> References: <20220802121329.22276-1-maximedevos@telenet.be> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1659442411; bh=92QJnfqbxMRww2MZ94XAC9Q9D6pk36roTud9rtSamnM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=BiJAxzOzE1LeDdIylEk50jo2ifHv/L1IW7EHjetXbsJd8331xXwEgpyVMOBHc2az6 n5lpCUTUKIQT3IXkVBiqjIpfyC8TvbUzF8WvCBu8nIxozNun8f250w8s6USROZxst2 /voKhwMp9m2+UY1+MMo+ssZT6ICoHqwf0xWcc3p6rBulSrqLpzvBPMUKs8ypQC7oE6 qBNAl/zyB4xWzjjvM0cAdNiPGO9GCp3UdJ2O0O3Wgc3e20xZNjabfzy2Zujb4L+dVP Q1Gtmq8yKeqV0VPSBYNbObdkpua++YVhREpI7V6CkP2zFhuQJcDtg1VeHAeYfsKvTs RPM6NZMuUcbvQ== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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