osxbundle: use dylib script directly instead of in a subprocess

before errors and outputs where ignored from the subscript and the main
script didn't fail nor did it output anything.

with this change the script properly outputs everything to stdout and
stderr. in the case the dylib script fails the whole script fails now.

the main function in dylib_unhell was kept since it can still be used
individually without the oscbundle script. the script had to be renamed
with an underscore to make it importable.
This commit is contained in:
der richter 2024-02-22 19:38:46 +01:00
parent 00f1743ae2
commit 56b1078bfd
2 changed files with 5 additions and 4 deletions

View File

@ -236,8 +236,8 @@ def remove_dev_tools_rapths(binary):
for path in get_rpaths_dev_tools(binary):
install_name_tool_delete_rpath(path, binary)
def main():
binary = os.path.abspath(sys.argv[1])
def process(binary):
binary = os.path.abspath(binary)
if not os.path.exists(lib_path(binary)):
os.makedirs(lib_path(binary))
print(">> gathering all linked libraries")
@ -258,4 +258,4 @@ def main():
process_vulkan_loader(binary, "VkLayer_khronos_synchronization2.json", "vulkan/explicit_layer.d", "layer")
if __name__ == "__main__":
main()
process(sys.argv[1])

View File

@ -3,6 +3,7 @@ import os
import shutil
import sys
import fileinput
import dylib_unhell
from optparse import OptionParser
def sh(command):
@ -77,7 +78,7 @@ def main():
if options.deps:
print("> bundling dependencies")
print(sh(" ".join([os.path.join(src_path, "TOOLS/dylib-unhell.py"), target_binary(binary_name)])))
dylib_unhell.process(target_binary(binary_name))
print("> signing bundle with ad-hoc pseudo identity")
sign_bundle(binary_name)