From 6e8986c8388e889eb74509999aea826fd440dcc4 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Tue, 18 Dec 2018 21:43:53 +0100 Subject: 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. --- guix/build-system/ocaml.scm | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'guix/build-system/ocaml.scm') 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 @@ (define-module (guix build-system ocaml) 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 @@ (define (default-findlib) (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 @@ (define (transform p) => 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 @@ (define (transform p) (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?)) -- cgit v1.2.3