[bug#68315,v3,11/47] build-system: cmake: Redefine cmake-build and cmake-cross-build.

Message ID 20250209005219.25070-12-ngraves@ngraves.fr
State New
Headers
Series Extend bag-build to gexp. |

Commit Message

Nicolas Graves Feb. 9, 2025, 12:50 a.m. UTC
  * guix/build-system/cmake.scm
(cmake-build): Monadic procedure returns a gexp instead of a derivation.

Change-Id: I0c3ceb08391a38c52521416093d2c4b2ae869165
---
 guix/build-system/cmake.scm | 27 ++++++---------------------
 1 file changed, 6 insertions(+), 21 deletions(-)
  

Patch

diff --git a/guix/build-system/cmake.scm b/guix/build-system/cmake.scm
index 9d757c0d06..2051f71f88 100644
--- a/guix/build-system/cmake.scm
+++ b/guix/build-system/cmake.scm
@@ -3,6 +3,7 @@ 
 ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2024 Nicolas Graves <ngraves@ngraves.fr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -129,7 +130,7 @@  (define* (cmake-build name inputs
                       disallowed-references)
   "Build SOURCE using CMAKE, and with INPUTS. This assumes that SOURCE
 provides a 'CMakeLists.txt' file as its build system."
-  (define build
+  (define builder
     (with-imported-modules imported-modules
       #~(begin
           (use-modules #$@(sexp->gexp modules))
@@ -161,16 +162,8 @@  (define build
                              #:strip-flags #$strip-flags
                              #:strip-directories #$strip-directories)))))
 
-  (mlet %store-monad ((guile (package->derivation (or guile (default-guile))
-                                                  system #:graft? #f)))
-    (gexp->derivation name build
-                      #:system system
-                      #:target #f
-                      #:graft? #f
-                      #:substitutable? substitutable?
-                      #:allowed-references allowed-references
-                      #:disallowed-references disallowed-references
-                      #:guile-for-build guile)))
+  (mbegin %store-monad
+    (return builder)))
 
 
 ;;;
@@ -263,16 +256,8 @@  (define %outputs
                        #:strip-flags #$strip-flags
                        #:strip-directories #$strip-directories))))
 
-  (mlet %store-monad ((guile (package->derivation (or guile (default-guile))
-                                                  system #:graft? #f)))
-    (gexp->derivation name builder
-                      #:system system
-                      #:target target
-                      #:graft? #f
-                      #:substitutable? substitutable?
-                      #:allowed-references allowed-references
-                      #:disallowed-references disallowed-references
-                      #:guile-for-build guile)))
+  (mbegin %store-monad
+    (return builder)))
 
 (define cmake-build-system
   (build-system