Chris@699: #!/bin/bash Chris@699: Chris@699: app="$1" Chris@699: if [ -z "$app" ]; then Chris@699: echo "Usage: $0 " Chris@699: echo "Provide appname without the .app extension, please" Chris@699: exit 2 Chris@699: fi Chris@699: Chris@731: set -eu Chris@731: Chris@699: frameworks="QtCore QtNetwork QtGui QtWidgets QtPrintSupport QtDBus" Chris@699: Chris@699: plugins="gif icns ico jpeg tga tiff wbmp webp cocoa macstyle minimal offscreen" Chris@699: Chris@699: qtdir=$(grep "Command:" Makefile | head -1 | awk '{ print $3; }' | sed s,/bin/.*,,) Chris@699: Chris@699: if [ ! -d "$qtdir" ]; then Chris@699: echo "Failed to discover Qt installation directory from Makefile, exiting" Chris@699: exit 2 Chris@699: fi Chris@699: Chris@699: fdir="$app.app/Contents/Frameworks" Chris@699: pdir="$app.app/Contents/plugins" Chris@699: Chris@699: mkdir -p "$fdir" Chris@699: mkdir -p "$pdir" Chris@699: Chris@699: echo Chris@699: echo "Copying frameworks..." Chris@699: for fwk in $frameworks; do Chris@699: if [ ! -d "$qtdir/lib/$fwk.framework" ]; then Chris@699: if [ "$fwk" = "QtDBus" ]; then Chris@699: echo "QtDBus.framework not found, assuming Qt was built without DBus support" Chris@699: continue Chris@699: fi Chris@699: fi Chris@699: cp -v "$qtdir/lib/$fwk.framework/$fwk" "$fdir" || exit 2 Chris@699: done Chris@699: Chris@699: echo "Done" Chris@699: Chris@699: echo Chris@699: echo "Copying plugins..." Chris@699: for plug in $plugins; do Chris@699: pfile=$(ls "$qtdir"/plugins/*/libq"$plug".dylib) Chris@699: if [ ! -f "$pfile" ]; then Chris@699: echo "Failed to find plugin $plug, exiting" Chris@699: exit 2 Chris@699: fi Chris@699: target="$pdir"/${pfile##?*plugins/} Chris@699: tdir=`dirname "$target"` Chris@699: mkdir -p "$tdir" Chris@699: cp -v "$pfile" "$target" || exit 2 Chris@699: done Chris@699: Chris@699: echo "Done" Chris@699: Chris@699: