scripts/release-mac
changeset 822 c2ce9944148c
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/scripts/release-mac	Wed Feb 10 13:48:42 2010 +0000
     1.3 @@ -0,0 +1,105 @@
     1.4 +#!/bin/bash
     1.5 +#
     1.6 +# Link application bundle to QT as framework
     1.7 +#
     1.8 +# written by Uwe Drechsel (c) 2006
     1.9 +#
    1.10 +# License GPL 2
    1.11 +#
    1.12 +
    1.13 +APPNAME=vym
    1.14 +BUNDLE=$APPNAME.app
    1.15 +FWORKS=$BUNDLE/Contents/Frameworks
    1.16 +QTDIR=/usr/local/Trolltech/Qt-4.2.0
    1.17 +QTLIB=$QTDIR/lib
    1.18 +
    1.19 +declare -a FWLIST
    1.20 +
    1.21 +function cleanup
    1.22 +{
    1.23 +	echo ***Cleaning up...
    1.24 +	rm -rf $BUNDLE
    1.25 +	make clean
    1.26 +}
    1.27 +
    1.28 +function compile
    1.29 +{
    1.30 +	echo ***Compiling...
    1.31 +	qmake -config release
    1.32 +	make
    1.33 +}
    1.34 +
    1.35 +function fixLinking 
    1.36 +{
    1.37 +	echo  ***Setting identification names...
    1.38 +	for i in ${FWLIST[@]}
    1.39 +	do
    1.40 +		COM="install_name_tool -id @executable_path/../Frameworks/$i.framework/Versions/4/$i $BUNDLE/Contents/Frameworks/$i.framework/Versions/4/$i"
    1.41 +	done	
    1.42 +		echo "   $COM"
    1.43 +		`$COM`
    1.44 +
    1.45 +	echo ***Tell dynamic linker where to look for frameworks... 
    1.46 +	for i in ${FWLIST[@]}
    1.47 +	do
    1.48 +		COM="install_name_tool -change $QTLIB/$i.framework/Versions/4/$i @executable_path/../Frameworks/$i.framework/Versions/4/$i $BUNDLE/Contents/MacOs/$APPNAME"
    1.49 +		echo "   $COM"
    1.50 +		`$COM`
    1.51 +	done	
    1.52 +
    1.53 +
    1.54 +	for fw in ${FWLIST[@]}
    1.55 +	do
    1.56 +	echo ***Adjust dynamic linking in $fw
    1.57 +		for i in ` otool -L vym.app/Contents/Frameworks/$fw.framework/$fw | grep Trolltech | sed "s/^.*\///" | sed "s/ .*$//"` 
    1.58 +		do
    1.59 +			COM="install_name_tool -change $QTLIB/$i.framework/Versions/4/$i @executable_path/../Frameworks/$i.framework/Versions/4/$i $FWORKS/$fw.framework/$fw"
    1.60 +			echo "   $COM"
    1.61 +			`$COM`
    1.62 +		done	
    1.63 +	done
    1.64 +
    1.65 +}
    1.66 +
    1.67 +function copyFrameworks
    1.68 +{
    1.69 +	# Copy found frameworks into bundle, preserve symbolic links with -R
    1.70 +	mkdir -p  $FWORKS
    1.71 +	for i in ${FWLIST[@]}
    1.72 +	do
    1.73 +		echo ***Copying $QTLIB/$i.framework
    1.74 +		#cp -R $QTLIB/$i.framework $FWORKS
    1.75 +		rsync -avz $QTLIB/$i.framework $FWORKS --exclude 'Qt*_debug'
    1.76 +	done	
    1.77 +}
    1.78 +
    1.79 +function copyRessources
    1.80 +{
    1.81 +	echo ***Copying ressources
    1.82 +	mkdir -p $BUNDLE/Contents/Resources
    1.83 +	cp -r icons flags scripts styles vym.app/Contents/Resources/
    1.84 +	cp icons/vym.icns $BUNDLE/Contents/Resources
    1.85 +}
    1.86 +
    1.87 +function findFrameworks
    1.88 +{
    1.89 +	FWLIST=`otool -L $BUNDLE/Contents/MacOS/$APPNAME  | grep Trolltech | sed "s/^.*\///" | sed "s/ .*$//"`
    1.90 +	#FWLIST=( Qt3Support QtSql QtNetwork QtXml QtGui QtCore )
    1.91 +
    1.92 +	echo ***The following Qt frameworks are needed:
    1.93 +	for i in ${FWLIST[@]}
    1.94 +	do
    1.95 +		echo $i
    1.96 +	done	
    1.97 +}	
    1.98 +
    1.99 +
   1.100 +#cleanup
   1.101 +#compile
   1.102 +
   1.103 +
   1.104 +#findFrameworks
   1.105 +#copyFrameworks
   1.106 +#fixLinking
   1.107 +copyRessources
   1.108 +