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@982: frameworks="QtCore QtNetwork QtGui QtXml QtSvg QtWidgets QtPrintSupport" Chris@745: Chris@982: plugins="dds gif icns ico jp2 jpeg mng tga tiff wbmp webp cocoa minimal offscreen" 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@772: pfile=$(ls "$qtdir"/plugins/*/libq"$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@772: target="$pdir"/${pfile##?*plugins/} Chris@772: tdir=`dirname "$target"` Chris@772: mkdir -p "$tdir" Chris@772: cp -v "$pfile" "$target" || exit 2 Chris@745: done Chris@745: Chris@745: echo "Done" Chris@745: Chris@772: