gnu: r-qtl2: Move to (gnu packages cran).
[jackhill/guix/guix.git] / guix / packages.scm
index 1e0ec41..6598bd3 100644 (file)
@@ -191,7 +191,10 @@ its first argument has the right size for the chosen algorithm."
 
 (define-content-hash-constructor build-content-hash
   (sha256 32)
-  (sha512 64))
+  (sha512 64)
+  (sha3-256 32)
+  (sha3-512 64)
+  (blake2s-256 64))
 
 (define-syntax content-hash
   (lambda (s)
@@ -225,7 +228,8 @@ as base32.  Otherwise, it must be a bytevector."
 (define (print-content-hash hash port)
   (format port "#<content-hash ~a:~a>"
           (content-hash-algorithm hash)
-          (bytevector->nix-base32-string (content-hash-value hash))))
+          (and=> (content-hash-value hash)
+                 bytevector->nix-base32-string)))
 
 (set-record-type-printer! <content-hash> print-content-hash)
 
@@ -920,22 +924,26 @@ dependencies are known to build on SYSTEM."
 
 (define (bag-transitive-inputs bag)
   "Same as 'package-transitive-inputs', but applied to a bag."
-  (parameterize ((%current-target-system #f))
+  (parameterize ((%current-target-system #f)
+                 (%current-system (bag-system bag)))
     (transitive-inputs (bag-direct-inputs bag))))
 
 (define (bag-transitive-build-inputs bag)
   "Same as 'package-transitive-native-inputs', but applied to a bag."
-  (parameterize ((%current-target-system #f))
+  (parameterize ((%current-target-system #f)
+                 (%current-system (bag-system bag)))
     (transitive-inputs (bag-build-inputs bag))))
 
 (define (bag-transitive-host-inputs bag)
   "Same as 'package-transitive-target-inputs', but applied to a bag."
-  (parameterize ((%current-target-system (bag-target bag)))
+  (parameterize ((%current-target-system (bag-target bag))
+                 (%current-system (bag-system bag)))
     (transitive-inputs (bag-host-inputs bag))))
 
 (define (bag-transitive-target-inputs bag)
   "Return the \"target inputs\" of BAG, recursively."
-  (parameterize ((%current-target-system (bag-target bag)))
+  (parameterize ((%current-target-system (bag-target bag))
+                 (%current-system (bag-system bag)))
     (transitive-inputs (bag-target-inputs bag))))
 
 (define* (package-closure packages #:key (system (%current-system)))