guix_mirror_bot pushed a commit to branch master
in repository guix.

commit bc40d85820fd1807258d61b79f52820ec85ea733
Author: Efraim Flashner <[email protected]>
AuthorDate: Tue Feb 10 16:05:35 2026 +0200

    gnu: codeberg-cli: Update shell completion phase.
    
    * gnu/packages/rust-apps.scm (codeberg-cli)[arguments]: Replace the
    'install-extras phase with a more succinct 'install-completions phase.
    
    Change-Id: I6a2c32db7530a581b0c370f537f10e9c16c983c2
---
 gnu/packages/rust-apps.scm | 53 ++++++++++++++++++----------------------------
 1 file changed, 21 insertions(+), 32 deletions(-)

diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm
index f53b509b2a..79a516746c 100644
--- a/gnu/packages/rust-apps.scm
+++ b/gnu/packages/rust-apps.scm
@@ -675,40 +675,29 @@ through tools like `gdb`.")
     (arguments
      (list
        #:install-source? #f
+       #:modules
+       '((guix build cargo-build-system)
+         (guix build utils)
+         (ice-9 match))
        #:phases
        #~(modify-phases %standard-phases
-           (add-after 'install 'install-extras
-             (lambda* (#:key native-inputs outputs #:allow-other-keys)
-               (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"))
-                      (berg (if #$(%current-target-system)
-                                (search-input-file native-inputs "/bin/berg")
-                                (string-append out "/bin/berg"))))
-                 (for-each mkdir-p
-                           (list bash-completions-dir
-                                 zsh-completions-dir
-                                 fish-completions-dir
-                                 elvish-completions-dir))
-                 (with-output-to-file
-                   (string-append bash-completions-dir "/berg")
-                   (lambda _ (invoke berg "completion" "bash")))
-                 (with-output-to-file
-                   (string-append zsh-completions-dir "/_berg")
-                   (lambda _ (invoke berg "completion" "zsh")))
-                 (with-output-to-file
-                   (string-append fish-completions-dir "/berg.fish")
-                   (lambda _ (invoke berg "completion" "fish")))
-                 (with-output-to-file
-                   (string-append elvish-completions-dir "/berg")
-                   (lambda _ (invoke berg "completion" "elvish")))))))))
+           (add-after 'install 'install-completions
+            (lambda* (#:key native-inputs #:allow-other-keys)
+              (for-each
+               (match-lambda
+                 ((shell . path)
+                  (mkdir-p (in-vicinity #$output (dirname path)))
+                  (let ((binary
+                         (if #$(%current-target-system)
+                             (search-input-file native-inputs "bin/berg")
+                             (in-vicinity #$output "bin/berg"))))
+                    (with-output-to-file (in-vicinity #$output path)
+                      (lambda _
+                        (invoke binary "completion" shell))))))
+               '(("bash"   . "share/bash-completion/completions/berg")
+                 ("elvish" . "share/elvish/lib/berg")
+                 ("fish"   . "share/fish/vendor_completions.d/berg.fish")
+                 ("zsh"    . "share/zsh/site-functions/_berg"))))))))
     (native-inputs
      (append
        (if (%current-target-system)

Reply via email to