From 21b572d69aaa28fcec7c916d689edbc5aba504ef Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 15 Sep 2022 13:54:22 +0530 Subject: [PATCH] Allow building kitty-tool as a static binary --- setup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 124414ca0..9d543803c 100755 --- a/setup.py +++ b/setup.py @@ -887,7 +887,7 @@ def update_go_generated_files(args: Options, kitty_exe: str) -> None: raise SystemExit(cp.returncode) -def build_kitty_tool(args: Options, launcher_dir: str, for_freeze: bool = False) -> str: +def build_kitty_tool(args: Options, launcher_dir: str, for_freeze: bool = False, build_static: bool = False) -> str: sys.stdout.flush() sys.stderr.flush() go = shutil.which('go') @@ -911,6 +911,8 @@ def build_kitty_tool(args: Options, launcher_dir: str, for_freeze: bool = False) print(shlex.join(c)) e = os.environ.copy() e.update(env) + if build_static: + e['CGO_ENABLED'] = '0' cp = subprocess.run(c, env=e) if cp.returncode != 0: raise SystemExit(cp.returncode)