Skip to content

Commit

Permalink
Makefile [Mac] manual QtDBus copy workaround
Browse files Browse the repository at this point in the history
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
  • Loading branch information
MartinPulec committed Sep 15, 2023
1 parent 84ba09f commit 46522e3
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ SYSTEM = @system@

GUI_EXE ?= @GUI_EXE@
GUI_TARGET = @GUI_TARGET@
QT_PATH = $(shell [ -n "$(QMAKE)" ] && python3 -c "import os; print(\
os.path.realpath(os.path.dirname(os.path.realpath(\"$$(command -v \
$(QMAKE))\")) + \"/..\"))")# realpath cmd is present in macOS 13
ifeq (@REFLECTOR_REQ@,yes)
REFLECTOR_TARGET ?= bin/hd-rum-transcode$(EXEEXT)
endif
Expand Down Expand Up @@ -608,6 +611,25 @@ $(GUI_BUNDLE): $(BUNDLE) $(GUI_BUNDLE_DEP)
mv -f $$n $$n-real; cp -f $(srcdir)/data/scripts/macos-wrapper $$n; \
done; \
fi

# TODO TOREMOVE: currently Qt6 (Homebrew) macdeployqt doesn't deploy QtDbus,
# possibly because @rpath is used in QtDBus ref in QtGui
if [ -d $(QT_PATH)/lib/QtDBus.framework ] && \
[ ! -d $(GUI_BUNDLE)/Contents/Frameworks/QtDBus.framework ] && \
`otool -L $(GUI_BUNDLE)/Contents/Frameworks/QtGui.framework/Versions/A/QtGui \
| grep -q '@rpath/QtDBus'`; \
then \
cp -R $(QT_PATH)/lib/QtDBus.framework $(GUI_BUNDLE)/Contents/Frameworks; \
chmod -R +w $(GUI_BUNDLE)/Contents/Frameworks/QtDBus.framework; \
install_name_tool -change \
'@loader_path/../../../../../../../opt/dbus/lib/libdbus-1.3.dylib' \
/usr/local/opt/dbus/lib/libdbus-1.3.dylib \
$(GUI_BUNDLE)/Contents/Frameworks/QtDBus.framework/QtDBus; \
while :; do echo quit; done \
| $(DYLIBBUNDLER) -of -cd -b -d $(GUI_BUNDLE)/Contents/libs \
-x $(GUI_BUNDLE)/Contents/Frameworks/QtDBus.framework/QtDBus;\
fi

defaults write `pwd`/$(GUI_BUNDLE)/Contents/Info.plist NSCameraUsageDescription \
'Allow camera for video capture'
defaults write `pwd`/$(GUI_BUNDLE)/Contents/Info.plist NSMicrophoneUsageDescription \
Expand Down

0 comments on commit 46522e3

Please sign in to comment.