summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Pykhalov <go.wigust@gmail.com>2018-06-14 08:41:44 +0300
committerOleg Pykhalov <go.wigust@gmail.com>2018-06-14 08:41:44 +0300
commit67b8ef2c3906e3cd7a0436ad4c308120a0001253 (patch)
tree6cbebc034661343782708776eccfb53f4f169305
parentwigust: Add restic. (diff)
downloadguix-wigust-67b8ef2c3906e3cd7a0436ad4c308120a0001253.tar.gz
wigust: restic: Install shell completion.
* wigust/packages/golang.scm (restic): Install shell completion.
-rw-r--r--wigust/packages/golang.scm29
1 files changed, 26 insertions, 3 deletions
diff --git a/wigust/packages/golang.scm b/wigust/packages/golang.scm
index 0697637..c38bab2 100644
--- a/wigust/packages/golang.scm
+++ b/wigust/packages/golang.scm
@@ -64,12 +64,10 @@
(replace 'install
(lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))
- (utils (assoc-ref outputs "utils"))
(src (string-append "src/github.com/restic/restic/restic-"
,version)))
(install-file (string-append src "/restic")
(string-append out "/bin"))
- (delete-file (string-append src "/restic"))
#t)))
(add-after 'install 'install-docs
@@ -86,7 +84,32 @@
(string-append out man-section
(string-take-right file 1))))
(find-files src "\\.[1-9]"))
- #t))))))
+ #t)))
+
+ (add-after 'install-docs 'install-shell-completion
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (bin (string-append out "/bin"))
+ (etc (string-append out "/etc"))
+ (share (string-append out "/share")))
+ (for-each
+ (lambda (shell)
+ (let* ((shell-name (symbol->string shell))
+ (dir (string-append "etc/completion/" shell-name)))
+ (mkdir-p dir)
+ (invoke (string-append bin "/restic") "generate"
+ (string-append "--" shell-name "-completion")
+ (string-append dir "/"
+ (case shell
+ ((bash) "restic")
+ ((zsh) "_restic"))))))
+ '(bash zsh))
+ (with-directory-excursion "etc/completion"
+ (install-file "bash/restic"
+ (string-append etc "/bash_completion.d"))
+ (install-file "zsh/_restic"
+ (string-append share "/zsh/site-functions")))
+ #t))))))
(home-page "https://restic.net/")
(synopsis "Backup program with multiple revisions, encryption and more")
(description "Restic is a program that does backups right and was designed