mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Dont exec a symlink in the codesign placeholders
Instead use the full path to the actual binary in the outermost bundle
This commit is contained in:
parent
935e7573ab
commit
f1ce7c0cf9
@ -646,6 +646,7 @@ class Freeze(object):
|
|||||||
base_dir = base_dir or self.contents_dir
|
base_dir = base_dir or self.contents_dir
|
||||||
cc_dir = join(base_dir, name, 'Contents')
|
cc_dir = join(base_dir, name, 'Contents')
|
||||||
exe_dir = join(cc_dir, 'MacOS')
|
exe_dir = join(cc_dir, 'MacOS')
|
||||||
|
rel_path = os.path.relpath(join(self.contents_dir, 'MacOS'), exe_dir)
|
||||||
os.makedirs(exe_dir)
|
os.makedirs(exe_dir)
|
||||||
for x in os.listdir(self.contents_dir):
|
for x in os.listdir(self.contents_dir):
|
||||||
if x.endswith('.app'):
|
if x.endswith('.app'):
|
||||||
@ -662,7 +663,10 @@ class Freeze(object):
|
|||||||
plist['CFBundleExecutable'] = exe + '-placeholder-for-codesigning'
|
plist['CFBundleExecutable'] = exe + '-placeholder-for-codesigning'
|
||||||
nexe = join(exe_dir, plist['CFBundleExecutable'])
|
nexe = join(exe_dir, plist['CFBundleExecutable'])
|
||||||
base = os.path.dirname(abspath(__file__))
|
base = os.path.dirname(abspath(__file__))
|
||||||
cmd = [gcc, '-Wall', '-Werror', '-DEXE_NAME="%s"' % exe, join(base, 'placeholder.c'), '-o', nexe, '-headerpad_max_install_names']
|
cmd = [
|
||||||
|
gcc, '-Wall', '-Werror', '-DEXE_NAME="%s"' % exe, '-DREL_PATH="%s"' % rel_path,
|
||||||
|
join(base, 'placeholder.c'), '-o', nexe, '-headerpad_max_install_names'
|
||||||
|
]
|
||||||
subprocess.check_call(cmd)
|
subprocess.check_call(cmd)
|
||||||
with open(join(cc_dir, x), 'wb') as p:
|
with open(join(cc_dir, x), 'wb') as p:
|
||||||
plistlib.dump(plist, p)
|
plistlib.dump(plist, p)
|
||||||
|
@ -36,6 +36,6 @@ main(int argc, char * const *argv, const char **envp) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
*(t + 1) = 0;
|
*(t + 1) = 0;
|
||||||
snprintf(t + 1, sizeof(realpath_buf) - strlen(path), "%s", EXE_NAME);
|
snprintf(t + 1, sizeof(realpath_buf) - strlen(path), "%s/%s", REL_PATH, EXE_NAME);
|
||||||
execv(path, argv);
|
execv(path, argv);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user