From fda004071e7aa497f17c39d9984fccfecafcb3c9 Mon Sep 17 00:00:00 2001 From: Alex James Date: Sat, 9 Nov 2024 14:41:08 -0600 Subject: [PATCH] osxbundle: fix Vulkan dylib install name MoltenVK from Homebrew hardcodes the install name of libMoltenVK.dylib to point to the Homebrew prefix: $ otool -l mpv.app/Contents/Frameworks/libMoltenVK.dylib | grep -A2 LC_ID_DYLIB cmd LC_ID_DYLIB cmdsize 72 name /usr/local/opt/molten-vk/lib/libMoltenVK.dylib (offset 24) Update dylib_unhell to update the install name in libMoltenVK.dylib to avoid depending on the Homebrew prefix. --- TOOLS/dylib_unhell.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TOOLS/dylib_unhell.py b/TOOLS/dylib_unhell.py index cecef2a5f3758..ac97ad979f566 100755 --- a/TOOLS/dylib_unhell.py +++ b/TOOLS/dylib_unhell.py @@ -273,6 +273,8 @@ def process_vulkan_loader(binary, loader_name, loader_relative_folder, library_n os.makedirs(framework_bundle_folder) library_target_path = os.path.join(framework_bundle_folder, loader_library_name) shutil.copy(library_system_path, library_target_path) + library_install_name = os.path.join("@rpath", loader_library_name) + install_name_tool_id(library_install_name, library_target_path) def remove_dev_tools_rapths(binary): for path in get_rpaths_dev_tools(binary):