GNU bug report logs - #54239
[PATCH] gnu: Add cross-clang.

Previous Next

Package: guix-patches;

Reported by: Julien Lepiller <julien <at> lepiller.eu>

Date: Thu, 3 Mar 2022 16:04:02 UTC

Severity: normal

Tags: patch

Full log


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

From: Julien Lepiller <julien <at> lepiller.eu>
To: 54239 <at> debbugs.gnu.org
Subject: [PATCH v3 01/10] guix: Add build-system transformation for target.
Date: Sat, 16 Jul 2022 21:47:58 +0200
* guix/build-system.scm (build-system-with-target): New procedure.
---
 guix/build-system.scm | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/guix/build-system.scm b/guix/build-system.scm
index 76d670995c..7d864423e3 100644
--- a/guix/build-system.scm
+++ b/guix/build-system.scm
@@ -18,6 +18,7 @@
 
 (define-module (guix build-system)
   #:use-module (guix records)
+  #:use-module (guix utils)
   #:use-module (srfi srfi-1)
   #:use-module (ice-9 match)
   #:export (build-system
@@ -40,7 +41,8 @@ (define-module (guix build-system)
 
             make-bag
 
-            build-system-with-c-toolchain))
+            build-system-with-c-toolchain
+            build-system-with-target))
 
 (define-record-type* <build-system> build-system make-build-system
   build-system?
@@ -129,3 +131,20 @@ (define (lower* . args)
   (build-system
     (inherit bs)
     (lower lower*)))
+
+(define (build-system-with-target bs target)
+  "Return a variant of @var{bs}, a build system, that user @var{target} instead
+of the default target."
+  (define lower
+    (build-system-lower bs))
+
+  (define (lower* . args)
+    (parameterize ((%current-target-system target))
+      (apply lower
+             (append
+               (strip-keyword-arguments (list #:target) args)
+               (list #:target target)))))
+
+  (build-system
+    (inherit bs)
+    (lower lower*)))
-- 
2.37.0





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

Previous Next


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