mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
build-system/gnu: Add `out-of-source?' keyword parameter.
* guix/build/gnu-build-system.scm (configure): Add an `out-of-source?' keyword parameter; build out-of-source-tree when #t. * guix/build-system/gnu.scm (gnu-build): Add `out-of-source?' keyword parameter. Pass it in BUILDER.
This commit is contained in:
parent
d36622dc44
commit
22b5d9c9a5
2 changed files with 15 additions and 3 deletions
|
@ -46,6 +46,7 @@ (define* (gnu-build store name source inputs
|
|||
#:key (outputs '("out")) (configure-flags ''())
|
||||
(make-flags ''())
|
||||
(patches ''()) (patch-flags ''("--batch" "-p1"))
|
||||
(out-of-source? #f)
|
||||
(tests? #t)
|
||||
(parallel-build? #t) (parallel-tests? #t)
|
||||
(patch-shebangs? #t)
|
||||
|
@ -68,6 +69,7 @@ (define builder
|
|||
#:phases ,phases
|
||||
#:configure-flags ,configure-flags
|
||||
#:make-flags ,make-flags
|
||||
#:out-of-source? ,out-of-source?
|
||||
#:tests? ,tests?
|
||||
#:parallel-build? ,parallel-build?
|
||||
#:parallel-tests? ,parallel-tests?
|
||||
|
|
|
@ -74,7 +74,8 @@ (define* (patch #:key (patches '()) (patch-flags '("--batch" "-p1"))
|
|||
(append patch-flags (list p)))))
|
||||
patches))
|
||||
|
||||
(define* (configure #:key outputs (configure-flags '()) #:allow-other-keys)
|
||||
(define* (configure #:key outputs (configure-flags '()) out-of-source?
|
||||
#:allow-other-keys)
|
||||
(let* ((prefix (assoc-ref outputs "out"))
|
||||
(libdir (assoc-ref outputs "lib"))
|
||||
(includedir (assoc-ref outputs "include"))
|
||||
|
@ -90,9 +91,18 @@ (define* (configure #:key outputs (configure-flags '()) #:allow-other-keys)
|
|||
(list (string-append "--includedir="
|
||||
includedir "/include"))
|
||||
'())
|
||||
,@configure-flags)))
|
||||
,@configure-flags))
|
||||
(srcdir (getcwd)))
|
||||
(format #t "source directory: ~s~%" srcdir)
|
||||
(if out-of-source?
|
||||
(begin
|
||||
(mkdir "../build")
|
||||
(chdir "../build")))
|
||||
(format #t "build directory: ~s~%" (getcwd))
|
||||
(format #t "configure flags: ~s~%" flags)
|
||||
(zero? (apply system* "./configure" flags))))
|
||||
(zero? (apply system*
|
||||
(string-append (if out-of-source? srcdir ".") "/configure")
|
||||
flags))))
|
||||
|
||||
(define* (build #:key (make-flags '()) (parallel-build? #t)
|
||||
#:allow-other-keys)
|
||||
|
|
Loading…
Reference in a new issue