mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-26 18:22:09 +02:00
Use an absolute path to python code for develop builds on macOS
This commit is contained in:
@@ -371,7 +371,11 @@ int main(int argc, char *argv[], char* envp[]) {
|
|||||||
delegate_to_kitten_if_possible(argc, argv, exe_dir);
|
delegate_to_kitten_if_possible(argc, argv, exe_dir);
|
||||||
int num, ret=0;
|
int num, ret=0;
|
||||||
char lib[PATH_MAX+1] = {0};
|
char lib[PATH_MAX+1] = {0};
|
||||||
num = snprintf(lib, PATH_MAX, "%s/%s", exe_dir, KITTY_LIB_PATH);
|
if (KITTY_LIB_PATH[0] == '/') {
|
||||||
|
num = snprintf(lib, PATH_MAX, "%s", KITTY_LIB_PATH);
|
||||||
|
} else {
|
||||||
|
num = snprintf(lib, PATH_MAX, "%s/%s", exe_dir, KITTY_LIB_PATH);
|
||||||
|
}
|
||||||
|
|
||||||
if (num < 0 || num >= PATH_MAX) { fprintf(stderr, "Failed to create path to kitty lib\n"); return 1; }
|
if (num < 0 || num >= PATH_MAX) { fprintf(stderr, "Failed to create path to kitty lib\n"); return 1; }
|
||||||
RunData run_data = {.exe = exe, .exe_dir = exe_dir, .lib_dir = lib, .argc = argc, .argv = argv, .lc_ctype = lc_ctype};
|
RunData run_data = {.exe = exe, .exe_dir = exe_dir, .lib_dir = lib, .argc = argc, .argv = argv, .lc_ctype = lc_ctype};
|
||||||
|
|||||||
4
setup.py
4
setup.py
@@ -1073,7 +1073,9 @@ def build_launcher(args: Options, launcher_dir: str = '.', bundle_type: str = 's
|
|||||||
ph = os.path.relpath(os.environ["DEVELOP_ROOT"], '.')
|
ph = os.path.relpath(os.environ["DEVELOP_ROOT"], '.')
|
||||||
cppflags.append(f'-DSET_PYTHON_HOME="{ph}"')
|
cppflags.append(f'-DSET_PYTHON_HOME="{ph}"')
|
||||||
if is_macos:
|
if is_macos:
|
||||||
pass
|
# use an absolute path so the exe is relocatable to the minimal
|
||||||
|
# bundle
|
||||||
|
klp = src_base
|
||||||
else:
|
else:
|
||||||
ldflags += ['-Wl,--disable-new-dtags', f'-Wl,-rpath,$ORIGIN/../../{ph}/lib']
|
ldflags += ['-Wl,--disable-new-dtags', f'-Wl,-rpath,$ORIGIN/../../{ph}/lib']
|
||||||
if bundle_type.startswith('macos-'):
|
if bundle_type.startswith('macos-'):
|
||||||
|
|||||||
Reference in New Issue
Block a user