Fix terminfo file not being used on OS X
On OS X tic has a different directory layout than on linux. Sigh.
This commit is contained in:
parent
49ea4f736d
commit
3cbb0b22dc
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
import shutil
|
||||||
|
import subprocess
|
||||||
|
|
||||||
base = os.path.dirname(os.path.abspath(__file__))
|
base = os.path.dirname(os.path.abspath(__file__))
|
||||||
os.chdir(base)
|
os.chdir(base)
|
||||||
@ -13,4 +15,10 @@ with open('terminfo/kitty.terminfo', 'w') as f:
|
|||||||
f.write(generate_terminfo())
|
f.write(generate_terminfo())
|
||||||
|
|
||||||
os.environ['TERMINFO'] = os.path.join(base, 'terminfo')
|
os.environ['TERMINFO'] = os.path.join(base, 'terminfo')
|
||||||
os.execvp('tic', 'tic terminfo/kitty.terminfo'.split())
|
subprocess.check_call(['tic', 'terminfo/kitty.terminfo'])
|
||||||
|
# On OS X tic puts the compiled database into a different directory
|
||||||
|
try:
|
||||||
|
os.mkdir('terminfo/78')
|
||||||
|
except FileExistsError:
|
||||||
|
pass
|
||||||
|
shutil.copy2('terminfo/x/xterm-kitty', 'terminfo/78')
|
||||||
|
|||||||
7
setup.py
7
setup.py
@ -217,15 +217,16 @@ def safe_makedirs(path):
|
|||||||
def package(args): # {{{
|
def package(args): # {{{
|
||||||
ddir = args.prefix
|
ddir = args.prefix
|
||||||
libdir = os.path.join(ddir, 'lib', 'kitty')
|
libdir = os.path.join(ddir, 'lib', 'kitty')
|
||||||
terminfo_dir = os.path.join(ddir, 'share/terminfo/x')
|
terminfo_sdir = ('78' if isosx else 'x')
|
||||||
|
terminfo_dir = os.path.join(ddir, 'share/terminfo/' + terminfo_sdir)
|
||||||
if os.path.exists(libdir):
|
if os.path.exists(libdir):
|
||||||
shutil.rmtree(libdir)
|
shutil.rmtree(libdir)
|
||||||
os.makedirs(os.path.join(libdir, 'terminfo/x'))
|
os.makedirs(os.path.join(libdir, 'terminfo/' + terminfo_sdir))
|
||||||
os.makedirs(os.path.join(libdir, 'logo'))
|
os.makedirs(os.path.join(libdir, 'logo'))
|
||||||
safe_makedirs(terminfo_dir)
|
safe_makedirs(terminfo_dir)
|
||||||
shutil.copy2('__main__.py', libdir)
|
shutil.copy2('__main__.py', libdir)
|
||||||
shutil.copy2('terminfo/x/xterm-kitty', terminfo_dir)
|
shutil.copy2('terminfo/x/xterm-kitty', terminfo_dir)
|
||||||
shutil.copy2('terminfo/x/xterm-kitty', os.path.join(libdir, 'terminfo/x'))
|
shutil.copy2('terminfo/x/xterm-kitty', os.path.join(libdir, 'terminfo/' + terminfo_sdir))
|
||||||
shutil.copy2('logo/kitty.rgba', os.path.join(libdir, 'logo'))
|
shutil.copy2('logo/kitty.rgba', os.path.join(libdir, 'logo'))
|
||||||
|
|
||||||
def src_ignore(parent, entries):
|
def src_ignore(parent, entries):
|
||||||
|
|||||||
BIN
terminfo/78/xterm-kitty
Normal file
BIN
terminfo/78/xterm-kitty
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user