From e4c245f8a5f6b6485f980b9c4274909ee8ef567a Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 1 Jul 2012 17:32:03 +0200 Subject: Add a `base32' macro, for convenience. * guix/packages.scm (base32): New macro. * distro/base.scm (libsigsegv, gawk, hello): Use it. --- guix/packages.scm | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'guix/packages.scm') 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 make-package -- cgit v1.2.3