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.
This commit is contained in:
parent
0ccd9463ec
commit
1e8da4cdef
@ -92,7 +92,11 @@
|
|||||||
(let ((module (resolve-interface '(gnu packages ocaml))))
|
(let ((module (resolve-interface '(gnu packages ocaml))))
|
||||||
(module-ref module 'ocaml4.07-findlib)))
|
(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)
|
#:key variant-property)
|
||||||
"Return a procedure of one argument, P. The procedure creates a package
|
"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
|
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
|
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.
|
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
|
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
|
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
|
of packages. The property value must be the promise of a package. This is a
|
||||||
@ -132,10 +140,15 @@ pre-defined variants."
|
|||||||
name))))
|
name))))
|
||||||
(arguments
|
(arguments
|
||||||
(let ((ocaml (if (promise? ocaml) (force ocaml) ocaml))
|
(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)
|
(ensure-keyword-arguments (package-arguments p)
|
||||||
`(#:ocaml ,ocaml
|
`(#:ocaml ,ocaml
|
||||||
#:findlib ,findlib))))))
|
#:findlib ,findlib
|
||||||
|
,@(if (eq? (package-build-system p)
|
||||||
|
(default-dune-build-system))
|
||||||
|
`(#:dune ,dune)
|
||||||
|
'())))))))
|
||||||
(else p)))
|
(else p)))
|
||||||
|
|
||||||
(define (cut? p)
|
(define (cut? p)
|
||||||
@ -148,6 +161,7 @@ pre-defined variants."
|
|||||||
(define package-with-ocaml4.07
|
(define package-with-ocaml4.07
|
||||||
(package-with-explicit-ocaml (delay (default-ocaml4.07))
|
(package-with-explicit-ocaml (delay (default-ocaml4.07))
|
||||||
(delay (default-ocaml4.07-findlib))
|
(delay (default-ocaml4.07-findlib))
|
||||||
|
(delay (default-ocaml4.07-dune))
|
||||||
"ocaml-" "ocaml4.07-"
|
"ocaml-" "ocaml4.07-"
|
||||||
#:variant-property 'ocaml4.07-variant))
|
#:variant-property 'ocaml4.07-variant))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user