diff options
author | jdlugosz963 <jdlugosz963@gmail.com> | 2023-07-02 15:36:22 +0200 |
---|---|---|
committer | jdlugosz963 <jdlugosz963@gmail.com> | 2023-07-02 15:36:22 +0200 |
commit | e14390858839d7fd56b579d6489ea7bc88a5e530 (patch) | |
tree | ff41ac387a8c0c3d4f135bf41d5f95b857d78bdc /guix/jd/utils.scm | |
parent | 6156f86dd5797de5ea4f912b70d38963c6cf4ad4 (diff) | |
download | dotfiles-e14390858839d7fd56b579d6489ea7bc88a5e530.tar.gz dotfiles-e14390858839d7fd56b579d6489ea7bc88a5e530.zip |
Add GNU/Guix config files.
Diffstat (limited to 'guix/jd/utils.scm')
-rw-r--r-- | guix/jd/utils.scm | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/guix/jd/utils.scm b/guix/jd/utils.scm new file mode 100644 index 0000000..5be7fa9 --- /dev/null +++ b/guix/jd/utils.scm | |||
@@ -0,0 +1,25 @@ | |||
1 | (define-module (jd utils) | ||
2 | #:export (jd-search-patches)) | ||
3 | |||
4 | ;; This code is copied and modified from (gnu packages) module. | ||
5 | |||
6 | (define %jd-patch-path | ||
7 | (make-parameter | ||
8 | (map (lambda (directory) | ||
9 | (let ((jd-patch-dir (string-append directory "/jd/packages/patches"))) | ||
10 | (if (and (file-exists? jd-patch-dir) | ||
11 | (file-is-directory? jd-patch-dir)) | ||
12 | jd-patch-dir | ||
13 | directory))) | ||
14 | %load-path))) | ||
15 | |||
16 | (define (jd-search-patch file-name) | ||
17 | "Search the patch FILE-NAME. Raise an error if not found." | ||
18 | (or (search-path (%jd-patch-path) file-name) | ||
19 | (raise (string-append file-name | ||
20 | ": patch not found")))) | ||
21 | |||
22 | (define-syntax-rule (jd-search-patches file-name ...) | ||
23 | "Return the list of absolute file names corresponding to each | ||
24 | FILE-NAME found in %JD-PATCH-PATH." | ||
25 | (list (jd-search-patch file-name) ...)) | ||