1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-13 04:21:51 +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
################################################################################
QT_FRAMEWORKS_DIR="$QTDIR/lib"
QT_PLUGINS_DIR="$QTDIR/plugins"
if [[ ! -d "$QTDIR/lib/QtCore.framework" ]]
then
@ -18,12 +20,10 @@ then
QT_FRAMEWORKS_DIR=/Library/Frameworks
QT_PLUGINS_DIR=/Developer/Applications/Qt/plugins
fi
elif [[ $QTDIR ]]
then
QT_FRAMEWORKS_DIR="$QTDIR/lib"
QT_PLUGINS_DIR="$QTDIR/plugins"
fi
echo "Plugins go to: $QT_PLUGINS_DIR"
if [ -z $QTDIR ]
then
echo QTDIR must be set, or install the official Qt dmg
@ -38,26 +38,18 @@ for x in $1
do
echo "C $x"
cp -R $QT_FRAMEWORKS_DIR/$x.framework Contents/Frameworks/
chmod -R u+rw Contents/Frameworks/
done
#plugins
shift
mkdir -p Contents/MacOS
while (( "$#" ))
do
echo "C $1"
mkdir -p Contents/MacOS/sqldrivers
mkdir -p Contents/MacOS/imageformats
if [[ -d $QT_PLUGINS_DIR/$1 ]]
then
cp -R $QT_PLUGINS_DIR/$1 Contents/MacOS
else
dir=$(basename $(dirname $1))
mkdir Contents/MacOS/$dir
cp $QT_PLUGINS_DIR/$1 Contents/MacOS/$dir
fi
shift
done
cp -R $QT_PLUGINS_DIR/sqldrivers/libqsqlite.dylib Contents/MacOS/sqldrivers/
cp -R $QT_PLUGINS_DIR/imageformats/libqgif.dylib Contents/MacOS/imageformats/
cp -R $QT_PLUGINS_DIR/imageformats/libqjpeg.dylib Contents/MacOS/imageformats/
#cleanup
find Contents/Frameworks -name Headers -o -name \*.prl -o -name \*_debug | xargs rm -rf

View File

@ -1,8 +1,7 @@
#!/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`
QTDIR=`which qmake`
LINKDIR=`readlink $QTDIR`
QTDIR=`dirname $QTDIR`
QTDIR=$QTDIR/`dirname $LINKDIR`
QTDIR=`dirname $QTDIR`
test -L "$QTDIR" && QTDIR=`readlink $QTDIR`
echo "Goes here: $QTDIR"
export QMAKESPEC='macx-g++'
export QTDIR
export VERSION
export QTVERSION='4.7.1'
################################################################################
@ -38,8 +42,8 @@ CREATEDMG='1'
header addQt
cd tomahawk.app
# $ROOT/admin/mac/add-Qt-to-bundle.sh \
# 'QtCore QtGui QtXml QtNetwork QtSql'
$ROOT/admin/mac/add-Qt-to-bundle.sh \
'QtCore QtGui QtXml QtNetwork QtSql'
header deposx
$ROOT/admin/mac/deposx.sh

View File

@ -9,6 +9,12 @@ then
exit 1
fi
if [ -z $QTVERSION ]
then
echo QTVERSION must be set
exit 1
fi
cd Contents
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
{
echo "D \`$1'"
echo $QTDIR
for y in $QTLIBS
do
install_name_tool -change $QTDIR/lib/$y.framework/Versions/4/$y \
@executable_path/../Frameworks/$y.framework/Versions/4/$y \
"$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 \
"$1"
done
@ -40,6 +53,23 @@ function deposx_change
"$1"
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
echo $x
y=$(file "$x" | grep 'Mach-O')
test -n "$y" && deposx_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
deposx_change "$x"
deplib_change "$x"
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/libechonest.0.1.0.dylib
# now Qt
for x in $QTLIBS