summaryrefslogtreecommitdiff
path: root/guix/build-system/ocaml.scm
diff options
context:
space:
mode:
authorJulien Lepiller <julien@lepiller.eu>2018-12-18 21:43:53 +0100
committerJulien Lepiller <julien@lepiller.eu>2018-12-18 22:16:23 +0100
commit6e8986c8388e889eb74509999aea826fd440dcc4 (patch)
treefff8eafadede4056fa3efaebd2eeedc854c4fe84 /guix/build-system/ocaml.scm
parentd852cf9e331888c23b4f9377064145ae74339644 (diff)
downloadgnu-guix-6e8986c8388e889eb74509999aea826fd440dcc4.tar
gnu-guix-6e8986c8388e889eb74509999aea826fd440dcc4.tar.gz
build: Add dune-build-system.
* guix/build/dune-build-system.scm, guix/build-system/dune.scm: New files. * Makefile.am (MODULES): Add them. * doc/guix.texi (Build Systems): Document dune-build-system. * guix/build-system/ocaml.scm (lower, default-findlib, default-ocaml): Export them. (package-with-explicit-ocaml): Also transform packages built with dune-build-system.
Diffstat (limited to 'guix/build-system/ocaml.scm')
-rw-r--r--guix/build-system/ocaml.scm16
1 files changed, 14 insertions, 2 deletions
diff --git a/guix/build-system/ocaml.scm b/guix/build-system/ocaml.scm
index e5b715f55d..07c69fac76 100644
--- a/guix/build-system/ocaml.scm
+++ b/guix/build-system/ocaml.scm
@@ -31,6 +31,9 @@
package-with-ocaml4.02
strip-ocaml4.01-variant
strip-ocaml4.02-variant
+ default-findlib
+ default-ocaml
+ lower
ocaml-build
ocaml-build-system))
@@ -76,6 +79,13 @@
(let ((module (resolve-interface '(gnu packages ocaml))))
(module-ref module 'ocaml-findlib)))
+(define (default-dune-build-system)
+ "Return the dune-build-system."
+
+ ;; Do not use `@' to avoid introducing circular dependencies.
+ (let ((module (resolve-interface '(guix build-system dune))))
+ (module-ref module 'dune-build-system)))
+
(define (default-ocaml4.01)
(let ((ocaml (resolve-interface '(gnu packages ocaml))))
(module-ref ocaml 'ocaml-4.01)))
@@ -119,7 +129,8 @@ pre-defined variants."
=> force)
;; Otherwise build the new package object graph.
- ((eq? (package-build-system p) ocaml-build-system)
+ ((or (eq? (package-build-system p) ocaml-build-system)
+ (eq? (package-build-system p) (default-dune-build-system)))
(package
(inherit p)
(location (package-location p))
@@ -138,7 +149,8 @@ pre-defined variants."
(else p)))
(define (cut? p)
- (or (not (eq? (package-build-system p) ocaml-build-system))
+ (or (not (or (eq? (package-build-system p) ocaml-build-system)
+ (eq? (package-build-system p) (default-dune-build-system))))
(package-variant p)))
(package-mapping transform cut?))