Subject: [PATCH v2] gnu: mpd-mpc: Install bash completions in correct location.

From: Liliana Marie Prikler <[email-masked]>
Date: Fri, 29 Sep 2023 20:45:33 +0200

* gnu/packages/mpd.scm (mpd-mpc)[#:phases]: Add ‘move-completion’.
---
Ignore v1, this one is actually correct ._.

 gnu/packages/mpd.scm | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/mpd.scm b/gnu/packages/mpd.scm
index d617dc014b..8ce9eb4228 100644
--- a/gnu/packages/mpd.scm
+++ b/gnu/packages/mpd.scm
@@ -246,7 +246,16 @@ (define-public mpd-mpc
                  ;; actually invoked.
                  (lambda _
                    (substitute* "doc/meson.build"
-                     (("rsync") "ls")))))))
+                     (("rsync") "ls"))))
+               (add-after 'install 'move-completion
+                 (lambda* (#:key outputs #:allow-other-keys)
+                   (let* ((out (assoc-ref outputs "out"))
+                          (contrib (string-append out "/share/doc/mpc/contrib"))
+                          (completion
+                           (string-append out "/etc/bash-completion.d/")))
+                     (mkdir-p completion)
+                     (rename-file (string-append contrib "/mpc-completion.bash")
+                                  (string-append completion "/mpc"))))))))
     (inputs (list libmpdclient))
     (native-inputs
      (list pkg-config python-sphinx))

base-commit: ce0cc6137df81919389f61671096a6ce701c0889
-- 
2.41.0