diff mbox series

[bug#68315,46/48] build-system: waf: Improve waf-build style.

Message ID 20240108080350.1665-46-ngraves@ngraves.fr
State New
Headers show
Series Extend bag-build to gexps. | expand

Commit Message

Nicolas Graves Jan. 8, 2024, 8:03 a.m. UTC
* guix/build-system/waf.scm
(waf-build): Use with-imported-modules around the waf-build builder gexp.

Change-Id: Id242046eb4bfef90dba60d7c3b1b68597ddf502e
---
 guix/build-system/waf.scm | 32 +++++++++++++++++---------------
 1 file changed, 17 insertions(+), 15 deletions(-)
diff mbox series

Patch

diff --git a/guix/build-system/waf.scm b/guix/build-system/waf.scm
index 91b3d0d100..696b6de39d 100644
--- a/guix/build-system/waf.scm
+++ b/guix/build-system/waf.scm
@@ -1,5 +1,6 @@ 
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2024 Nicolas Graves <ngraves@ngraves.fr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -86,22 +87,23 @@  (define* (waf-build name inputs
   "Build SOURCE with INPUTS.  This assumes that SOURCE provides a 'waf' file
 as its build system."
   (define build
-    #~(begin
-        (use-modules #$@(sexp->gexp modules))
+    (with-imported-modules imported-modules
+      #~(begin
+          (use-modules #$@(sexp->gexp modules))
 
-        #$(with-build-variables inputs outputs
-            #~(waf-build #:name #$name
-                         #:source #+source
-                         #:configure-flags #$configure-flags
-                         #:system #$system
-                         #:test-target #$test-target
-                         #:tests? #$tests?
-                         #:phases #$phases
-                         #:outputs %outputs
-                         #:search-paths '#$(sexp->gexp
-                                            (map search-path-specification->sexp
-                                                 search-paths))
-                         #:inputs %build-inputs))))
+          #$(with-build-variables inputs outputs
+              #~(waf-build #:name #$name
+                           #:source #+source
+                           #:configure-flags #$configure-flags
+                           #:system #$system
+                           #:test-target #$test-target
+                           #:tests? #$tests?
+                           #:phases #$phases
+                           #:outputs %outputs
+                           #:search-paths '#$(sexp->gexp
+                                              (map search-path-specification->sexp
+                                                   search-paths))
+                           #:inputs %build-inputs)))))
 
   (mlet %store-monad ((guile (package->derivation (or guile (default-guile))
                                                   system #:graft? #f)))