guix_mirror_bot pushed a commit to branch ocaml-team
in repository guix.

commit 7a1275276601ae06fdc339134e6fb0a9ab87b82d
Author: Jason Conroy <[email protected]>
AuthorDate: Sat Nov 29 08:49:29 2025 -0500

    guix: ocaml-build-system: Define `lower` in terms of a higher-order 
function.
    
    * guix/build-system/ocaml.scm:
      (make-lower): New variable.
      (lower): Define in terms of `make-lower`.
    
    Change-Id: I9ee6ee2ae9a2d02c94028161100393254c5a2316
    Signed-off-by: Julien Lepiller <[email protected]>
---
 guix/build-system/ocaml.scm | 57 ++++++++++++++++++++++++---------------------
 1 file changed, 30 insertions(+), 27 deletions(-)

diff --git a/guix/build-system/ocaml.scm b/guix/build-system/ocaml.scm
index 34c9604ef7..a996a92867 100644
--- a/guix/build-system/ocaml.scm
+++ b/guix/build-system/ocaml.scm
@@ -248,33 +248,34 @@ pre-defined variants."
     (inherit p)
     (properties (alist-delete 'ocaml5.3-variant (package-properties p)))))
 
-(define* (lower name
-                #:key source inputs native-inputs outputs system target
-                (ocaml (default-ocaml))
-                (findlib (default-findlib))
-                #:allow-other-keys
-                #:rest arguments)
-  "Return a bag for NAME."
-  (define private-keywords
-    '(#:target #:ocaml #:findlib #:inputs #:native-inputs))
-
-  (and (not target)                               ;XXX: no cross-compilation
-       (bag
-         (name name)
-         (system system)
-         (host-inputs `(,@(if source
-                              `(("source" ,source))
-                              '())
-                        ,@inputs))
-         (build-inputs `(("ocaml" ,ocaml)
-                         ("findlib" ,findlib)
-                         ,@native-inputs
-
-                         ;; Keep the standard inputs of 'gnu-build-system'.
-                         ,@(standard-packages)))
-         (outputs outputs)
-         (build ocaml-build)
-         (arguments (strip-keyword-arguments private-keywords arguments)))))
+(define (make-lower default-ocaml default-findlib)
+  (lambda* (name
+            #:key source inputs native-inputs outputs system target
+            (ocaml (default-ocaml))
+            (findlib (default-findlib))
+            #:allow-other-keys
+            #:rest arguments)
+    "Return a bag for NAME."
+    (define private-keywords
+      '(#:target #:ocaml #:findlib #:inputs #:native-inputs))
+
+    (and (not target)                   ;XXX: no cross-compilation
+         (bag
+           (name name)
+           (system system)
+           (host-inputs `(,@(if source
+                                `(("source" ,source))
+                                '())
+                          ,@inputs))
+           (build-inputs `(("ocaml" ,ocaml)
+                           ("findlib" ,findlib)
+                           ,@native-inputs
+
+                           ;; Keep the standard inputs of 'gnu-build-system'.
+                           ,@(standard-packages)))
+           (outputs outputs)
+           (build ocaml-build)
+           (arguments (strip-keyword-arguments private-keywords arguments))))))
 
 (define* (ocaml-build name inputs
                       #:key
@@ -334,6 +335,8 @@ provides a 'setup.ml' file as its build system."
                     #:graft? #f
                     #:guile-for-build guile))
 
+(define lower (make-lower default-ocaml default-findlib))
+
 (define ocaml-build-system
   (build-system
     (name 'ocaml)

Reply via email to