Skip to content

Commit 46522e3

Browse files
committed
Makefile [Mac] manual QtDBus copy workaround
Currently macdeployqt distributed with Qt 6 in Homebrew fails to deploy transitive dependency (QTDBus in this case). So as a workaround we hard-copy that for now. It may not be problem of Qt 6 itself but just the Homebrew distribution, see also [1]. [1]: XapaJIaMnu/translateLocally@a6a9f10
1 parent 84ba09f commit 46522e3

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Makefile.in

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ SYSTEM = @system@
5151

5252
GUI_EXE ?= @GUI_EXE@
5353
GUI_TARGET = @GUI_TARGET@
54+
QT_PATH = $(shell [ -n "$(QMAKE)" ] && python3 -c "import os; print(\
55+
os.path.realpath(os.path.dirname(os.path.realpath(\"$$(command -v \
56+
$(QMAKE))\")) + \"/..\"))")# realpath cmd is present in macOS 13
5457
ifeq (@REFLECTOR_REQ@,yes)
5558
REFLECTOR_TARGET ?= bin/hd-rum-transcode$(EXEEXT)
5659
endif
@@ -608,6 +611,25 @@ $(GUI_BUNDLE): $(BUNDLE) $(GUI_BUNDLE_DEP)
608611
mv -f $$n $$n-real; cp -f $(srcdir)/data/scripts/macos-wrapper $$n; \
609612
done; \
610613
fi
614+
615+
# TODO TOREMOVE: currently Qt6 (Homebrew) macdeployqt doesn't deploy QtDbus,
616+
# possibly because @rpath is used in QtDBus ref in QtGui
617+
if [ -d $(QT_PATH)/lib/QtDBus.framework ] && \
618+
[ ! -d $(GUI_BUNDLE)/Contents/Frameworks/QtDBus.framework ] && \
619+
`otool -L $(GUI_BUNDLE)/Contents/Frameworks/QtGui.framework/Versions/A/QtGui \
620+
| grep -q '@rpath/QtDBus'`; \
621+
then \
622+
cp -R $(QT_PATH)/lib/QtDBus.framework $(GUI_BUNDLE)/Contents/Frameworks; \
623+
chmod -R +w $(GUI_BUNDLE)/Contents/Frameworks/QtDBus.framework; \
624+
install_name_tool -change \
625+
'@loader_path/../../../../../../../opt/dbus/lib/libdbus-1.3.dylib' \
626+
/usr/local/opt/dbus/lib/libdbus-1.3.dylib \
627+
$(GUI_BUNDLE)/Contents/Frameworks/QtDBus.framework/QtDBus; \
628+
while :; do echo quit; done \
629+
| $(DYLIBBUNDLER) -of -cd -b -d $(GUI_BUNDLE)/Contents/libs \
630+
-x $(GUI_BUNDLE)/Contents/Frameworks/QtDBus.framework/QtDBus;\
631+
fi
632+
611633
defaults write `pwd`/$(GUI_BUNDLE)/Contents/Info.plist NSCameraUsageDescription \
612634
'Allow camera for video capture'
613635
defaults write `pwd`/$(GUI_BUNDLE)/Contents/Info.plist NSMicrophoneUsageDescription \

0 commit comments

Comments
 (0)