kitty: copy shell integration files into separate output

https://sw.kovidgoyal.net/kitty/build/#notes-for-linux-macos-packagers recommends to split kitty into three packages with kitty-shell-integration being the one that includes some files useful for the shell integration. We already use kitty.terminfo in Nixpkgs instead of kitty-terminfo but we can't use kitty.shell-integration instead of kitty-shell-integration because shell-integration is not a valid shell variable name. I named it kitty.shell_integration instead. This package can then be used by a future kitty nixos module that still needs to be created. Without this commit, kitty would modify the user's ~/.bashrc when using bash.
This commit is contained in:
Luflosi 2022-01-07 18:43:31 +01:00
parent 3bb443d5d9
commit aa1932ea7a
No known key found for this signature in database
GPG key ID: 4E41E29EDCC345D0

View file

@ -69,26 +69,31 @@ buildPythonApplication rec {
propagatedBuildInputs = lib.optional stdenv.isLinux libGL;
outputs = [ "out" "terminfo" ];
outputs = [ "out" "terminfo" "shell_integration" ];
# Causes build failure due to warning
hardeningDisable = lib.optional stdenv.cc.isClang "strictoverflow";
dontConfigure = true;
buildPhase = ''
buildPhase = let
commonOptions = ''
--update-check-interval=0 \
--shell-integration=enabled\ no-rc
'';
in ''
runHook preBuild
${if stdenv.isDarwin then ''
${python.interpreter} setup.py kitty.app \
--update-check-interval=0 \
--disable-link-time-optimization
--disable-link-time-optimization \
${commonOptions}
make man
'' else ''
${python.interpreter} setup.py linux-package \
--update-check-interval=0 \
--egl-library='${lib.getLib libGL}/lib/libEGL.so.1' \
--startup-notification-library='${libstartup_notification}/lib/libstartup-notification-1.so' \
--canberra-library='${libcanberra}/lib/libcanberra.so'
--canberra-library='${libcanberra}/lib/libcanberra.so' \
${commonOptions}
''}
runHook postBuild
'';
@ -139,6 +144,8 @@ buildPythonApplication rec {
mkdir -p $out/nix-support
echo "$terminfo" >> $out/nix-support/propagated-user-env-packages
cp -r 'shell-integration' "$shell_integration"
runHook postInstall
'';