[bug#77181,v2,6/6] gnu: starship: Fix shell completion directories.

Message ID 4f04fc067b4ce22ceb22154d89fcf1c58f8931dd.1743065002.git.efraim@flashner.co.il
State New
Headers
Series Fix shell completion directories |

Commit Message

Efraim Flashner March 27, 2025, 8:46 a.m. UTC
  From: 45mg <45mg.writes@gmail.com>

* gnu/packages/shellutils.scm (starship) [arguments]: Use the shell
completion directory variables.

Change-Id: Ie286218d636a56745013ebdb23461691fdf16d11
---
 gnu/packages/shellutils.scm | 27 +++++++++------------------
 1 file changed, 9 insertions(+), 18 deletions(-)
  

Patch

diff --git a/gnu/packages/shellutils.scm b/gnu/packages/shellutils.scm
index 28c8af8685a..c7723cb2e04 100644
--- a/gnu/packages/shellutils.scm
+++ b/gnu/packages/shellutils.scm
@@ -496,33 +496,24 @@  (define-public starship
                      (starship-bin
                        (if #$(%current-target-system)
                            (search-input-file native-inputs "/bin/starship")
-                           (string-append out "/bin/starship")))
-                     (share (string-append out "/share"))
-                     (bash-completion-dir
-                       (string-append out "/etc/bash-completion.d/"))
-                     (zsh-completion-dir
-                       (string-append share "/zsh/site-functions/"))
-                     (fish-completion-dir
-                       (string-append share "/fish/vendor_completions.d/"))
-                     (elvish-completion-dir
-                       (string-append share "/elvish/lib")))
+                           (string-append out "/bin/starship"))))
                     ;; Make the directories
-                  (mkdir-p bash-completion-dir)
-                  (mkdir-p zsh-completion-dir)
-                  (mkdir-p fish-completion-dir)
-                  (mkdir-p elvish-completion-dir)
+                  (mkdir-p (string-append out #$bash-completion-dir))
+                  (mkdir-p (string-append out #$zsh-completion-dir))
+                  (mkdir-p (string-append out #$fish-completion-dir))
+                  (mkdir-p (string-append out #$elvish-completion-dir))
                   ;; Use the built starship to generate the completions.
                   (with-output-to-file
-                    (string-append bash-completion-dir "/starship")
+                    (string-append out #$bash-completion-dir "/starship")
                     (lambda _ (invoke starship-bin "completions" "bash")))
                   (with-output-to-file
-                    (string-append zsh-completion-dir "/_starship")
+                    (string-append out #$zsh-completion-dir "/_starship")
                     (lambda _(invoke starship-bin "completions" "zsh")))
                   (with-output-to-file
-                    (string-append fish-completion-dir "/starship.fish")
+                    (string-append out #$fish-completion-dir "/starship.fish")
                     (lambda _ (invoke starship-bin "completions" "fish")))
                   (with-output-to-file
-                    (string-append elvish-completion-dir "/starship")
+                    (string-append out #$elvish-completion-dir "/starship")
                     (lambda _ (invoke starship-bin "completions" "elvish"))))))
           ;; Some tests require a writable home directory
           (add-after 'unpack 'patch-test-shell