Subject: [PATCH 10/43] build-system: cmake: Redefine cmake-build and cmake-cross-build.

From: Nicolas Graves <[email-masked]>
Date: Tue, 12 Aug 2025 11:04:18 +0200

* 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(-)

diff --git a/guix/build-system/cmake.scm b/guix/build-system/cmake.scm
index b0587fddf02..ff67e8b6735 100644
--- a/guix/build-system/cmake.scm
+++ b/guix/build-system/cmake.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2017 Ricardo Wurmus <[email-masked]>
 ;;; Copyright © 2020 Efraim Flashner <[email-masked]>
 ;;; Copyright © 2025 Maxim Cournoyer <[email-masked]>
+;;; Copyright © 2024 Nicolas Graves <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -147,7 +148,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))
@@ -182,16 +183,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)))
 
 
 ;;;
@@ -290,16 +283,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
-- 
2.50.1