Chris@745: #!/bin/bash Chris@745: Chris@745: app="$1" Chris@745: if [ -z "$app" ]; then Chris@745: echo "Usage: $0 " Chris@745: echo "Provide appname without the .app extension, please" Chris@745: exit 2 Chris@745: fi Chris@745: Chris@745: frameworks="QtCore QtNetwork QtGui QtXml QtWidgets QtPrintSupport" Chris@745: Chris@745: plugins="qtaccessiblewidgets qdds qgif qicns qico qjp2 qjpeg qmng qtga qtiff qwbmp qwebp qcocoa qminimal" Chris@745: Chris@745: qtdir=$(grep "Command:" Makefile | head -1 | awk '{ print $3; }' | sed s,/bin/.*,,) Chris@745: Chris@745: if [ ! -d "$qtdir" ]; then Chris@745: echo "Failed to discover Qt installation directory from Makefile, exiting" Chris@745: exit 2 Chris@745: fi Chris@745: Chris@745: fdir="$app.app/Contents/Frameworks" Chris@745: pdir="$app.app/Contents/plugins" Chris@745: Chris@745: mkdir -p "$fdir" Chris@745: mkdir -p "$pdir" Chris@745: Chris@745: echo Chris@745: echo "Copying frameworks..." Chris@745: for fwk in $frameworks; do Chris@745: cp -v "$qtdir/lib/$fwk.framework/$fwk" "$fdir" || exit 2 Chris@745: done Chris@745: Chris@745: echo "Done" Chris@745: Chris@745: echo Chris@745: echo "Copying plugins..." Chris@745: for plug in $plugins; do Chris@745: pfile=$(ls "$qtdir"/plugins/*/lib"$plug".dylib) Chris@745: if [ ! -f "$pfile" ]; then Chris@745: echo "Failed to find plugin $plug, exiting" Chris@745: exit 2 Chris@745: fi Chris@745: cp -v "$pfile" "$pdir" || exit 2 Chris@745: done Chris@745: Chris@745: echo "Done" Chris@745: