From 7a7995cb5718c133124ae29fd8276fbe2ff57a35 Mon Sep 17 00:00:00 2001 From: ng0 Date: Tue, 16 May 2017 22:28:57 +0000 Subject: [PATCH] gnu: alpine: Add 'generate-system-pine.conf' phase. * gnu/packages/mail.scm (alpine)[arguments]: Add new 'generate-system-pine.conf' phase to provide system-wide configs which are expected by alpine. --- gnu/packages/mail.scm | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm index b4dfef6ec..ecb49af0b 100644 --- a/gnu/packages/mail.scm +++ b/gnu/packages/mail.scm @@ -2264,7 +2264,25 @@ operators and scripters.") (substitute* (list "alpine/Makefile.in" "web/src/alpined.d/Makefile.in") (("`date`") "1970-01-01")) - #t))))) + #t)) + (add-after 'install 'generate-system-pine.conf + (lambda* (#:key outputs #:allow-other-keys) + ;; Alpine will silently complain if no system-wide + ;; default config is present. This is the recommended + ;; way of generating such a config. + (let* ((out (assoc-ref outputs "out")) + (alpine (string-append out "/bin/alpine")) + (lib (string-append out "/lib"))) + (mkdir-p lib) + (with-output-to-file + (string-append lib "/pine.conf") + (lambda _ + (zero? (system* alpine "-conf")) + out)) + ;; pine.conf.fixed is expected aswell, so pine.conf.fixed + ;; is equal to pine.conf in our system. + (symlink (string-append lib "/pine.conf") + (string-append lib "/pine.conf.fixed")))))))) (inputs `(("ncurses" ,ncurses) ("openssl" ,openssl) -- 2.13.0