aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-10-10 23:00:47 +0200
committerLudovic Courtès <ludo@gnu.org>2013-10-10 23:00:47 +0200
commit1d9bc45925ae1cb8b1984a8fc5eb439aad592c2a (patch)
treec9fedd5e88bdd38e4e279be1c1c3ec990630e09b
parentcdecf775011498fabb1f484d59b626e0f1ee408c (diff)
downloadpatches-1d9bc45925ae1cb8b1984a8fc5eb439aad592c2a.tar
patches-1d9bc45925ae1cb8b1984a8fc5eb439aad592c2a.tar.gz
packages: The 'patch-guile' field of <origin> is now a package.
* guix/packages.scm (default-guile): Return a package instead of a derivation. (package-source-derivation): Adjust accordingly.
-rw-r--r--guix/packages.scm26
1 files changed, 16 insertions, 10 deletions
diff --git a/guix/packages.scm b/guix/packages.scm
index 44f683f776..157013a496 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -109,9 +109,12 @@
(patches origin-patches (default '())) ; list of file names
(patch-flags origin-patch-flags ; list of strings
(default '("-p1")))
+
+ ;; Patching requires Guile, GNU Patch, and a few more. These two fields are
+ ;; used to specify these dependencies when needed.
(patch-inputs origin-patch-inputs ; input list or #f
(default #f))
- (patch-guile origin-patch-guile ; derivation or #f
+ (patch-guile origin-patch-guile ; package or #f
(default #f)))
(define-syntax base32
@@ -264,11 +267,10 @@ corresponds to the arguments expected by `set-path-environment-variable'."
("lzip" ,(ref '(gnu packages compression) 'lzip))
("patch" ,(ref '(gnu packages base) 'patch)))))
-(define (default-guile store system)
- "Return a derivation of d the default Guile package for SYSTEM."
- (let* ((distro (resolve-interface '(gnu packages base)))
- (guile (module-ref distro 'guile-final)))
- (package-derivation store guile system)))
+(define (default-guile)
+ "Return the default Guile package for SYSTEM."
+ (let ((distro (resolve-interface '(gnu packages base))))
+ (module-ref distro 'guile-final)))
(define* (patch-and-repack store source patches inputs
#:key
@@ -363,13 +365,17 @@ using the tools listed in INPUTS."
inputs guile-for-build)
;; One or more patches.
(let ((source (method store uri 'sha256 sha256 name
- #:system system)))
+ #:system system))
+ (guile (match (or guile-for-build (%guile-for-build)
+ (default-guile))
+ ((? package? p)
+ (package-derivation store p system))
+ ((? derivation? drv)
+ drv))))
(patch-and-repack store source patches inputs
#:flags flags
#:system system
- #:guile-for-build (or guile-for-build
- (%guile-for-build)
- (default-guile store system)))))
+ #:guile-for-build guile)))
((and (? string?) (? store-path?) file)
file)
((? string? file)