Allow the name of the lib directory in linux-package to be configurable. Fixes #372

This commit is contained in:
Kovid Goyal 2018-03-12 08:10:53 +05:30
parent ffc717717c
commit 2bf8e1b1a3
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 10 additions and 2 deletions

View File

@ -94,7 +94,7 @@ int main(int argc, char *argv[]) {
#ifdef FOR_LAUNCHER
num = snprintf(lib, PATH_MAX, "%s%s", exe_dir, "/../Frameworks/kitty");
#else
num = snprintf(lib, PATH_MAX, "%s%s", exe_dir, "/../lib/kitty");
num = snprintf(lib, PATH_MAX, "%s%s%s%s", exe_dir, "/../", LIB_DIR_NAME, "/kitty");
#endif
#endif

View File

@ -485,6 +485,7 @@ def build_linux_launcher(args, launcher_dir='.', for_bundle=False, sh_launcher=F
cflags.append('-DPYVER="{}"'.format(sysconfig.get_python_version()))
elif sh_launcher:
cflags.append('-DFOR_LAUNCHER')
cflags.append('-DLIB_DIR_NAME="{}"'.format(args.libdir_name.strip('/')))
pylib = get_python_flags(cflags)
exe = 'kitty-profile' if args.profile else 'kitty'
cflags += shlex.split(os.environ.get('CFLAGS', ''))
@ -498,7 +499,9 @@ def build_linux_launcher(args, launcher_dir='.', for_bundle=False, sh_launcher=F
def package(args, for_bundle=False, sh_launcher=False): # {{{
ddir = args.prefix
libdir = os.path.join(ddir, 'lib', 'kitty')
if for_bundle or sh_launcher:
args.libdir_name = 'lib'
libdir = os.path.join(ddir, args.libdir_name.strip('/'), 'kitty')
if os.path.exists(libdir):
shutil.rmtree(libdir)
os.makedirs(os.path.join(libdir, 'logo'))
@ -676,6 +679,11 @@ def option_parser():
action='store_true',
help='Use the -pg compile flag to add profiling information'
)
p.add_argument(
'--libdir-name',
default='lib',
help='The name of the directory inside --prefix in which to store compiled files'
)
return p