|
Lines 876-890
def package(args, bundle_type):
Link Here
|
| 876 |
libdir = os.path.join(ddir, args.libdir_name.strip('/'), 'kitty') |
876 |
libdir = os.path.join(ddir, args.libdir_name.strip('/'), 'kitty') |
| 877 |
if os.path.exists(libdir): |
877 |
if os.path.exists(libdir): |
| 878 |
shutil.rmtree(libdir) |
878 |
shutil.rmtree(libdir) |
| 879 |
launcher_dir = os.path.join(ddir, 'bin') |
|
|
| 880 |
safe_makedirs(launcher_dir) |
| 881 |
build_launcher(args, launcher_dir, bundle_type) |
| 882 |
os.makedirs(os.path.join(libdir, 'logo')) |
| 883 |
build_terminfo = runpy.run_path('build-terminfo', run_name='import_build') |
879 |
build_terminfo = runpy.run_path('build-terminfo', run_name='import_build') |
| 884 |
for x in (libdir, os.path.join(ddir, 'share')): |
880 |
for x in (libdir, os.path.join(ddir, 'share')): |
| 885 |
odir = os.path.join(x, 'terminfo') |
881 |
odir = os.path.join(x, 'terminfo') |
| 886 |
safe_makedirs(odir) |
882 |
safe_makedirs(odir) |
| 887 |
build_terminfo['compile_terminfo'](odir) |
883 |
build_terminfo['compile_terminfo'](odir) |
|
|
884 |
if bundle_type == 'linux-terminfo': |
| 885 |
return |
| 886 |
launcher_dir = os.path.join(ddir, 'bin') |
| 887 |
safe_makedirs(launcher_dir) |
| 888 |
build_launcher(args, launcher_dir, bundle_type) |
| 889 |
os.makedirs(os.path.join(libdir, 'logo')) |
| 888 |
shutil.copy2('__main__.py', libdir) |
890 |
shutil.copy2('__main__.py', libdir) |
| 889 |
shutil.copy2('logo/kitty.rgba', os.path.join(libdir, 'logo')) |
891 |
shutil.copy2('logo/kitty.rgba', os.path.join(libdir, 'logo')) |
| 890 |
shutil.copy2('logo/kitty.png', os.path.join(libdir, 'logo')) |
892 |
shutil.copy2('logo/kitty.png', os.path.join(libdir, 'logo')) |
|
Lines 932-938
def clean():
Link Here
|
| 932 |
|
934 |
|
| 933 |
safe_remove( |
935 |
safe_remove( |
| 934 |
'build', 'compile_commands.json', 'link_commands.json', |
936 |
'build', 'compile_commands.json', 'link_commands.json', |
| 935 |
'linux-package', 'kitty.app', 'asan-launcher', |
937 |
'linux-package', 'linux-terminfo', 'kitty.app', 'asan-launcher', |
| 936 |
'kitty-profile', 'kitty/launcher') |
938 |
'kitty-profile', 'kitty/launcher') |
| 937 |
exclude = ('.git',) |
939 |
exclude = ('.git',) |
| 938 |
for root, dirs, files in os.walk('.', topdown=True): |
940 |
for root, dirs, files in os.walk('.', topdown=True): |
|
Lines 955-961
def option_parser(): # {{{
Link Here
|
| 955 |
'action', |
957 |
'action', |
| 956 |
nargs='?', |
958 |
nargs='?', |
| 957 |
default='build', |
959 |
default='build', |
| 958 |
choices='build test linux-package kitty.app linux-freeze macos-freeze clean'.split(), |
960 |
choices='build test linux-package linux-terminfo kitty.app linux-freeze macos-freeze clean'.split(), |
| 959 |
help='Action to perform (default is build)' |
961 |
help='Action to perform (default is build)' |
| 960 |
) |
962 |
) |
| 961 |
p.add_argument( |
963 |
p.add_argument( |
|
Lines 1052-1057
def main():
Link Here
|
| 1052 |
elif args.action == 'linux-package': |
1054 |
elif args.action == 'linux-package': |
| 1053 |
build(args, native_optimizations=False) |
1055 |
build(args, native_optimizations=False) |
| 1054 |
package(args, bundle_type='linux-package') |
1056 |
package(args, bundle_type='linux-package') |
|
|
1057 |
elif args.action == 'linux-terminfo': |
| 1058 |
package(args, bundle_type='linux-terminfo') |
| 1055 |
elif args.action == 'linux-freeze': |
1059 |
elif args.action == 'linux-freeze': |
| 1056 |
build(args, native_optimizations=False) |
1060 |
build(args, native_optimizations=False) |
| 1057 |
package(args, bundle_type='linux-freeze') |
1061 |
package(args, bundle_type='linux-freeze') |