From aba326f79c188e39368c910ddf1bcd884c68a32c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
Date: Thu, 17 Jan 2013 15:45:05 +0100
Subject: [PATCH] packages: Change `base32' to allow non-literal strings.

* guix/packages.scm (base32): Allow arguments that are not literal strings.
---
 guix/packages.scm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/guix/packages.scm b/guix/packages.scm
index 384db6d362f..e65877df589 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -93,9 +93,12 @@ (define-syntax base32
     (syntax-case s ()
       ((_ str)
        (string? (syntax->datum #'str))
+       ;; A literal string: do the conversion at expansion time.
        (with-syntax ((bv (nix-base32-string->bytevector
                           (syntax->datum #'str))))
-         #''bv)))))
+         #''bv))
+      ((_ str)
+       #'(nix-base32-string->bytevector str)))))
 
 ;; A package.
 
-- 
GitLab