aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/video.scm
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2024-03-05 12:53:44 +0200
committerEfraim Flashner <efraim@flashner.co.il>2024-11-28 11:04:19 +0200
commit9a23c8a0660ca5c87b0a3b1f9a56822b41c61be4 (patch)
tree0c7c404fe49469d68f1352d5ad5ade778d0befb3 /gnu/packages/video.scm
parentaabcbadf61dcb18143495b85119e5aab04667d26 (diff)
downloadguix-9a23c8a0660ca5c87b0a3b1f9a56822b41c61be4.tar.gz
guix-9a23c8a0660ca5c87b0a3b1f9a56822b41c61be4.zip
gnu: rav1e: Add shell completions.
* gnu/packages/video.scm (rav1e)[arguments]: Add a phase to generate and install shell completions. Change-Id: Iaf90be902593f085b3aafb780cd72a75c26b2c58
Diffstat (limited to 'gnu/packages/video.scm')
-rw-r--r--gnu/packages/video.scm35
1 files changed, 34 insertions, 1 deletions
diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index 2da458ed01..7df4b427ed 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -6479,7 +6479,40 @@ result in several formats:
(invoke "cargo" "cinstall" "--release"
;; Only build the dynamic library.
"--library-type" "cdylib"
- (string-append "--prefix=" out))))))))
+ (string-append "--prefix=" out)))))
+ (add-after 'install 'install-completions
+ (lambda* (#:key native-inputs outputs #:allow-other-keys)
+ (unless ,(%current-target-system)
+ (let* ((out (assoc-ref outputs "out"))
+ (share (string-append out "/share"))
+ (bash-completions-dir
+ (string-append out "/etc/bash_completion.d"))
+ (zsh-completions-dir
+ (string-append share "/zsh/site-functions"))
+ (fish-completions-dir
+ (string-append share "/fish/vendor_completions.d"))
+ (elvish-completions-dir
+ (string-append share "/elvish/lib"))
+ (rav1e (string-append out "/bin/rav1e"))
+ (common-flags '("-" "-o" "-" "advanced" "--completion")))
+ (mkdir-p bash-completions-dir)
+ (with-output-to-file
+ (string-append bash-completions-dir "/rav1e")
+ (lambda _ (apply invoke rav1e (append common-flags '("bash")))))
+ (mkdir-p zsh-completions-dir)
+ ;; This one currently fails to build.
+ ;(with-output-to-file
+ ; (string-append zsh-completions-dir "/_rav1e")
+ ; (lambda _ (apply invoke rav1e (append common-flags '("zsh")))))
+ (mkdir-p fish-completions-dir)
+ (with-output-to-file
+ (string-append fish-completions-dir "/rav1e.fish")
+ (lambda _ (apply invoke rav1e (append common-flags '("fish")))))
+ (mkdir-p elvish-completions-dir)
+ (with-output-to-file
+ (string-append elvish-completions-dir "/rav1e")
+ (lambda _
+ (apply invoke rav1e (append common-flags '("elvish"))))))))))))
(native-inputs
(append (if (target-x86?)
(list nasm)