[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/07: gnu: rust-bindgen-cli: Add shell completions.
From: |
guix-commits |
Subject: |
02/07: gnu: rust-bindgen-cli: Add shell completions. |
Date: |
Tue, 12 Mar 2024 07:51:46 -0400 (EDT) |
efraim pushed a commit to branch master
in repository guix.
commit 62d8b14e325880bb68fbc7dd69452c6cace1149f
Author: Efraim Flashner <efraim@flashner.co.il>
AuthorDate: Tue Mar 12 10:01:46 2024 +0200
gnu: rust-bindgen-cli: Add shell completions.
* gnu/packages/rust-apps.scm (rust-bindgen-cli)[arguments]: Add a phase
to install shell completions.
Change-Id: Ia476d02a7c2d75518da2624b09b7091fafb70d8d
---
gnu/packages/rust-apps.scm | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm
index 8785659777..d73bd1a030 100644
--- a/gnu/packages/rust-apps.scm
+++ b/gnu/packages/rust-apps.scm
@@ -1873,7 +1873,29 @@ rebase.")
(assoc-ref inputs "clang") "/lib")))
(install-file "target/release/bindgen" bin)
(wrap-program bindgen
- `("LIBCLANG_PATH" = (,llvm-dir)))))))))
+ `("LIBCLANG_PATH" = (,llvm-dir))))))
+ (add-after 'install 'install-completions
+ (lambda* (#:key native-inputs outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (share (string-append out "/share"))
+ (bindgen (string-append out "/bin/bindgen")))
+ (mkdir-p (string-append share "/bash-completion/completions"))
+ (with-output-to-file
+ (string-append share "/bash-completion/completions/bindgen")
+ (lambda _ (invoke bindgen "--generate-shell-completions"
"bash")))
+ (mkdir-p (string-append share "/fish/vendor_completions.d"))
+ (with-output-to-file
+ (string-append share
"/fish/vendor_completions.d/bindgen.fish")
+ (lambda _ (invoke bindgen "--generate-shell-completions"
"fish")))
+ (mkdir-p (string-append share "/zsh/site-functions"))
+ (with-output-to-file
+ (string-append share "/zsh/site-functions/_bindgen")
+ (lambda _ (invoke bindgen "--generate-shell-completions"
"zsh")))
+ (mkdir-p (string-append share "/elvish/lib"))
+ (with-output-to-file
+ (string-append share "/elvish/lib/bindgen")
+ (lambda _
+ (invoke bindgen "--generate-shell-completions"
"elvish")))))))))
(inputs (list bash-minimal clang))
(home-page "https://rust-lang.github.io/rust-bindgen/")
(synopsis "Generate Rust FFI bindings to C and C++ libraries")
- branch master updated (a52701a4d3 -> fc1762fe38), guix-commits, 2024/03/12
- 02/07: gnu: rust-bindgen-cli: Add shell completions.,
guix-commits <=
- 06/07: gnu: ssh-to-age: Update to 1.1.7., guix-commits, 2024/03/12
- 03/07: gnu: syncthing: Mark as tunable., guix-commits, 2024/03/12
- 05/07: gnu: hypre: Honor the #:tests? flag., guix-commits, 2024/03/12
- 01/07: gnu: Add rust-bindgen-cli-0.69., guix-commits, 2024/03/12
- 04/07: gnu: petsc: Add tunable property., guix-commits, 2024/03/12
- 07/07: gnu: ruby-x25519: Fix build on non x86_64., guix-commits, 2024/03/12