summaryrefslogtreecommitdiff
path: root/guix/packages.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/packages.scm')
-rw-r--r--guix/packages.scm40
1 files changed, 23 insertions, 17 deletions
diff --git a/guix/packages.scm b/guix/packages.scm
index d62d1f3343..acb8f34417 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -406,6 +406,7 @@ IMPORTED-MODULES specify modules to use/import for use by SNIPPET."
(define decompression-type
(cond ((string-suffix? "gz" source-file-name) "gzip")
+ ((string-suffix? "Z" source-file-name) "gzip")
((string-suffix? "bz2" source-file-name) "bzip2")
((string-suffix? "lz" source-file-name) "lzip")
((string-suffix? "zip" source-file-name) "unzip")
@@ -543,7 +544,8 @@ IMPORTED-MODULES specify modules to use/import for use by SNIPPET."
"--files-from=.file_list")))))))))
(let ((name (tarxz-name original-file-name))
- (modules (delete-duplicates (cons '(guix build utils) modules))))
+ (modules (delete-duplicates (cons '(guix build utils)
+ imported-modules))))
(gexp->derivation name build
#:graft? #f
#:system system
@@ -791,7 +793,7 @@ information in exceptions."
;; store path, it needs to be added anyway, so it can be used as a
;; source.
(list name (intern file)))
- (((? string? name) (? origin? source))
+ (((? string? name) (? struct? source))
(list name (package-source-derivation store source system)))
(x
(raise (condition (&package-input-error
@@ -1128,12 +1130,10 @@ cross-compilation target triplet."
(package->cross-derivation package target system)
(package->derivation package system)))
-(define* (origin->derivation source
+(define* (origin->derivation origin
#:optional (system (%current-system)))
- "When SOURCE is an <origin> object, return its derivation for SYSTEM. When
-SOURCE is a file name, return either the interned file name (if SOURCE is
-outside of the store) or SOURCE itself (if SOURCE is already a store item.)"
- (match source
+ "Return the derivation corresponding to ORIGIN."
+ (match origin
(($ <origin> uri method sha256 name (= force ()) #f)
;; No patches, no snippet: this is a fixed-output derivation.
(method uri 'sha256 sha256 name #:system system))
@@ -1153,19 +1153,25 @@ outside of the store) or SOURCE itself (if SOURCE is already a store item.)"
#:flags flags
#:system system
#:modules modules
- #:imported-modules modules
- #:guile-for-build guile)))
- ((and (? string?) (? direct-store-path?) file)
- (with-monad %store-monad
- (return file)))
- ((? string? file)
- (interned-file file (basename file)
- #:recursive? #t))))
+ #:imported-modules imported-modules
+ #:guile-for-build guile)))))
(define-gexp-compiler (origin-compiler (origin origin?) system target)
;; Compile ORIGIN to a derivation for SYSTEM. This is used when referring
;; to an origin from within a gexp.
(origin->derivation origin system))
-(define package-source-derivation
- (store-lower origin->derivation))
+(define package-source-derivation ;somewhat deprecated
+ (let ((lower (store-lower lower-object)))
+ (lambda* (store source #:optional (system (%current-system)))
+ "Return the derivation or file corresponding to SOURCE, which can be an
+a file name or any object handled by 'lower-object', such as an <origin>.
+When SOURCE is a file name, return either the interned file name (if SOURCE is
+outside of the store) or SOURCE itself (if SOURCE is already a store item.)"
+ (match source
+ ((and (? string?) (? direct-store-path?) file)
+ file)
+ ((? string? file)
+ (add-to-store store (basename file) #t "sha256" file))
+ (_
+ (lower store source system))))))