mirror of
https://codeberg.org/hako/Rosenthal.git
synced 2026-11-29 22:58:06 +00:00
utils: Add sri-hash.
* modules/rosenthal/utils/packages.scm (sri-hash): New macro.
This commit is contained in:
1 file changed
+17
-1
@@ -23,7 +23,9 @@
|
|||||||
#:use-module (gnu packages base)
|
#:use-module (gnu packages base)
|
||||||
#:replace (%patch-path
|
#:replace (%patch-path
|
||||||
search-patch)
|
search-patch)
|
||||||
#:export (rosenthal-patches
|
#:export (sri-hash
|
||||||
|
|
||||||
|
rosenthal-patches
|
||||||
%rosenthal-package-module-path
|
%rosenthal-package-module-path
|
||||||
all-rosenthal-packages
|
all-rosenthal-packages
|
||||||
|
|
||||||
@@ -39,6 +41,20 @@
|
|||||||
binary-package
|
binary-package
|
||||||
mapping-for-system))
|
mapping-for-system))
|
||||||
|
|
||||||
|
(define-syntax sri-hash
|
||||||
|
(lambda (stx)
|
||||||
|
(syntax-case stx ()
|
||||||
|
((_ str)
|
||||||
|
(let ((str (syntax->datum #'str)))
|
||||||
|
(and (string? str)
|
||||||
|
(string-index str #\-)))
|
||||||
|
(let* ((str (syntax->datum #'str))
|
||||||
|
(dash (string-index str #\-))
|
||||||
|
(algo (substring str 0 dash))
|
||||||
|
(hash (substring str (1+ dash))))
|
||||||
|
(with-syntax ((algorithm (datum->syntax #'stx (string->symbol algo))))
|
||||||
|
#`(content-hash (base64 #,hash) algorithm)))))))
|
||||||
|
|
||||||
(define %rosenthal-root-directory
|
(define %rosenthal-root-directory
|
||||||
;; This is like %distro-root-directory from (gnu packages), with adjusted
|
;; This is like %distro-root-directory from (gnu packages), with adjusted
|
||||||
;; paths.
|
;; paths.
|
||||||
|
|||||||
Reference in new issue
Block a user