mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-17 04:07:10 -05:00
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.
This commit is contained in:
parent
54c9b5bfd7
commit
67cb9fa235
2 changed files with 7 additions and 2 deletions
|
@ -105,6 +105,7 @@ (define* (haskell-build store name inputs
|
||||||
(haddock-flags ''())
|
(haddock-flags ''())
|
||||||
(tests? #t)
|
(tests? #t)
|
||||||
(test-target "test")
|
(test-target "test")
|
||||||
|
(parallel-build? #t)
|
||||||
(configure-flags ''())
|
(configure-flags ''())
|
||||||
(phases '(@ (guix build haskell-build-system)
|
(phases '(@ (guix build haskell-build-system)
|
||||||
%standard-phases))
|
%standard-phases))
|
||||||
|
@ -138,6 +139,7 @@ (define builder
|
||||||
#:system ,system
|
#:system ,system
|
||||||
#:test-target ,test-target
|
#:test-target ,test-target
|
||||||
#:tests? ,tests?
|
#:tests? ,tests?
|
||||||
|
#:parallel-build? ,parallel-build?
|
||||||
#:haddock? ,haddock?
|
#:haddock? ,haddock?
|
||||||
#:phases ,phases
|
#:phases ,phases
|
||||||
#:outputs %outputs
|
#:outputs %outputs
|
||||||
|
|
|
@ -121,9 +121,12 @@ (define* (configure #:key outputs inputs tests? (configure-flags '())
|
||||||
(setenv "GHC_PACKAGE_PATH" ghc-path)
|
(setenv "GHC_PACKAGE_PATH" ghc-path)
|
||||||
#t))
|
#t))
|
||||||
|
|
||||||
(define* (build #:rest empty)
|
(define* (build #:key parallel-build? #:allow-other-keys)
|
||||||
"Build a given Haskell package."
|
"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)
|
(define* (install #:rest empty)
|
||||||
"Install a given Haskell package."
|
"Install a given Haskell package."
|
||||||
|
|
Loading…
Reference in a new issue