diff options
author | Julien Lepiller <julien@lepiller.eu> | 2020-01-23 03:24:01 +0100 |
---|---|---|
committer | Julien Lepiller <julien@lepiller.eu> | 2020-01-27 03:55:52 +0100 |
commit | 1e8da4cdefb089ac7d2453d71f72924540238d87 (patch) | |
tree | 0424bfa7e3df6cfbf8b931e90baf79295048c8a1 | |
parent | 0ccd9463ec0be3bb225373575355e987664555d5 (diff) | |
download | guix-1e8da4cdefb089ac7d2453d71f72924540238d87.tar.gz guix-1e8da4cdefb089ac7d2453d71f72924540238d87.zip |
guix: ocaml: Also replace dune when relevant in package-with-explicit-ocaml.
* guix/build-system/ocaml.scm (package-with-explicit-ocaml): Take a dune
argument and add it to transformed packages when relevant.
-rw-r--r-- | guix/build-system/ocaml.scm | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/guix/build-system/ocaml.scm b/guix/build-system/ocaml.scm index de3e71a5aa..c5996bf0cf 100644 --- a/guix/build-system/ocaml.scm +++ b/guix/build-system/ocaml.scm @@ -92,7 +92,11 @@ (let ((module (resolve-interface '(gnu packages ocaml)))) (module-ref module 'ocaml4.07-findlib))) -(define* (package-with-explicit-ocaml ocaml findlib old-prefix new-prefix +(define (default-ocaml4.07-dune) + (let ((module (resolve-interface '(gnu packages ocaml)))) + (module-ref module 'ocaml4.07-dune))) + +(define* (package-with-explicit-ocaml ocaml findlib dune old-prefix new-prefix #:key variant-property) "Return a procedure of one argument, P. The procedure creates a package with the same fields as P, which is assumed to use OCAML-BUILD-SYSTEM, such @@ -100,6 +104,10 @@ that it is compiled with OCAML and FINDLIB instead. The inputs are changed recursively accordingly. If the name of P starts with OLD-PREFIX, this is replaced by NEW-PREFIX; otherwise, NEW-PREFIX is prepended to the name. +When the package uses the DUNE-BUILD-SYSTEM, the procedure creates a package +with the same fields as P, such that it is compiled with OCAML, FINDLIB and DUNE +instead. + When VARIANT-PROPERTY is present, it is used as a key to search for pre-defined variants of this transformation recorded in the 'properties' field of packages. The property value must be the promise of a package. This is a @@ -132,10 +140,15 @@ pre-defined variants." name)))) (arguments (let ((ocaml (if (promise? ocaml) (force ocaml) ocaml)) - (findlib (if (promise? findlib) (force findlib) findlib))) + (findlib (if (promise? findlib) (force findlib) findlib)) + (dune (if (promise? dune) (force dune) dune))) (ensure-keyword-arguments (package-arguments p) `(#:ocaml ,ocaml - #:findlib ,findlib)))))) + #:findlib ,findlib + ,@(if (eq? (package-build-system p) + (default-dune-build-system)) + `(#:dune ,dune) + '()))))))) (else p))) (define (cut? p) @@ -148,6 +161,7 @@ pre-defined variants." (define package-with-ocaml4.07 (package-with-explicit-ocaml (delay (default-ocaml4.07)) (delay (default-ocaml4.07-findlib)) + (delay (default-ocaml4.07-dune)) "ocaml-" "ocaml4.07-" #:variant-property 'ocaml4.07-variant)) |