diff options
author | Ludovic Courtès <ludo@gnu.org> | 2012-07-01 17:32:03 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2012-07-05 01:04:20 +0200 |
commit | 74cd03b1a08a73c349818312cf2e0be9f54e0d4e (patch) | |
tree | a4d913a4dffff66448b3040b07e3fdc258c762a4 /guix/build/gnu-build-system.scm | |
parent | 3e43c64a74cc48553a723bc14f17578f585502e2 (diff) | |
download | gnu-guix-74cd03b1a08a73c349818312cf2e0be9f54e0d4e.tar gnu-guix-74cd03b1a08a73c349818312cf2e0be9f54e0d4e.tar.gz |
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.
Diffstat (limited to 'guix/build/gnu-build-system.scm')
-rw-r--r-- | guix/build/gnu-build-system.scm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index 6ee9afc845..566903ed73 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -56,6 +56,14 @@ (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 @@ ;; 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) |