mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-11 05:39:41 -05:00
build-system/gnu: Add a `patch' phase.
* guix/build/gnu-build-system.scm (patch): New procedure. (%standard-phases): Add `patch'. * guix/build-system/gnu.scm (gnu-build): Add `patches' and `patch-flags' parameters. Pass them on.
This commit is contained in:
parent
3e43c64a74
commit
74cd03b1a0
2 changed files with 14 additions and 2 deletions
|
@ -43,7 +43,9 @@ (define %standard-inputs
|
|||
|
||||
(define* (gnu-build store name source inputs
|
||||
#:key (outputs '("out")) (configure-flags ''())
|
||||
(make-flags ''()) (phases '%standard-phases)
|
||||
(make-flags ''())
|
||||
(patches ''()) (patch-flags ''("--batch" "-p1"))
|
||||
(phases '%standard-phases)
|
||||
(system (%current-system))
|
||||
(modules '((guix build gnu-build-system)
|
||||
(guix build utils))))
|
||||
|
@ -57,6 +59,8 @@ (define builder
|
|||
source)
|
||||
#:outputs %outputs
|
||||
#:inputs %build-inputs
|
||||
#:patches ,patches
|
||||
#:patch-flags ,patch-flags
|
||||
#:phases ,phases
|
||||
#:configure-flags ,configure-flags
|
||||
#:make-flags ,make-flags)))
|
||||
|
|
|
@ -56,6 +56,14 @@ (define* (unpack #:key source #:allow-other-keys)
|
|||
(and (zero? (system* "tar" "xvf" source))
|
||||
(chdir (first-subdirectory "."))))
|
||||
|
||||
(define* (patch #:key (patches '()) (patch-flags '("--batch" "-p1"))
|
||||
#:allow-other-keys)
|
||||
(every (lambda (p)
|
||||
(format #t "applying patch `~a'~%" p)
|
||||
(zero? (apply system* "patch"
|
||||
(append patch-flags (list p)))))
|
||||
patches))
|
||||
|
||||
(define* (configure #:key outputs (configure-flags '()) #:allow-other-keys)
|
||||
(let* ((prefix (assoc-ref outputs "out"))
|
||||
(libdir (assoc-ref outputs "lib"))
|
||||
|
@ -94,7 +102,7 @@ (define %standard-phases
|
|||
;; Standard build phases, as a list of symbol/procedure pairs.
|
||||
(let-syntax ((phases (syntax-rules ()
|
||||
((_ p ...) `((p . ,p) ...)))))
|
||||
(phases set-paths unpack configure build check install)))
|
||||
(phases set-paths unpack patch configure build check install)))
|
||||
|
||||
|
||||
(define* (gnu-build #:key (source #f) (outputs #f) (inputs #f)
|
||||
|
|
Loading…
Reference in a new issue