annotate deploy/osx/copy-qt.sh @ 516:449a0355f864 v2.0_osx_deploy

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:50:39 +0100
parents 42e80bb7f1ad
children 2fcc15ca574a
rev   line source
Chris@437 1 #!/bin/bash
Chris@437 2
Chris@437 3 set -eu
Chris@437 4
Chris@437 5 app="$1"
Chris@437 6 if [ -z "$app" ]; then
Chris@437 7 echo "Usage: $0 <appname>"
Chris@437 8 echo "Provide appname without the .app extension, please"
Chris@437 9 exit 2
Chris@437 10 fi
Chris@437 11
Chris@516 12 frameworks="QtCore QtNetwork QtGui QtXml QtSvg QtWidgets QtPrintSupport QtDBus"
Chris@437 13
Chris@437 14 plugins="dds gif icns ico jp2 jpeg mng tga tiff wbmp webp cocoa minimal offscreen"
Chris@437 15
Chris@437 16 qtdir=$(grep "Command:" Makefile | head -1 | awk '{ print $3; }' | sed s,/bin/.*,,)
Chris@437 17
Chris@437 18 if [ ! -d "$qtdir" ]; then
Chris@437 19 echo "Failed to discover Qt installation directory from Makefile, exiting"
Chris@437 20 exit 2
Chris@437 21 fi
Chris@437 22
Chris@437 23 fdir="$app.app/Contents/Frameworks"
Chris@437 24 pdir="$app.app/Contents/plugins"
Chris@437 25
Chris@437 26 mkdir -p "$fdir"
Chris@437 27 mkdir -p "$pdir"
Chris@437 28
Chris@437 29 echo
Chris@437 30 echo "Copying frameworks..."
Chris@437 31 for fwk in $frameworks; do
Chris@437 32 cp -v "$qtdir/lib/$fwk.framework/$fwk" "$fdir" || exit 2
Chris@437 33 done
Chris@437 34
Chris@437 35 echo "Done"
Chris@437 36
Chris@437 37 echo
Chris@437 38 echo "Copying plugins..."
Chris@437 39 for plug in $plugins; do
Chris@437 40 pfile=$(ls "$qtdir"/plugins/*/libq"$plug".dylib)
Chris@437 41 if [ ! -f "$pfile" ]; then
Chris@437 42 echo "Failed to find plugin $plug, exiting"
Chris@437 43 exit 2
Chris@437 44 fi
Chris@437 45 target="$pdir"/${pfile##?*plugins/}
Chris@437 46 tdir=`dirname "$target"`
Chris@437 47 mkdir -p "$tdir"
Chris@437 48 cp -v "$pfile" "$target" || exit 2
Chris@437 49 done
Chris@437 50
Chris@437 51 echo "Done"
Chris@437 52
Chris@437 53