1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-01 03:40:16 +02:00

* Updated OSX build scripts.

This commit is contained in:
Christian Muehlhaeuser
2011-01-03 03:49:55 +01:00
parent a305c97972
commit 0af3ac8c80
3 changed files with 66 additions and 34 deletions

View File

@@ -9,6 +9,8 @@
# sqldrivers/libsqlite.dylib # sqldrivers/libsqlite.dylib
################################################################################ ################################################################################
QT_FRAMEWORKS_DIR="$QTDIR/lib"
QT_PLUGINS_DIR="$QTDIR/plugins"
if [[ ! -d "$QTDIR/lib/QtCore.framework" ]] if [[ ! -d "$QTDIR/lib/QtCore.framework" ]]
then then
@@ -18,12 +20,10 @@ then
QT_FRAMEWORKS_DIR=/Library/Frameworks QT_FRAMEWORKS_DIR=/Library/Frameworks
QT_PLUGINS_DIR=/Developer/Applications/Qt/plugins QT_PLUGINS_DIR=/Developer/Applications/Qt/plugins
fi fi
elif [[ $QTDIR ]]
then
QT_FRAMEWORKS_DIR="$QTDIR/lib"
QT_PLUGINS_DIR="$QTDIR/plugins"
fi fi
echo "Plugins go to: $QT_PLUGINS_DIR"
if [ -z $QTDIR ] if [ -z $QTDIR ]
then then
echo QTDIR must be set, or install the official Qt dmg echo QTDIR must be set, or install the official Qt dmg
@@ -38,26 +38,18 @@ for x in $1
do do
echo "C $x" echo "C $x"
cp -R $QT_FRAMEWORKS_DIR/$x.framework Contents/Frameworks/ cp -R $QT_FRAMEWORKS_DIR/$x.framework Contents/Frameworks/
chmod -R u+rw Contents/Frameworks/
done done
#plugins #plugins
shift shift
mkdir -p Contents/MacOS mkdir -p Contents/MacOS
while (( "$#" )) mkdir -p Contents/MacOS/sqldrivers
do mkdir -p Contents/MacOS/imageformats
echo "C $1"
if [[ -d $QT_PLUGINS_DIR/$1 ]] cp -R $QT_PLUGINS_DIR/sqldrivers/libqsqlite.dylib Contents/MacOS/sqldrivers/
then cp -R $QT_PLUGINS_DIR/imageformats/libqgif.dylib Contents/MacOS/imageformats/
cp -R $QT_PLUGINS_DIR/$1 Contents/MacOS cp -R $QT_PLUGINS_DIR/imageformats/libqjpeg.dylib Contents/MacOS/imageformats/
else
dir=$(basename $(dirname $1))
mkdir Contents/MacOS/$dir
cp $QT_PLUGINS_DIR/$1 Contents/MacOS/$dir
fi
shift
done
#cleanup #cleanup
find Contents/Frameworks -name Headers -o -name \*.prl -o -name \*_debug | xargs rm -rf find Contents/Frameworks -name Headers -o -name \*.prl -o -name \*_debug | xargs rm -rf

View File

@@ -1,8 +1,7 @@
#!/bin/bash #!/bin/bash
# #
# Usage: dist/build-relese-osx.sh [-j] [--no-clean] # Usage: ./admin/mac/build-release-osx.sh [--no-clean]
# #
# Adding the -j parameter results in building a japanese version.
################################################################################ ################################################################################
@@ -21,13 +20,18 @@ function die {
ROOT=`pwd` ROOT=`pwd`
QTDIR=`which qmake` QTDIR=`which qmake`
LINKDIR=`readlink $QTDIR`
QTDIR=`dirname $QTDIR` QTDIR=`dirname $QTDIR`
QTDIR=$QTDIR/`dirname $LINKDIR`
QTDIR=`dirname $QTDIR` QTDIR=`dirname $QTDIR`
test -L "$QTDIR" && QTDIR=`readlink $QTDIR` test -L "$QTDIR" && QTDIR=`readlink $QTDIR`
echo "Goes here: $QTDIR"
export QMAKESPEC='macx-g++' export QMAKESPEC='macx-g++'
export QTDIR export QTDIR
export VERSION export VERSION
export QTVERSION='4.7.1'
################################################################################ ################################################################################
@@ -38,8 +42,8 @@ CREATEDMG='1'
header addQt header addQt
cd tomahawk.app cd tomahawk.app
# $ROOT/admin/mac/add-Qt-to-bundle.sh \ $ROOT/admin/mac/add-Qt-to-bundle.sh \
# 'QtCore QtGui QtXml QtNetwork QtSql' 'QtCore QtGui QtXml QtNetwork QtSql'
header deposx header deposx
$ROOT/admin/mac/deposx.sh $ROOT/admin/mac/deposx.sh

View File

@@ -9,6 +9,12 @@ then
exit 1 exit 1
fi fi
if [ -z $QTVERSION ]
then
echo QTVERSION must be set
exit 1
fi
cd Contents cd Contents
QTLIBS=`ls Frameworks | cut -d. -f1` QTLIBS=`ls Frameworks | cut -d. -f1`
@@ -16,19 +22,26 @@ LIBS=`cd MacOS && ls -fR1 | grep dylib`
################################################################################ ################################################################################
function import_lib
{
echo "L \`$1'"
cp -R -L $1 MacOS/`basename $1`
chmod u+rw MacOS/`basename $1`
deplib_change MacOS/`basename $1`
}
function deposx_change function deposx_change
{ {
echo "D \`$1'" echo "D \`$1'"
echo $QTDIR echo $QTDIR
for y in $QTLIBS for y in $QTLIBS
do do
install_name_tool -change $QTDIR/lib/$y.framework/Versions/4/$y \ install_name_tool -change $QTDIR/lib/$y.framework/Versions/4/$y \
@executable_path/../Frameworks/$y.framework/Versions/4/$y \ @executable_path/../Frameworks/$y.framework/Versions/4/$y \
"$1" "$1"
install_name_tool -change $QTDIR/Cellar/qt/4.6.2/lib/$y.framework/Versions/4/$y \ install_name_tool -change /usr/local/Cellar/qt/$QTVERSION/lib/$y.framework/Versions/4/$y \
@executable_path/../Frameworks/$y.framework/Versions/4/$y \ @executable_path/../Frameworks/$y.framework/Versions/4/$y \
"$1" "$1"
done done
@@ -40,6 +53,23 @@ function deposx_change
"$1" "$1"
done done
} }
function deplib_change
{
install_name_tool -change /usr/local/lib/liblastfm.0.dylib @executable_path/liblastfm.0.dylib $1
install_name_tool -change libqjson.0.dylib @executable_path/libqjson.0.dylib $1
install_name_tool -change libechonest.0.1.0.dylib @executable_path/libechonest.0.1.0.dylib $1
install_name_tool -change /usr/local/lib/libechonest.0.1.0.dylib @executable_path/libechonest.0.1.0.dylib $1
install_name_tool -change /usr/local/Cellar/gloox/1.0/lib/libgloox.8.dylib @executable_path/libgloox.8.dylib $1
install_name_tool -change /usr/local/Cellar/taglib/1.6.3/lib/libtag.1.dylib @executable_path/libtag.1.dylib $1
install_name_tool -change /usr/local/Cellar/libogg/1.2.0/lib/libogg.0.dylib @executable_path/libogg.0.dylib $1
install_name_tool -change /usr/local/Cellar/libvorbis/1.3.1/lib/libvorbis.0.dylib @executable_path/libvorbis.0.dylib $1
install_name_tool -change /usr/local/Cellar/libvorbis/1.3.1/lib/libvorbisfile.3.dylib @executable_path/libvorbisfile.3.dylib $1
install_name_tool -change /usr/local/Cellar/mad/0.15.1b/lib/libmad.0.dylib @executable_path/libmad.0.dylib $1
install_name_tool -change /usr/local/Cellar/flac/1.2.1/lib/libFLAC++.6.dylib @executable_path/libFLAC++.6.dylib $1
install_name_tool -change /usr/local/Cellar/flac/1.2.1/lib/libFLAC.8.dylib @executable_path/libFLAC.8.dylib $1
}
################################################################################ ################################################################################
@@ -48,19 +78,25 @@ find MacOS -type f -a -perm -100 | while read x
do do
echo $x echo $x
y=$(file "$x" | grep 'Mach-O') y=$(file "$x" | grep 'Mach-O')
test -n "$y" && deposx_change "$x" deposx_change "$x"
deplib_change "$x"
install_name_tool -change liblastfm.0.dylib @executable_path/liblastfm.0.dylib $x
install_name_tool -change /usr/local/Cellar/gloox/1.0/lib/libgloox.8.dylib @executable_path/libgloox.8.dylib $x
install_name_tool -change /usr/local/lib/libgloox.8.dylib @executable_path/libgloox.8.dylib $x
install_name_tool -change /usr/local/Cellar/taglib/1.6/lib/libtag.1.dylib @executable_path/libtag.1.dylib $x
install_name_tool -change /usr/local/Cellar/libogg/1.2.0/lib/libogg.0.dylib @executable_path/libogg.0.dylib $x
install_name_tool -change /usr/local/Cellar/libvorbis/1.3.1/lib/libvorbisfile.3.dylib @executable_path/libvorbisfile.3.dylib $x
install_name_tool -change /usr/local/Cellar/mad/0.15.1b/lib/libmad.0.dylib @executable_path/libmad.0.dylib $x
done done
deposx_change MacOS/libqjson.0.7.1.dylib import_lib /usr/local/Cellar/qjson/0.7.1/lib/libqjson.0.dylib
import_lib /usr/local/lib/liblastfm.0.dylib
import_lib /usr/local/Cellar/gloox/1.0/lib/libgloox.8.dylib
import_lib /usr/local/Cellar/taglib/1.6.3/lib/libtag.1.dylib
import_lib /usr/local/Cellar/libogg/1.2.0/lib/libogg.0.dylib
import_lib /usr/local/Cellar/libvorbis/1.3.1/lib/libvorbis.0.dylib
import_lib /usr/local/Cellar/libvorbis/1.3.1/lib/libvorbisfile.3.dylib
import_lib /usr/local/Cellar/mad/0.15.1b/lib/libmad.0.dylib
import_lib /usr/local/Cellar/flac/1.2.1/lib/libFLAC++.6.dylib
import_lib /usr/local/Cellar/flac/1.2.1/lib/libFLAC.8.dylib
import_lib /usr/local/lib/libechonest.0.1.0.dylib
deposx_change MacOS/libqjson.0.dylib
deposx_change MacOS/liblastfm.0.dylib deposx_change MacOS/liblastfm.0.dylib
deposx_change MacOS/libechonest.0.1.0.dylib
# now Qt # now Qt
for x in $QTLIBS for x in $QTLIBS