kitty: wrap correct executable on macOS

This fixes the kitty wrapProgram step to wrap the
actual `kitty` executable, which on macOS is inside the App bundle. On
macOS, `$out/bin/kitty` is just a symlink, and wrapping this symlink
(instead of the executable in the App bundle) means that the wrapper is
not used when starting the application itself (and the wrapper is only
used when the `bin/kitty` executable is used, e.g. from terminal).
This commit is contained in:
Nicolas Mattia 2024-05-14 13:38:16 +02:00
parent a71aec5f3a
commit 0d540c419c

View File

@ -210,7 +210,10 @@ buildPythonApplication rec {
cp -r linux-package/{bin,share,lib} "$out"
cp linux-package/bin/kitten "$kitten/bin/kitten"
''}
wrapProgram "$out/bin/kitty" --prefix PATH : "$out/bin:${lib.makeBinPath [ imagemagick ncurses.dev ]}"
# dereference the `kitty` symlink to make sure the actual executable
# is wrapped on macOS as well (and not just the symlink)
wrapProgram $(realpath "$out/bin/kitty") --prefix PATH : "$out/bin:${lib.makeBinPath [ imagemagick ncurses.dev ]}"
installShellCompletion --cmd kitty \
--bash <("$out/bin/kitty" +complete setup bash) \