From 7faa033855f6f7bb24f5b891f871d13ee8a8b8ef Mon Sep 17 00:00:00 2001 From: a b Date: Sun, 29 Jan 2012 21:17:32 +0100 Subject: [PATCH] Mac fixes --- cockatrice/src/main.cpp | 4 ++-- common/decklist.cpp | 2 -- common/decklist.h | 6 ++++-- prepareMacRelease.sh | 16 +++++++++------- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/cockatrice/src/main.cpp b/cockatrice/src/main.cpp index ffb93a9c0..d4abc371c 100644 --- a/cockatrice/src/main.cpp +++ b/cockatrice/src/main.cpp @@ -104,11 +104,11 @@ int main(int argc, char *argv[]) if (!db->getLoadSuccess()) if (db->loadCardDatabase(dataDir + "/cards.xml")) settingsCache->setCardDatabasePath(dataDir + "/cards.xml"); - if (!QDir(settingsCache->getDeckPath()).exists()) { + if (!QDir(settingsCache->getDeckPath()).exists() || settingsCache->getDeckPath().isEmpty()) { QDir().mkpath(dataDir + "/decks"); settingsCache->setDeckPath(dataDir + "/decks"); } - if (!QDir(settingsCache->getPicsPath()).exists()) { + if (!QDir(settingsCache->getPicsPath()).exists() || settingsCache->getPicsPath().isEmpty()) { QDir().mkpath(dataDir + "/pics"); settingsCache->setPicsPath(dataDir + "/pics"); } diff --git a/common/decklist.cpp b/common/decklist.cpp index ddee35185..733ade931 100644 --- a/common/decklist.cpp +++ b/common/decklist.cpp @@ -1,7 +1,5 @@ #include #include -#include -#include #include #include #include "decklist.h" diff --git a/common/decklist.h b/common/decklist.h index dce4ae142..d3c852c33 100644 --- a/common/decklist.h +++ b/common/decklist.h @@ -9,13 +9,15 @@ #include #include +// Required on Mac. Forward declaration doesn't work. Don't ask why. +#include +#include + #include "pb/move_card_to_zone.pb.h" class CardDatabase; class QIODevice; class QTextStream; -class QXmlStreamReader; -class QXmlStreamWriter; class InnerDecklistNode; diff --git a/prepareMacRelease.sh b/prepareMacRelease.sh index c1cbf8179..c5ff441a8 100644 --- a/prepareMacRelease.sh +++ b/prepareMacRelease.sh @@ -3,17 +3,16 @@ FRAMEWORKS="Core Gui Multimedia Network Svg Xml Script" DATE=`date '+%Y%m%d'` #QTDIR="/Users/brukie/QtSDK/Desktop/Qt/474/gcc" -QTLIB="/usr/local/Qt4.7/lib" -QTPLUGINS="/usr/local/Qt4.7/plugins" +QTLIB="/Users/brukie/qt/lib" +QTPLUGINS="/Users/brukie/qt/plugins" +PROTOBUF="/Users/brukie/protobuf" DIR=cockatrice_mac_$DATE if [ -d $DIR ]; then echo "delete old dir first"; exit 1; fi mkdir $DIR -cp -R cockatrice/cockatrice.app $DIR -cp -R oracle/oracle.app $DIR -mkdir $DIR/decks -mkdir $DIR/pics +cp -R build/cockatrice/cockatrice.app $DIR +cp -R build/oracle/oracle.app $DIR mkdir $DIR/Frameworks cp -R sounds zonebg $DIR cp -R $QTPLUGINS $DIR/PlugIns @@ -23,7 +22,7 @@ done find $DIR/Frameworks -name '*debug*'|xargs -n 1 rm -f find $DIR/Frameworks -name 'Headers'|xargs -n 1 rm -rf find $DIR/PlugIns -name '*debug*'|xargs -n 1 rm -f - +cp $PROTOBUF/lib/libprotobuf.7.dylib $DIR/Frameworks cd $DIR for f in $FRAMEWORKS; do @@ -43,6 +42,9 @@ for f in $FRAMEWORKS; do done done +install_name_tool -id @executable_path/../../../libprotobuf.7.dylib Frameworks/libprotobuf.7.dylib +install_name_tool -change $PROTOBUF/lib/libprotobuf.7.dylib @executable_path/../../../Frameworks/libprotobuf.7.dylib cockatrice.app/Contents/MacOS/cockatrice + cd .. VOL=cockatrice_mac_${DATE}