Include all terminfo variants in binary bundles
Needed so that they can be transmitted over ssh easily
This commit is contained in:
parent
22c1ee7dc8
commit
6b681df473
@ -11,7 +11,7 @@ import sys
|
||||
import tempfile
|
||||
|
||||
|
||||
def compile_terminfo(base):
|
||||
def compile_terminfo(base, add_other_versions=False):
|
||||
with tempfile.TemporaryDirectory() as tdir:
|
||||
proc = subprocess.run(['tic', '-x', f'-o{tdir}', 'terminfo/kitty.terminfo'], check=True, stderr=subprocess.PIPE)
|
||||
regex = '^"terminfo/kitty.terminfo", line [0-9]+, col [0-9]+, terminal \'xterm-kitty\': older tic versions may treat the description field as an alias$'
|
||||
@ -29,6 +29,13 @@ def compile_terminfo(base):
|
||||
os.makedirs(odir, exist_ok=True)
|
||||
ofile = os.path.join(odir, xterm_kitty)
|
||||
shutil.move(tfile, ofile)
|
||||
if add_other_versions:
|
||||
shutil.copy2('terminfo/kitty.terminfo', base)
|
||||
for x in os.listdir('terminfo'):
|
||||
if x == 'kitty.terminfo':
|
||||
continue
|
||||
if not os.path.exists(os.path.join(base, x)):
|
||||
os.symlink(directory, os.path.join(base, x))
|
||||
|
||||
|
||||
def generate_terminfo():
|
||||
|
||||
2
setup.py
2
setup.py
@ -1256,7 +1256,7 @@ def package(args: Options, bundle_type: str) -> None:
|
||||
for x in (libdir, os.path.join(ddir, 'share')):
|
||||
odir = os.path.join(x, 'terminfo')
|
||||
safe_makedirs(odir)
|
||||
build_terminfo['compile_terminfo'](odir)
|
||||
build_terminfo['compile_terminfo'](odir, add_other_versions=True)
|
||||
shutil.copy2('__main__.py', libdir)
|
||||
shutil.copy2('logo/kitty-128.png', os.path.join(libdir, 'logo'))
|
||||
shutil.copy2('logo/kitty.png', os.path.join(libdir, 'logo'))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user