From 7ae6ce069070582e42b669d6a1ecfde5e9b998ba Mon Sep 17 00:00:00 2001 From: Mathieu Lirzin Date: Sat, 2 Jul 2016 15:34:40 +0200 Subject: Add %package-cachedir parameter. --- src/cuirass/base.scm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src') 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 -- cgit v1.2.3