summaryrefslogtreecommitdiff
path: root/guix/packages.scm
diff options
context:
space:
mode:
authorLeo Famulari <leo@famulari.name>2021-01-25 15:21:09 -0500
committerLeo Famulari <leo@famulari.name>2021-01-25 15:40:55 -0500
commit68dd78e2e47248b3e1e7ba1807a92a8374b39097 (patch)
treed38564293f285d688a55b23e8a6424c6b26213b1 /guix/packages.scm
parent8b55544212a90b0276df49596a3d373e5c2e8f5c (diff)
parent3f0af15131e524891df8c9f013f1be1597fe2d7e (diff)
downloadguix-patches-68dd78e2e47248b3e1e7ba1807a92a8374b39097.tar
guix-patches-68dd78e2e47248b3e1e7ba1807a92a8374b39097.tar.gz
Merge branch 'master' into staging
Diffstat (limited to 'guix/packages.scm')
-rw-r--r--guix/packages.scm38
1 files changed, 19 insertions, 19 deletions
diff --git a/guix/packages.scm b/guix/packages.scm
index 6fa761f569..9305dabcec 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -167,6 +167,25 @@
;;;
;;; Code:
+(define-syntax-rule (define-compile-time-decoder name string->bytevector)
+ "Define NAME as a macro that runs STRING->BYTEVECTOR at macro expansion time
+if possible."
+ (define-syntax name
+ (lambda (s)
+ "Return the bytevector corresponding to the given textual
+representation."
+ (syntax-case s ()
+ ((_ str)
+ (string? (syntax->datum #'str))
+ ;; A literal string: do the conversion at expansion time.
+ (with-syntax ((bv (string->bytevector (syntax->datum #'str))))
+ #''bv))
+ ((_ str)
+ #'(string->bytevector str))))))
+
+(define-compile-time-decoder base32 nix-base32-string->bytevector)
+(define-compile-time-decoder base64 base64-decode)
+
;; Crytographic content hash.
(define-immutable-record-type <content-hash>
(%content-hash algorithm value)
@@ -302,25 +321,6 @@ specifications to 'hash'."
(set-record-type-printer! <origin> print-origin)
-(define-syntax-rule (define-compile-time-decoder name string->bytevector)
- "Define NAME as a macro that runs STRING->BYTEVECTOR at macro expansion time
-if possible."
- (define-syntax name
- (lambda (s)
- "Return the bytevector corresponding to the given textual
-representation."
- (syntax-case s ()
- ((_ str)
- (string? (syntax->datum #'str))
- ;; A literal string: do the conversion at expansion time.
- (with-syntax ((bv (string->bytevector (syntax->datum #'str))))
- #''bv))
- ((_ str)
- #'(string->bytevector str))))))
-
-(define-compile-time-decoder base32 nix-base32-string->bytevector)
-(define-compile-time-decoder base64 base64-decode)
-
(define (origin-actual-file-name origin)
"Return the file name of ORIGIN, either its 'file-name' field or the file
name of its URI."