changeset 745:d18c89386a71

OS/X build: copy frameworks and plugins automatically
author Chris Cannam
date Mon, 07 Jul 2014 08:14:08 +0100
parents ccf3749cbaea
children 6fadabe80ad8
files deploy/osx/copy-qt.sh deploy/osx/deploy.sh
diffstat 2 files changed, 52 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/osx/copy-qt.sh	Mon Jul 07 08:14:08 2014 +0100
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+app="$1"
+if [ -z "$app" ]; then
+	echo "Usage: $0 <appname>"
+	echo "Provide appname without the .app extension, please"
+	exit 2
+fi
+
+frameworks="QtCore QtNetwork QtGui QtXml QtWidgets QtPrintSupport"
+
+plugins="qtaccessiblewidgets qdds qgif qicns qico qjp2 qjpeg qmng qtga qtiff qwbmp qwebp qcocoa qminimal"
+
+qtdir=$(grep "Command:" Makefile | head -1 | awk '{ print $3; }' | sed s,/bin/.*,,)
+
+if [ ! -d "$qtdir" ]; then
+    echo "Failed to discover Qt installation directory from Makefile, exiting"
+    exit 2
+fi
+
+fdir="$app.app/Contents/Frameworks"
+pdir="$app.app/Contents/plugins"
+
+mkdir -p "$fdir"
+mkdir -p "$pdir"
+
+echo
+echo "Copying frameworks..."
+for fwk in $frameworks; do
+    cp -v "$qtdir/lib/$fwk.framework/$fwk" "$fdir" || exit 2
+done
+
+echo "Done"
+
+echo
+echo "Copying plugins..."
+for plug in $plugins; do
+    pfile=$(ls "$qtdir"/plugins/*/lib"$plug".dylib)
+    if [ ! -f "$pfile" ]; then
+	echo "Failed to find plugin $plug, exiting"
+	exit 2
+    fi
+    cp -v "$pfile" "$pdir" || exit 2
+done
+
+echo "Done"
+
--- a/deploy/osx/deploy.sh	Mon Jul 07 07:55:49 2014 +0100
+++ b/deploy/osx/deploy.sh	Mon Jul 07 08:14:08 2014 +0100
@@ -24,6 +24,11 @@
 esac
 
 echo
+echo "Copying in frameworks and plugins from Qt installation directory."
+
+deploy/osx/copy-qt.sh "$app" || exit 2
+
+echo
 echo "Fixing up paths."
 
 deploy/osx/paths.sh "$app"