annotate deploy/osx/copy-qt.sh @ 1077:bd3728701e1e

Deployment fixes. Qt on OSX now seems to depend on QtDBus, so copy that in, and also fail if anything is found to depend on an absent Qt framework.
author Chris Cannam
date Fri, 23 Oct 2015 08:44:37 +0100
parents 55575ded7d8c
children b2c45b831ea8
rev   line source
Chris@745 1 #!/bin/bash
Chris@745 2
Chris@745 3 app="$1"
Chris@745 4 if [ -z "$app" ]; then
Chris@745 5 echo "Usage: $0 <appname>"
Chris@745 6 echo "Provide appname without the .app extension, please"
Chris@745 7 exit 2
Chris@745 8 fi
Chris@745 9
Chris@1077 10 frameworks="QtCore QtNetwork QtGui QtXml QtWidgets QtPrintSupport QtDBus"
Chris@745 11
Chris@1074 12 plugins="dds gif icns ico jp2 jpeg mng tga tiff wbmp webp cocoa minimal offscreen"
Chris@745 13
Chris@745 14 qtdir=$(grep "Command:" Makefile | head -1 | awk '{ print $3; }' | sed s,/bin/.*,,)
Chris@745 15
Chris@745 16 if [ ! -d "$qtdir" ]; then
Chris@745 17 echo "Failed to discover Qt installation directory from Makefile, exiting"
Chris@745 18 exit 2
Chris@745 19 fi
Chris@745 20
Chris@745 21 fdir="$app.app/Contents/Frameworks"
Chris@745 22 pdir="$app.app/Contents/plugins"
Chris@745 23
Chris@745 24 mkdir -p "$fdir"
Chris@745 25 mkdir -p "$pdir"
Chris@745 26
Chris@745 27 echo
Chris@745 28 echo "Copying frameworks..."
Chris@745 29 for fwk in $frameworks; do
Chris@745 30 cp -v "$qtdir/lib/$fwk.framework/$fwk" "$fdir" || exit 2
Chris@745 31 done
Chris@745 32
Chris@745 33 echo "Done"
Chris@745 34
Chris@745 35 echo
Chris@745 36 echo "Copying plugins..."
Chris@745 37 for plug in $plugins; do
Chris@772 38 pfile=$(ls "$qtdir"/plugins/*/libq"$plug".dylib)
Chris@745 39 if [ ! -f "$pfile" ]; then
Chris@745 40 echo "Failed to find plugin $plug, exiting"
Chris@745 41 exit 2
Chris@745 42 fi
Chris@772 43 target="$pdir"/${pfile##?*plugins/}
Chris@772 44 tdir=`dirname "$target"`
Chris@772 45 mkdir -p "$tdir"
Chris@772 46 cp -v "$pfile" "$target" || exit 2
Chris@745 47 done
Chris@745 48
Chris@745 49 echo "Done"
Chris@745 50
Chris@772 51