guix_mirror_bot pushed a commit to branch ocaml-team
in repository guix.
commit 31f19abe798b9790d4214c48d2df0332b90fc8b3
Author: Jason Conroy <[email protected]>
AuthorDate: Sat Nov 29 07:05:29 2025 -0500
guix: ocaml: Identify OCaml and Dune build systems by name.
* guix/build-system/ocaml.scm (package-with-explicit-ocaml):
Identify OCaml and Dune build systems using `build-system-name`.
Change-Id: I406ff96ec4ccb018eabc02cdab843faa0b4a77ab
Signed-off-by: Julien Lepiller <[email protected]>
---
guix/build-system/ocaml.scm | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/guix/build-system/ocaml.scm b/guix/build-system/ocaml.scm
index c2b79af9bc..34c9604ef7 100644
--- a/guix/build-system/ocaml.scm
+++ b/guix/build-system/ocaml.scm
@@ -155,6 +155,12 @@ pre-defined variants."
variant-property))
(const #f)))
+ (define (has-ocaml-build-system? p)
+ (eq? 'ocaml (build-system-name (package-build-system p))))
+
+ (define (has-dune-build-system? p)
+ (eq? 'dune (build-system-name (package-build-system p))))
+
(define (transform p)
(cond
;; If VARIANT-PROPERTY is present, use that.
@@ -162,8 +168,7 @@ pre-defined variants."
=> force)
;; Otherwise build the new package object graph.
- ((or (eq? (package-build-system p) ocaml-build-system)
- (eq? (package-build-system p) (default-dune-build-system)))
+ ((or (has-ocaml-build-system? p) (has-dune-build-system? p))
(package
(inherit p)
(location (package-location p))
@@ -180,15 +185,13 @@ pre-defined variants."
(ensure-keyword-arguments (package-arguments p)
`(#:ocaml ,ocaml
#:findlib ,findlib
- ,@(if (eq? (package-build-system p)
- (default-dune-build-system))
+ ,@(if (has-dune-build-system? p)
`(#:dune ,dune)
'())))))))
(else p)))
(define (cut? p)
- (or (not (or (eq? (package-build-system p) ocaml-build-system)
- (eq? (package-build-system p) (default-dune-build-system))))
+ (or (not (or (has-ocaml-build-system? p) (has-dune-build-system? p)))
(package-variant p)))
(package-mapping transform cut?))