summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt/osx_deploy.sh
diff options
context:
space:
mode:
authorBarry Wardell <rockbox@barrywardell.net>2007-10-20 11:48:57 +0000
committerBarry Wardell <rockbox@barrywardell.net>2007-10-20 11:48:57 +0000
commitf4d39b32892945c18e76378293f20f8296e10599 (patch)
tree21a470d876caae0da71290def203f3f8af2d0d2e /rbutil/rbutilqt/osx_deploy.sh
parenteee3745d70dc0c36f54a311d8af2fc35ec65537b (diff)
downloadrockbox-f4d39b32892945c18e76378293f20f8296e10599.tar.gz
rockbox-f4d39b32892945c18e76378293f20f8296e10599.zip
Handy script for packaging rbutil on OS X
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15220 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt/osx_deploy.sh')
-rwxr-xr-xrbutil/rbutilqt/osx_deploy.sh87
1 files changed, 87 insertions, 0 deletions
diff --git a/rbutil/rbutilqt/osx_deploy.sh b/rbutil/rbutilqt/osx_deploy.sh
new file mode 100755
index 0000000000..bd9b0095c3
--- /dev/null
+++ b/rbutil/rbutilqt/osx_deploy.sh
@@ -0,0 +1,87 @@
1#!/bin/sh
2# __________ __ ___.
3# Open \______ \ ____ ____ | | _\_ |__ _______ ___
4# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7# \/ \/ \/ \/ \/
8# $Id: gentalkclips.sh 11426 2006-11-03 21:47:52Z rasher $
9#
10# Copyright (c) 2007 Barry Wardell
11#
12# All files in this archive are subject to the GNU General Public License.
13# See the file COPYING in the source tree root for full license agreement.
14#
15# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16# KIND, either express or implied.
17#
18#
19# Purpose of this script: Prepare Mac OS X version of rbutil for distribution.
20#
21# Inputs: None
22#
23# Action: Copy necessary Qt frameworks into the rbutilqt application bundle.
24# Update the linking of rbutilqt and the frameworks to refer to the new
25# new location of the framework files (inside the app bundle).
26# Create a compressed disk image from rbutilqt.app.
27#
28# Output: A compressed disk image called rbutilqt.dmg
29#
30# Requirement: This script assumes that you have rbutilqt.app in the current
31# directory and a framework build of Qt in your $PATH
32#
33# See http://doc.trolltech.com/4.3/deployment-mac.html for an explanation of
34# what we're doing here.
35
36# scan the $PATH for the given command
37findtool(){
38 file="$1"
39
40 IFS=":"
41 for path in $PATH
42 do
43 # echo "checks for $file in $path" >&2
44 if test -f "$path/$file"; then
45 echo "$path/$file"
46 return
47 fi
48 done
49}
50
51# Try to find Qt
52QTDIR=`findtool qmake`
53if test -z "$QTDIR"; then
54 # not in path
55 echo "Error: Couldn't find Qt. Make sure it is in your \$PATH"
56 exit
57else
58 QTDIR=`dirname \`dirname $QTDIR\``
59 echo "Found Qt: $QTDIR"
60fi
61
62# Check Qt was built as frameworks
63if test ! -d "$QTDIR/lib/QtCore.framework"; then
64 echo "Error: Unable to find Qt frameworks in $QTDIR"
65 echo " Make sure you built Qt as frameworks and not statically."
66 exit
67fi
68
69mkdir -p rbutilqt.app/Contents/Frameworks/{QtCore,QtGui,QtNetwork}.framework/Versions/4
70
71echo "Copying frameworks"
72cp $QTDIR/lib/QtCore.framework/Versions/4/QtCore rbutilqt.app/Contents/Frameworks/QtCore.framework/Versions/4/
73cp $QTDIR/lib/QtGui.framework/Versions/4/QtGui rbutilqt.app/Contents/Frameworks/QtGui.framework/Versions/4/
74cp $QTDIR/lib/QtNetwork.framework/Versions/4/QtNetwork rbutilqt.app/Contents/Frameworks/QtNetwork.framework/Versions/4/
75
76echo "Fixing framework linking"
77install_name_tool -id @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore rbutilqt.app/Contents/Frameworks/QtCore.framework/Versions/4/QtCore
78install_name_tool -id @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui rbutilqt.app/Contents/Frameworks/QtGui.framework/Versions/4/QtGui
79install_name_tool -id @executable_path/../Frameworks/QtNetwork.framework/Versions/4/QtNetwork rbutilqt.app/Contents/Frameworks/QtNetwork.framework/Versions/4/QtNetwork
80install_name_tool -change $QTDIR/lib/QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore rbutilqt.app/Contents/MacOS/rbutilqt
81install_name_tool -change $QTDIR/lib/QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui rbutilqt.app/Contents/MacOS/rbutilqt
82install_name_tool -change $QTDIR/lib/QtNetwork.framework/Versions/4/QtNetwork @executable_path/../Frameworks/QtNetwork.framework/Versions/4/QtNetwork rbutilqt.app/Contents/MacOS/rbutilqt
83install_name_tool -change $QTDIR/lib/QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore rbutilqt.app/Contents/Frameworks/QtGui.framework/Versions/4/QtGui
84install_name_tool -change $QTDIR/lib/QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore rbutilqt.app/Contents/Frameworks/QtNetwork.framework/Versions/4/QtNetwork
85
86echo "Creating disk image"
87hdiutil create -srcfolder rbutilqt.app -ov rbutilqt.dmg \ No newline at end of file