From 66923e65baacc72401503af0b094962461bc32a4 Mon Sep 17 00:00:00 2001 From: Roger Wong Date: Thu, 20 Aug 2026 12:45:31 -0500 Subject: [PATCH] osxInstaller: add the build Qt's lib dir to fixup_bundle search dirs fixup_bundle resolves the @rpath/Qt*.framework references carried by the Qt platform and style plugins through the rpaths of the walked binaries plus its DIRS argument. The rpaths come from CMAKE_INSTALL_RPATH_USE_LINK_PATH (set in admMainChecks.cmake for exactly this purpose) and are fragile: with a LIBRARY_PATH environment variable set, CMake classifies the Homebrew lib dir as an implicit linker directory and silently omits it from every install rpath, after which packaging fails with otool -l failed: 1 error: otool-classic: can't open file: @rpath/QtCore.framework/Versions/A/QtCore (No such file or directory) The DIRS argument so far only carries /usr/local/lib, which does not exist on a default Apple Silicon install. Append the lib directory of the Qt actually used for the build, derived from Qt6_DIR -- correct for Homebrew on arm64 (/opt/homebrew/lib) and Intel (/usr/local/lib) prefixes and for custom MYQT installations alike -- so packaging no longer depends on which rpaths survive into the installed binaries. Co-Authored-By: Claude Fable 5 --- avidemux/osxInstaller/CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/avidemux/osxInstaller/CMakeLists.txt b/avidemux/osxInstaller/CMakeLists.txt index d071c68a03..9bb499977e 100644 --- a/avidemux/osxInstaller/CMakeLists.txt +++ b/avidemux/osxInstaller/CMakeLists.txt @@ -51,6 +51,16 @@ LIST(APPEND bundleDirs "${BUNDLE}/Contents/Resources/lib") IF(ENABLE_QT6) # A gross hack to work around the failure to resolve @loader_path for libbrotli. LIST(APPEND bundleDirs "/usr/local/lib") + # Let fixup_bundle resolve the @rpath/Qt*.framework references carried by the + # Qt platform and style plugins against the Qt actually used for this build + # (Homebrew on arm64 or Intel, or a custom MYQT installation alike). Whether + # the app binaries otherwise carry a usable rpath for this depends on the + # install-rpath machinery, which e.g. a LIBRARY_PATH environment variable + # silently disables. + IF(Qt6_DIR) + get_filename_component(ADM_QT_LIB_DIR "${Qt6_DIR}/../.." ABSOLUTE) + LIST(APPEND bundleDirs "${ADM_QT_LIB_DIR}") + ENDIF() ENDIF() #