summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorJulien Lepiller <julien@lepiller.eu>2019-03-23 19:18:31 +0100
committerJulien Lepiller <julien@lepiller.eu>2019-03-23 22:58:52 +0100
commit78b3748c1c5446f19e7a74ec424d61a7826fc843 (patch)
treed84dd3712d442643de02fc839c31dc2993b715b5 /guix
parentf92854fea150f0d47c4984f87bf21bd5f8051820 (diff)
guix: dune-build-system: Add a package parameter.
* guix/build-system/dune.scm: Add a package parameter. * guix/build/dune.scm (build, test, install): Use it. * doc/guix.texi: Document it.
Diffstat (limited to 'guix')
-rw-r--r--guix/build-system/dune.scm2
-rw-r--r--guix/build/dune-build-system.scm17
2 files changed, 12 insertions, 7 deletions
diff --git a/guix/build-system/dune.scm b/guix/build-system/dune.scm
index 8bd41c89f0..6a2f3d16de 100644
--- a/guix/build-system/dune.scm
+++ b/guix/build-system/dune.scm
@@ -87,6 +87,7 @@
(build-flags ''())
(out-of-source? #t)
(jbuild? #f)
+ (package #f)
(tests? #t)
(test-flags ''())
(test-target "test")
@@ -125,6 +126,7 @@ provides a 'setup.ml' file as its build system."
#:build-flags ,build-flags
#:out-of-source? ,out-of-source?
#:jbuild? ,jbuild?
+ #:package ,package
#:tests? ,tests?
#:test-target ,test-target
#:install-target ,install-target
diff --git a/guix/build/dune-build-system.scm b/guix/build/dune-build-system.scm
index 00b0c7c406..7e2ec1e3e1 100644
--- a/guix/build/dune-build-system.scm
+++ b/guix/build/dune-build-system.scm
@@ -31,27 +31,30 @@
;; Code:
(define* (build #:key (build-flags '()) (jbuild? #f)
- (use-make? #f) #:allow-other-keys)
+ (use-make? #f) (package #f) #:allow-other-keys)
"Build the given package."
(let ((program (if jbuild? "jbuilder" "dune")))
- (apply invoke program "build" "@install" build-flags))
+ (apply invoke program "build" "@install"
+ (append (if package (list "-p" package) '()) build-flags)))
#t)
(define* (check #:key (test-flags '()) (test-target "test") tests?
- (jbuild? #f) #:allow-other-keys)
+ (jbuild? #f) (package #f) #:allow-other-keys)
"Test the given package."
(when tests?
(let ((program (if jbuild? "jbuilder" "dune")))
- (apply invoke program "runtest" test-target test-flags)))
+ (apply invoke program "runtest" test-target
+ (append (if package (list "-p" package) '()) test-flags))))
#t)
(define* (install #:key outputs (install-target "install") (jbuild? #f)
- #:allow-other-keys)
+ (package #f) #:allow-other-keys)
"Install the given package."
(let ((out (assoc-ref outputs "out"))
(program (if jbuild? "jbuilder" "dune")))
- (invoke program install-target "--prefix" out "--libdir"
- (string-append out "/lib/ocaml/site-lib")))
+ (apply invoke program install-target "--prefix" out "--libdir"
+ (string-append out "/lib/ocaml/site-lib")
+ (if package (list package) '())))
#t)
(define %standard-phases