about summary refs log tree commit diff
path: root/pkgs/applications/misc/zathura
diff options
context:
space:
mode:
authorsternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org>2021-01-04 19:32:18 +0100
committerProfpatsch <mail@profpatsch.de>2021-01-05 06:48:51 +0100
commit9a27606ab1781a01a75f7c2d519fd6ee2b4b867c (patch)
tree37fd2fee5e6a9309fb83949afd9119eca74d8ad3 /pkgs/applications/misc/zathura
parent178ec8974ff70ef0acffa4cc8f47f3234898ff3d (diff)
zathura: fix fish completions
The fish completion checks the plugin directory for supported file types
to complete. However the plugin dir checked was the one of the
zathura_core derivation which of course has no plugin dir. We now patch
up the referenced path in the wrapper derivation.
Diffstat (limited to 'pkgs/applications/misc/zathura')
-rw-r--r--pkgs/applications/misc/zathura/wrapper.nix11
1 files changed, 10 insertions, 1 deletions
diff --git a/pkgs/applications/misc/zathura/wrapper.nix b/pkgs/applications/misc/zathura/wrapper.nix
index 7cd52e0c74f10..60e3bb9fd535d 100644
--- a/pkgs/applications/misc/zathura/wrapper.nix
+++ b/pkgs/applications/misc/zathura/wrapper.nix
@@ -7,10 +7,19 @@ symlinkJoin {
 
   buildInputs = [ makeWrapper ];
 
-  postBuild = ''
+  postBuild = let
+    fishCompletion = "share/fish/vendor_completions.d/zathura.fish";
+  in ''
     makeWrapper ${zathura_core.bin}/bin/zathura $out/bin/zathura \
       --prefix PATH ":" "${lib.makeBinPath [ file ]}" \
       --add-flags --plugins-dir="$out/lib/zathura"
+
+    # zathura fish completion references the zathura_core derivation to
+    # check for supported plugins which live in the wrapper derivation,
+    # so we need to fix the path to reference $out instead.
+    rm "$out/${fishCompletion}"
+    substitute "${zathura_core.out}/${fishCompletion}" "$out/${fishCompletion}" \
+      --replace "${zathura_core.out}" "$out"
   '';
 
   meta = with lib; {