From patchwork Tue Aug 2 12:13:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: M X-Patchwork-Id: 41091 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 8E03D27BBEA; Tue, 2 Aug 2022 13:14:15 +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 DFA9C27BBE9 for ; Tue, 2 Aug 2022 13:14:14 +0100 (BST) Received: from localhost ([::1]:49292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oIqms-0001Z3-0G for patchwork@mira.cbaines.net; Tue, 02 Aug 2022 08:14:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39556) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oIqmg-0001WF-7C for guix-patches@gnu.org; Tue, 02 Aug 2022 08:14:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53003) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oIqmf-0000A0-Sx for guix-patches@gnu.org; Tue, 02 Aug 2022 08:14:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oIqmf-0008Iy-N6 for guix-patches@gnu.org; Tue, 02 Aug 2022 08:14:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56882] [PATCH 1/4] build-system/perl: Support cross-compilation of some Perl packages. References: <8d9f6385-f835-e082-9b2c-730b311c2eca@telenet.be> In-Reply-To: <8d9f6385-f835-e082-9b2c-730b311c2eca@telenet.be> Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 02 Aug 2022 12:14:01 +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.165944241831859 (code B ref 56882); Tue, 02 Aug 2022 12:14:01 +0000 Received: (at 56882) by debbugs.gnu.org; 2 Aug 2022 12:13:38 +0000 Received: from localhost ([127.0.0.1]:42746 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oIqmI-0008Hl-9D for submit@debbugs.gnu.org; Tue, 02 Aug 2022 08:13:38 -0400 Received: from andre.telenet-ops.be ([195.130.132.53]:54762) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oIqmC-0008HI-Ue for 56882@debbugs.gnu.org; Tue, 02 Aug 2022 08:13:37 -0400 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:5dba:d409:33f7:a16]) by andre.telenet-ops.be with bizsmtp id 2cDX2800520ykKC01cDXHW; Tue, 02 Aug 2022 14:13:31 +0200 From: Maxime Devos Date: Tue, 2 Aug 2022 14:13:26 +0200 Message-Id: <20220802121329.22276-1-maximedevos@telenet.be> X-Mailer: git-send-email 2.37.0 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1659442411; bh=nF70CoepL5e6um9MZwA2FKzXb0HhI+4zbrazmXKJ6u0=; h=From:To:Cc:Subject:Date; b=Mpunwo1p7+fx4gfJJZObefceNcYKSR+OgFQHc984yC06gRtOZKwIVWngrgJcBpvFn M8aDkbEfeeX3CUcBDb1RYUfpsz8NfLKRjL35+blbd1ed+5GO+cjk4Yapv73Vb59xuF cparnSrn7XkwFS81rgPKwRaay6IxEXzku49j9gpFXA3b2ZhFRCuTRhs+/hKEalBmio k/rgDLmy9bbTB7Kvapx9eEMHZzG1IBBclC0yr6L3WTn0Q+LDi0Eo3bWPAQEWfUpDMh sC5pLLaa1I2XtCtbiQMHKTx7fg917g06S/RIwp8kEIr7nh3amF4o2594Q8RhaPqe2M DavcMbeotezsg== 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 * guix/build-system/perl.scm: Add info on cross-compilation. (lower)[private-keywords]: Remove #:target when cross-compiling. (lower)[target]: Set. (host-inputs)[perl]: New entry. (host-inputs)[(standard-packages)]: Move to ... (build-inputs)[(standard-packages)]: ... here when cross-compiling. (build-inputs)[standard-cross-packages]: Add when cross-compiling. (target-inputs): New entry when cross-compiling. (build): Use perl-cross-build when cross-compiling. (perl-cross-build): New procedure. --- guix/build-system/perl.scm | 120 +++++++++++++++++++++++++++++++------ 1 file changed, 103 insertions(+), 17 deletions(-) base-commit: d519305d83d08058e4def2c4d72fe62102d9599d diff --git a/guix/build-system/perl.scm b/guix/build-system/perl.scm index db0a916fb2..3890cd91ea 100644 --- a/guix/build-system/perl.scm +++ b/guix/build-system/perl.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014, 2015, 2021 Ludovic Courtès +;;; Copyright © 2022 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -29,13 +30,17 @@ (define-module (guix build-system perl) #:use-module (ice-9 match) #:export (%perl-build-system-modules perl-build + perl-cross-build perl-build-system)) ;; Commentary: ;; ;; Standard build procedure for Perl packages using the "makefile ;; maker"---i.e., "perl Makefile.PL". This is implemented as an extension of -;; `gnu-build-system'. +;; `gnu-build-system'. Cross-compilation is supported for some simple Perl +;; packages, but not for any Perl packages that do things like XS (Perl's FFI), +;; which makes C-style shared libraries, as it is currently not known how to +;; tell Perl to properly cross-compile. ;; ;; Code: @@ -59,24 +64,43 @@ (define* (lower name #:rest arguments) "Return a bag for NAME." (define private-keywords - '(#:target #:perl #:inputs #:native-inputs)) + `(#:perl #:inputs #:native-inputs + ,@(if target '() '(#:target)))) - (and (not target) ;XXX: no cross-compilation - (bag - (name name) - (system system) - (host-inputs `(,@(if source - `(("source" ,source)) - '()) - ,@inputs + (bag + (name name) + (system system) (target target) + (host-inputs `(,@(if source + `(("source" ,source)) + '()) + ,@inputs + ;; For interpreters in #! (shebang) + ,@(if target + `(("perl" ,perl)) + '()) - ;; Keep the standard inputs of 'gnu-build-system'. - ,@(standard-packages))) - (build-inputs `(("perl" ,perl) - ,@native-inputs)) - (outputs outputs) - (build perl-build) - (arguments (strip-keyword-arguments private-keywords arguments))))) + ;; Keep the standard inputs of 'gnu-build-system'. + ;; TODO: make this unconditional, putting this into 'build-inputs'. + ,@(if target + '() + (standard-packages)))) + (build-inputs `(("perl" ,perl) + ,@native-inputs + ,@(if target + (standard-cross-packages target 'host) + '()) + ,@(if target + (standard-packages) + '()))) + ;; Keep the standard inputs of 'gnu-build-system'. + (target-inputs (if target + (standard-cross-packages target 'target) + '())) + (outputs outputs) + (build (if target + perl-cross-build + perl-build)) + (arguments (strip-keyword-arguments private-keywords arguments)))) (define* (perl-build name inputs #:key source @@ -127,6 +151,68 @@ (define build (gexp->derivation name build #:system system #:target #f + #:graft? #f + #:guile-for-build guile))) + +(define* (perl-cross-build name #:key + source + target + build-inputs host-inputs target-inputs + (search-paths '()) + (native-search-paths '()) + (tests? #f) ; usually not possible when cross-compiling + (parallel-build? #t) + (parallel-tests? #t) + (make-maker? #f) + (make-maker-flags ''()) + (module-build-flags ''()) + (phases '(@ (guix build perl-build-system) + %standard-phases)) + (outputs '("out")) + (system (%current-system)) + (build (nix-system->gnu-triplet system)) + (guile #f) + (imported-modules %perl-build-system-modules) + (modules '((guix build perl-build-system) + (guix build utils)))) + "Cross-build SOURCE to TARGET using PERL, and with INPUTS. This assumes that +SOURCE provides a `Makefile.PL' file as its build system and does not use XS +or similar." + (define inputs + #~(append #$(input-tuples->gexp host-inputs) + #+(input-tuples->gexp target-inputs))) + (define builder + (with-imported-modules imported-modules + #~(begin + (use-modules #$@(sexp->gexp modules)) + (perl-build #:name #$name + #:source #+source + #:search-paths '#$(sexp->gexp + (map search-path-specification->sexp + search-paths)) + #:native-search-paths '#$(sexp->gexp + (map search-path-specification->sexp + native-search-paths)) + #:make-maker? #$make-maker? + #:make-maker-flags #$make-maker-flags + #:module-build-flags #$(sexp->gexp module-build-flags) + #:phases #$phases + #:build #$build + #:system #$system + #:target #$target + #:test-target "test" + #:tests? #$tests? + #:parallel-build? #$parallel-build? + #:parallel-tests? #$parallel-tests? + #:outputs #$(outputs->gexp outputs) + #:inputs #$inputs + #:native-inputs #+(input-tuples->gexp build-inputs))))) + (mlet %store-monad ((guile (package->derivation (or guile (default-guile)) + system #:graft? #f))) + (gexp->derivation name builder + #:system system + #:target target + #:graft? #false #:guile-for-build guile))) (define perl-build-system From patchwork Tue Aug 2 12:13:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: M X-Patchwork-Id: 41092 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 724CA27BBEA; Tue, 2 Aug 2022 13:14:18 +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 2488C27BBE9 for ; Tue, 2 Aug 2022 13:14:18 +0100 (BST) Received: from localhost ([::1]:49436 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oIqmv-0001fR-9y for patchwork@mira.cbaines.net; Tue, 02 Aug 2022 08:14:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39558) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oIqmh-0001XI-7I for guix-patches@gnu.org; Tue, 02 Aug 2022 08:14:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53005) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oIqmg-0000AB-Ue 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-0008JJ-QC for guix-patches@gnu.org; Tue, 02 Aug 2022 08:14:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56882] [PATCH 2/4] gnu: freedesktop: Add 'bash' input for 'wrap-program' 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.165944242531891 (code B ref 56882); Tue, 02 Aug 2022 12:14:02 +0000 Received: (at 56882) by debbugs.gnu.org; 2 Aug 2022 12:13:45 +0000 Received: from localhost ([127.0.0.1]:42752 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oIqmO-0008IH-TY for submit@debbugs.gnu.org; Tue, 02 Aug 2022 08:13:45 -0400 Received: from andre.telenet-ops.be ([195.130.132.53]:54766) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oIqmC-0008HJ-UW for 56882@debbugs.gnu.org; Tue, 02 Aug 2022 08:13:44 -0400 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:5dba:d409:33f7:a16]) by andre.telenet-ops.be with bizsmtp id 2cDX2800520ykKC01cDXHc; Tue, 02 Aug 2022 14:13:31 +0200 From: Maxime Devos Date: Tue, 2 Aug 2022 14:13:27 +0200 Message-Id: <20220802121329.22276-2-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=3iNlO7n2Jmk2lnUdUUMu8vve5ElfmGhWvUBSU+LzUps=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ga9vJSqmY953j1Vm267R/3am/i7sgcb+kfdzMDprsX63qD4J8svxDMMLnpGty7Vtg Tr0kQhysbWZV6zU4Gr0W1GYG3WKktLs++gkLDE0WRJU3XRK1GFYGTst3awB8mlE0jH 8Lmy7nXiXB/mv6XjtMyRT0Q+OGAyw1Mduky15OoVJV/eEZ2+KpmGziH197don0VYlh 3qVxIepVpWaHSHijGzdoK1Mo0vj5kI+ODeiw9h84eeg8Vv2ANbN2fCv5TIDpRmCHJh +Edw8ugcDfBIVmMHSwyp5Z5KChBtmx1c7ttMvIZgRUShD5JVLjGOLvVVu/PDYEEmby o0hI8ajmYV8fA== 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 It is required for cross-compilation. Cherry-picked from . * gnu/packages/freedesktop.scm (udisks)[inputs]: Add 'bash-minimal' when cross-compiling. (perl-file-mimeinfo)[inputs]: Likewise. (udiskie)[inputs]: Likewise. --- gnu/packages/freedesktop.scm | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm index 4d06235771..577b354f66 100644 --- a/gnu/packages/freedesktop.scm +++ b/gnu/packages/freedesktop.scm @@ -1319,13 +1319,17 @@ (define-public udisks (propagated-inputs (list glib)) ; required by udisks2.pc (inputs - (list acl - cryptsetup - libatasmart - libblockdev - libgudev - polkit - util-linux)) + `(,acl + ;; TODO(staging): Make unconditional. + ,@(if (%current-target-system) + (list bash-minimal) ; for wrap-program + '()) + ,cryptsetup + ,libatasmart + ,libblockdev + ,libgudev + ,polkit + ,util-linux)) (outputs '("out" "doc")) ;5 MiB of gtk-doc HTML (arguments @@ -1930,6 +1934,11 @@ (define-public perl-file-mimeinfo (base32 "1sh8r6vczyz08zm8vfsjmkg6a165wch54akjdrd1vbifcmwjg5pi")))) (build-system perl-build-system) + (inputs + ;; TODO(staging): Make unconditional. + (if (%current-target-system) + (list bash-minimal) ; for wrap-program + '())) ;; If the tests are fixed, add perl-test-pod, perl-test-pod-coverage, and ;; perl-test-tiny as native-inputs. (propagated-inputs @@ -2026,7 +2035,15 @@ (define-public udiskie ("gettext" ,gettext-minimal) ("gobject-introspection" ,gobject-introspection))) (inputs - (list gobject-introspection gtk+ libappindicator libnotify udisks)) + ;; TODO(staging): Make unconditional. + `(,@(if (%current-target-system) + (list bash-minimal) + '()) + ,gobject-introspection + ,gtk+ + ,libappindicator + ,libnotify + ,udisks)) (propagated-inputs (list python-docopt python-pygobject python-keyutils python-pyxdg python-pyyaml)) 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 From patchwork Tue Aug 2 12:13:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: M X-Patchwork-Id: 41093 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 736FB27BBEA; Tue, 2 Aug 2022 13:14:25 +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 CE7D627BBE9 for ; Tue, 2 Aug 2022 13:14:24 +0100 (BST) Received: from localhost ([::1]:50012 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oIqn2-00022Z-0J for patchwork@mira.cbaines.net; Tue, 02 Aug 2022 08:14:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39562) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oIqmh-0001YM-TB for guix-patches@gnu.org; Tue, 02 Aug 2022 08:14:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53006) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oIqmh-0000AP-K3 for guix-patches@gnu.org; Tue, 02 Aug 2022 08:14:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oIqmg-0008JD-FS for guix-patches@gnu.org; Tue, 02 Aug 2022 08:14:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56882] [PATCH 4/4] xdg-utils: Support 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.165944241931873 (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]:42750 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oIqmJ-0008Hv-8e for submit@debbugs.gnu.org; Tue, 02 Aug 2022 08:13:39 -0400 Received: from andre.telenet-ops.be ([195.130.132.53]:54778) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oIqmC-0008HL-Ul 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 2cDX2800520ykKC01cDXHh; Tue, 02 Aug 2022 14:13:32 +0200 From: Maxime Devos Date: Tue, 2 Aug 2022 14:13:29 +0200 Message-Id: <20220802121329.22276-4-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=1659442412; bh=uLzfTY26V+BkB6bV1no9PanrbiO3+t8XiKbzq4cSmJs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=AtihJ1pYuQhiANyLK8gylzA4Y6tx0DgEurBFjsDJf5707ciIZHQqo5FCaN7nY662q WFfdKBIi4jdLmkTjhDJ/tLmMkugyM3G4MU6B2hKqPQp0xF7MJbhYS0vP9c4RRI+9/B 1onQnFcBUCuddchLw3T5J4V6GtzLt7s8ozzaOhlEdxsK4roJmDDAX/YfZUZHR02Y0f f/EAR5F0h7JhGrBrKhWFjdhPAzjLSUABV8hJIBV3u4g+H6dsWOFmymgQyhoGBe0Aht V3+AUY/85GxS9NcxyN+5c5FQJ5f7sBpmZ2rLCb594RGog3VdarNiiBW97ukI9dawQB HHuq/6mQlO2QQ== 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 "guix style" does not support with-directory-excursion yet, leading to too much spacing, so I have ignored its results. It has been verified that this does not cause rebuilds when compiling natively. The references graph when cross-compiling has also been verified -- glibc-2.33 and the native bash-static-5.1.8 still remains in the graph, but via the cross-compiled inetutils-2.0, ncurses-6.2.20210619 and via gcc-cross-TARGET-10.3.0-lib, which is not related with Perl cross-compilation. * gnu/packages/freedesktop.scm (xdg-utils)[inputs]{bash-minimal,file}: New inputs when cross-compiling. (xdg-utils)[arguments]<#:phases>{locate-catalog-files}: Add 'native-inputs' argument when cross-compiling. Look for docbook-xml and docbook-xsl in native-inputs when cross-compiling. While we are at it, eliminate input labels with search-input-file. (xdg-utils)[arguments]<#:phases>{patch-hardcoded-patch}: Use search-input-file + inputs instead of 'which' when cross-compiling. --- gnu/packages/freedesktop.scm | 58 ++++++++++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 13 deletions(-) diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm index 2d12567a42..1c984ebca8 100644 --- a/gnu/packages/freedesktop.scm +++ b/gnu/packages/freedesktop.scm @@ -25,7 +25,7 @@ ;;; Copyright © 2021 pineapples ;;; Copyright © 2021 Sarah Morgensen ;;; Copyright © 2021 Robby Zambito -;;; Copyright © 2021 Maxime Devos +;;; Copyright © 2021, 2022 Maxime Devos ;;; Copyright © 2021 John Kehayias ;;; Copyright © 2021, 2021 Maxim Cournoyer ;;; Copyright © 2022 Daniel Meißner @@ -76,6 +76,7 @@ (define-module (gnu packages freedesktop) #:use-module (gnu packages disk) #:use-module (gnu packages docbook) #:use-module (gnu packages documentation) + #:use-module (gnu packages file) #:use-module (gnu packages fontutils) #:use-module (gnu packages gawk) #:use-module (gnu packages gettext) @@ -414,7 +415,15 @@ (define-public xdg-utils (list docbook-xsl docbook-xml-4.1.2 libxslt w3m xmlto)) (inputs `(("awk" ,gawk) + ;; TODO(staging): Make this unconditional, to avoid canonical packages, + ;; see . + ,@(if (%current-target-system) + `(("bash-minimal" ,bash-minimal)) ; for 'wrap-program' + '()) ("coreutils" ,coreutils) + ,@(if (%current-target-system) + `(("file" ,file)) + '()) ("grep" ,grep) ("inetutils" ,inetutils) ; xdg-screensaver uses `hostname' ("perl-file-mimeinfo" ,perl-file-mimeinfo) ; for mimeopen fallback @@ -428,19 +437,41 @@ (define-public xdg-utils #:phases (modify-phases %standard-phases (add-after 'unpack 'patch-hardcoded-paths - (lambda _ - (substitute* "scripts/xdg-mime.in" - (("/usr/bin/file") (which "file"))) - (substitute* "scripts/xdg-open.in" - (("/usr/bin/printf") (which "printf"))) - #t)) + ;; TODO(staging): make unconditional + (,@(if (%current-target-system) + '(lambda* (#:key inputs #:allow-other-keys)) + '(lambda _)) + (substitute* "scripts/xdg-mime.in" + (("/usr/bin/file") + (,@(if (%current-target-system) + '(search-input-file inputs "bin/file") + '(which "file"))))) + (substitute* "scripts/xdg-open.in" + (("/usr/bin/printf") + (,@(if (%current-target-system) + '(search-input-file inputs "bin/printf") + '(which "printf"))))) + #t)) (add-before 'build 'locate-catalog-files - (lambda* (#:key inputs #:allow-other-keys) - (let ((xmldoc (string-append (assoc-ref inputs "docbook-xml") - "/xml/dtd/docbook")) - (xsldoc (string-append (assoc-ref inputs "docbook-xsl") - "/xml/xsl/docbook-xsl-" - ,(package-version docbook-xsl)))) + ;; TODO(staging): Make unconditional for simplicity. + (lambda* (#:key inputs ,@(if (%current-target-system) + '(native-inputs) + '()) #:allow-other-keys) + ;; TODO(staging): Make unconditional for simplicity and + ;; to avoid dependning on input labels. + (let ,(if (%current-target-system) + `((native-inputs (or native-inputs inputs)) + (xmldoc (search-input-directory native-inputs + "xml/dtd/docbook")) + (xsldoc (search-input-directory + native-inputs + (string-append "xml/xsl/docbook-xsl-" + ,(package-version docbook-xsl))))) + `((xmldoc (string-append (assoc-ref inputs "docbook-xml") + "/xml/dtd/docbook")) + (xsldoc (string-append (assoc-ref inputs "docbook-xsl") + "/xml/xsl/docbook-xsl-" + ,(package-version docbook-xsl))))) (for-each (lambda (file) (substitute* file (("http://.*/docbookx\\.dtd") @@ -456,6 +487,7 @@ (define-public xdg-utils "/manpages/docbook.xsl man"))) (setenv "STYLESHEET" (string-append xsldoc "/html/docbook.xsl")) + ;; TODO(staging): Might as well remove the #t while we are at it. #t))) (add-after 'install 'wrap-executables (lambda* (#:key inputs outputs #:allow-other-keys)