From 67cb9fa2357026ee42ec5bb0923ec4dc4a43abe2 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Tue, 16 Jun 2020 22:25:48 +0200 Subject: build-system/haskell: Support parallel builds. * guix/build-system/haskell.scm (haskell-build): Add keyword PARALLEL-BUILD? and pass it on to the builder. * guix/build/haskell-build-system.scm (build): Accept keyword PARALLEL-BUILD? and pass the number of parallel jobs to GHC. --- guix/build/haskell-build-system.scm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'guix/build') diff --git a/guix/build/haskell-build-system.scm b/guix/build/haskell-build-system.scm index 91f62138d0..5fd0c7dbfe 100644 --- a/guix/build/haskell-build-system.scm +++ b/guix/build/haskell-build-system.scm @@ -121,9 +121,12 @@ (define* (configure #:key outputs inputs tests? (configure-flags '()) (setenv "GHC_PACKAGE_PATH" ghc-path) #t)) -(define* (build #:rest empty) +(define* (build #:key parallel-build? #:allow-other-keys) "Build a given Haskell package." - (run-setuphs "build" '())) + (run-setuphs "build" + (if parallel-build? + `(,(string-append "--ghc-option=-j" (number->string (parallel-job-count)))) + '()))) (define* (install #:rest empty) "Install a given Haskell package." -- cgit v1.2.3