summaryrefslogtreecommitdiff
path: root/guix/packages.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-07-01 17:32:03 +0200
committerLudovic Courtès <ludo@gnu.org>2012-07-02 16:07:26 +0200
commite4c245f8a5f6b6485f980b9c4274909ee8ef567a (patch)
treeb2151bbd1cba6d62bf221c8ab927050b33185aaa /guix/packages.scm
parent03671375b6eda0d47452780d91fd3af7bde791aa (diff)
downloadguix-patches-e4c245f8a5f6b6485f980b9c4274909ee8ef567a.tar
guix-patches-e4c245f8a5f6b6485f980b9c4274909ee8ef567a.tar.gz
Add a `base32' macro, for convenience.
* guix/packages.scm (base32): New macro. * distro/base.scm (libsigsegv, gawk, hello): Use it.
Diffstat (limited to 'guix/packages.scm')
-rw-r--r--guix/packages.scm12
1 files changed, 12 insertions, 0 deletions
diff --git a/guix/packages.scm b/guix/packages.scm
index 0d5823ad5d..1d0cf229b7 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -35,6 +35,7 @@
package-source-method
package-source-sha256
package-source-file-name
+ base32
package
package?
@@ -102,6 +103,17 @@ etc."
(file-name package-source-file-name ; optional file name
(default #f)))
+(define-syntax base32
+ (lambda (s)
+ "Return the bytevector corresponding to the given Nix-base32
+representation."
+ (syntax-case s ()
+ ((_ str)
+ (string? (syntax->datum #'str))
+ (with-syntax ((bv (nix-base32-string->bytevector
+ (syntax->datum #'str))))
+ #''bv)))))
+
;; A package.
(define-record-type* <package>
package make-package