Makefile: simplified macOS building

This commit is contained in:
Martin Pulec
2021-04-09 10:03:55 +02:00
parent b30c1bb0c1
commit d5d226d9f9

View File

@@ -602,22 +602,7 @@ $(GUI_BUNDLE)/Contents/libs: $(BUNDLE)/Contents/libs $(GUI_BUNDLE)
[ -d $(BUNDLE)/Contents/libs ] && cp $(BUNDLE)/Contents/libs/* $(GUI_BUNDLE)/Contents/libs
cp -R $(BUNDLE)/Contents/Frameworks/* $(GUI_BUNDLE)/Contents/Frameworks
# add Qt frameworks
command -v macdeployqt && macdeployqt $(GUI_BUNDLE) -verbose=2
# then fix links also for other binaries than uv-qt, namely uv itself
for n in $(GUI_BUNDLE)/Contents/MacOS/*; do \
for m in $$(otool -L $$n | tail -n +2 | grep -v '^\ *@' | grep 'Qt[a-zA-Z]*\.framework' | sed -n 's/[^/]*\([^ ]*\).*/\1/p'); do \
FRAMEWORK_D=$$(echo $$m | sed 's/\(.*\.framework\).*/\1/'); \
FRAMEWORK_N=$$(basename $$FRAMEWORK_D); \
SUFFIX=$$(echo $$m | sed 's/.*\/\([^/]*\.framework.*\)/\1/'); \
install_name_tool -change $$m @executable_path/../Frameworks/$$SUFFIX $$n; \
[ -d $(GUI_BUNDLE)/Contents/Frameworks/$$FRAMEWORK_N ] && continue; \
cp -R $$FRAMEWORK_D $(GUI_BUNDLE)/Contents/Frameworks; \
install_name_tool -id @executable_path/../Frameworks/$$(echo $$m | sed 's/.*\(Qt[a-zA-Z]*\.framework\)/\1/') $(GUI_BUNDLE)/Contents/Frameworks/$$SUFFIX; \
for i in $$(otool -L $(GUI_BUNDLE)/Contents/Frameworks/$$SUFFIX | tail -n +2 | sed -n '/^[^@]*Qt[a-zA-Z]*\.framework/s/[^/]*\([^ ]*\).*/\1/p'); do \
install_name_tool -change $$i @executable_path/../Frameworks/$$(echo $$i | sed 's/.*\(Qt[a-zA-Z]*\.framework\)/\1/') $(GUI_BUNDLE)/Contents/Frameworks/$$SUFFIX; \
done ; \
done; \
done
command -v macdeployqt && macdeployqt $(GUI_BUNDLE) -verbose=2 -executable=$(GUI_BUNDLE)/Contents/MacOS/uv -executable=$(GUI_BUNDLE)/Contents/MacOS/hd-rum-transcode
test -d $(GUI_BUNDLE)/Contents/Resources || mkdir $(GUI_BUNDLE)/Contents/Resources
cp data/icon.icns $(GUI_BUNDLE)/Contents/Resources
cp data/update.mac $(GUI_BUNDLE)/Contents/MacOS/update