Skip to content

Commit

Permalink
Server|qmake|Mac OS X: Adjusting build settings and bundling
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Dec 21, 2012
1 parent fdb514d commit 7e0098f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 32 deletions.
19 changes: 9 additions & 10 deletions doomsday/dep_deng2.pri
Expand Up @@ -20,18 +20,17 @@ win32 {
}

macx {
defineTest(linkBinaryToBundledLibdeng2) {
fixInstallName($$1, libdeng2.2.dylib, ..)
fixInstallName($$1, QtCore.framework/Versions/4/QtCore, ..)
fixInstallName($$1, QtNetwork.framework/Versions/4/QtNetwork, ..)
fixInstallName($$1, QtGui.framework/Versions/4/QtGui, ..)
fixInstallName($$1, QtOpenGL.framework/Versions/4/QtOpenGL, ..)
}
defineTest(linkToBundledLibdeng2) {
fixInstallName($${1}.bundle/$$1, libdeng2.2.dylib, ..)
fixInstallName($${1}.bundle/$$1, QtCore.framework/Versions/4/QtCore, ..)
fixInstallName($${1}.bundle/$$1, QtNetwork.framework/Versions/4/QtNetwork, ..)
fixInstallName($${1}.bundle/$$1, QtGui.framework/Versions/4/QtGui, ..)
fixInstallName($${1}.bundle/$$1, QtOpenGL.framework/Versions/4/QtOpenGL, ..)
linkBinaryToBundledLibdeng2($${1}.bundle/$$1)
}
defineTest(linkDylibToBundledLibdeng2) {
fixInstallName($${1}.dylib, libdeng2.2.dylib, ..)
fixInstallName($${1}.dylib, QtCore.framework/Versions/4/QtCore, ..)
fixInstallName($${1}.dylib, QtNetwork.framework/Versions/4/QtNetwork, ..)
fixInstallName($${1}.dylib, QtGui.framework/Versions/4/QtGui, ..)
fixInstallName($${1}.dylib, QtOpenGL.framework/Versions/4/QtOpenGL, ..)
linkBinaryToBundledLibdeng2($${1}.dylib)
}
}
3 changes: 3 additions & 0 deletions doomsday/postbuild/bundleapp.sh
Expand Up @@ -23,6 +23,9 @@ echo "Bundle directory: $APPDIR"
echo "Clearing existing bundles..."
rm -rf $BUILDDIR/*.bundle

echo "Copying server..."
$CP server/doomsday-server $APPDIR/Resources

echo "Copying bundles from plugins..."
PLUGDIR=$APPDIR/DengPlugins
rm -rf $PLUGDIR
Expand Down
28 changes: 6 additions & 22 deletions doomsday/server/server.pro
Expand Up @@ -13,6 +13,8 @@ VERSION = $$DENG_VERSION

echo(Doomsday Server $${DENG_VERSION}.)

CONFIG -= app_bundle

# External Dependencies ------------------------------------------------------

CONFIG += deng_nogui
Expand Down Expand Up @@ -94,7 +96,7 @@ DENG_API_HEADERS = \
$$SRC/api/resourceclass.h \
$$SRC/api/sys_audiod.h \
$$SRC/api/sys_audiod_mus.h \
$$SRC/api/sys_audiod_sfx.h \"
$$SRC/api/sys_audiod_sfx.h \
$$SRC/api/thinker.h \
$$SRC/api/uri.h

Expand Down Expand Up @@ -509,8 +511,8 @@ mod.files = \
macx {
res.path = Contents/Resources
res.files = \
res/macx/English.lproj \
res/macx/deng.icns
$$SRC/res/macx/English.lproj \
$$SRC/res/macx/deng.icns

data.path = $${res.path}
mod.path = $${res.path}/modules
Expand All @@ -519,25 +521,7 @@ macx {

QMAKE_INFO_PLIST = ../build/mac/Info.plist

# Since qmake is unable to copy directories as bundle data, let's copy
# the frameworks manually.
FW_DIR = \"$${OUT_PWD}/Doomsday.app/Contents/Frameworks/\"
doPostLink("rm -rf $$FW_DIR")
doPostLink("mkdir $$FW_DIR")

# libdeng1 and 2 dynamic libraries.
doPostLink("cp -fRp $$OUT_PWD/../libdeng2/libdeng2*dylib $$FW_DIR")
doPostLink("cp -fRp $$OUT_PWD/../libdeng/libdeng1*dylib $$FW_DIR")

# Fix the dynamic linker paths so they point to ../Frameworks/ inside the bundle.
fixInstallName(Doomsday.app/Contents/MacOS/Doomsday, libdeng2.2.dylib, ..)
fixInstallName(Doomsday.app/Contents/MacOS/Doomsday, libdeng1.1.dylib, ..)

# Clean up previous deployment.
doPostLink("rm -rf Doomsday.app/Contents/PlugIns/")
doPostLink("rm -f Doomsday.app/Contents/Resources/qt.conf")

doPostLink("macdeployqt Doomsday.app")
linkBinaryToBundledLibdeng2($$TARGET)
}

# Installation ---------------------------------------------------------------
Expand Down

0 comments on commit 7e0098f

Please sign in to comment.