summaryrefslogtreecommitdiff
path: root/guix/packages.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-08-24 16:58:44 +0200
committerLudovic Courtès <ludo@gnu.org>2013-08-24 17:30:31 +0200
commit7357138bba23851584f522e6a986ca3fc80dbf43 (patch)
treee66c5334a78472b4f33ad12e1057aa78d996925b /guix/packages.scm
parentb095792f9b8676411f7b5eb6c768d28ae123449b (diff)
packages: Allow file names as package sources.
* guix/packages.scm (package-source-derivation): Add cases for SOURCE as a store path or user file. * tests/packages.scm ("package-source-derivation, file", "package-source-derivation, store path"): New tests.
Diffstat (limited to 'guix/packages.scm')
-rw-r--r--guix/packages.scm6
1 files changed, 5 insertions, 1 deletions
diff --git a/guix/packages.scm b/guix/packages.scm
index bb46131132..f63727dd32 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -250,7 +250,11 @@ corresponds to the arguments expected by `set-path-environment-variable'."
(match source
(($ <origin> uri method sha256 name)
(method store uri 'sha256 sha256 name
- #:system system))))
+ #:system system))
+ ((and (? string?) (? store-path?) file)
+ file)
+ ((? string? file)
+ (add-to-store store (basename file) #t "sha256" file))))
(define (transitive-inputs inputs)
(let loop ((inputs inputs)