diff options
author | Mathieu Lirzin <mthl@gnu.org> | 2016-07-02 15:34:40 +0200 |
---|---|---|
committer | Mathieu Lirzin <mthl@gnu.org> | 2016-07-02 15:34:40 +0200 |
commit | 7ae6ce069070582e42b669d6a1ecfde5e9b998ba (patch) | |
tree | dc75b40749bec848c919047d1ad8092fe881eadd /src | |
parent | 88e72887a06e3903d0ef991bd4de9530cfeaa3de (diff) | |
download | cuirass-7ae6ce069070582e42b669d6a1ecfde5e9b998ba.tar cuirass-7ae6ce069070582e42b669d6a1ecfde5e9b998ba.tar.gz |
Add %package-cachedir parameter.
Diffstat (limited to 'src')
-rw-r--r-- | src/cuirass/base.scm | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/cuirass/base.scm b/src/cuirass/base.scm index 8e6ea36..c3fe733 100644 --- a/src/cuirass/base.scm +++ b/src/cuirass/base.scm @@ -25,7 +25,8 @@ guix-variable call-with-time-display ;; Parameters. - %program-name)) + %program-name + %package-cachedir)) (define %program-name ;; Similar in spirit to Gnulib 'progname' module. @@ -37,6 +38,17 @@ ((string-rindex val #\/) => (λ (idx) (substring val (1+ idx)))) (else val))))) +(define %package-cachedir + ;; Define to location of cache directory of this package. + (make-parameter (or (getenv "CUIRASS_CACHEDIR") + (string-append (or (getenv "HOME") ".") + "/.cache/cuirass")) + (λ (val) + (if (string? val) + val + (scm-error 'wrong-type-arg + "%package-cachedir" "Not a string: ~S" (list #f) #f))))) + (define (guix-variable module name) "Dynamically link variable NAME under Guix module MODULE and return it. Note: this is used instead of `@', because when using `@' in an uncompiled |