summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Stephens <adam@valkor.net>2023-02-01 23:23:45 -0500
committerzowoq <59103226+zowoq@users.noreply.github.com>2023-02-05 07:46:27 +1000
commitc611a3428ab752b2ba4365005f1822301136efb6 (patch)
treef1c33c8290dbd18208394cf36e4993c0cf4e0a0f
parent9032311f3cb237277ef4418e1012814f34ff3b6d (diff)
kitty: build kitten statically and expose as output
-rw-r--r--pkgs/applications/terminal-emulators/kitty/default.nix10
1 files changed, 9 insertions, 1 deletions
diff --git a/pkgs/applications/terminal-emulators/kitty/default.nix b/pkgs/applications/terminal-emulators/kitty/default.nix
index 360ba038989a..f2c146fa8db2 100644
--- a/pkgs/applications/terminal-emulators/kitty/default.nix
+++ b/pkgs/applications/terminal-emulators/kitty/default.nix
@@ -76,7 +76,7 @@ buildPythonApplication rec {
libicns # For the png2icns tool.
];
- outputs = [ "out" "terminfo" "shell_integration" ];
+ outputs = [ "out" "terminfo" "shell_integration" "kitten" ];
patches = [
# Gets `test_ssh_env_vars` to pass when `bzip2` is in the output of `env`.
@@ -96,6 +96,10 @@ buildPythonApplication rec {
# Causes build failure due to warning
hardeningDisable = lib.optional stdenv.cc.isClang "strictoverflow";
+ CGO_ENABLED = 0;
+ GO_FLAGS = "-trimpath";
+ disallowedReferences = [ go ];
+
configurePhase = let
goModules = (buildGoModule {
pname = "kitty-go-modules";
@@ -176,15 +180,19 @@ buildPythonApplication rec {
installPhase = ''
runHook preInstall
mkdir -p $out
+ mkdir -p $kitten/bin
${if stdenv.isDarwin then ''
mkdir "$out/bin"
ln -s ../Applications/kitty.app/Contents/MacOS/kitty "$out/bin/kitty"
+ ln -s ../Applications/kitty.app/Contents/MacOS/kitten "$out/bin/kitten"
+ cp ./kitty.app/Contents/MacOS/kitten "$kitten/bin/kitten"
mkdir "$out/Applications"
cp -r kitty.app "$out/Applications/kitty.app"
installManPage 'docs/_build/man/kitty.1'
'' else ''
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 ]}"