Skip to content

Commit

Permalink
OS X|qmake|Fixed: Various build and deployment issues with Qt 5
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Jul 17, 2014
1 parent c1f4ff5 commit e83fbd7
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 30 deletions.
56 changes: 28 additions & 28 deletions distrib/platform_release.py
Expand Up @@ -210,13 +210,13 @@ def mac_release():
os.chdir(MAC_WORK_DIR)

# Choose the appropriate compiler.
if mac_os_version() == '10.8' or mac_os_version() == '10.9':
mkspec = 'unsupported/macx-clang'
else:
mkspec = 'macx-g++'
#if mac_os_version() == '10.8' or mac_os_version() == '10.9':
# mkspec = 'unsupported/macx-clang'
#else:
# mkspec = 'macx-g++'

if os.system('qmake -r -spec %s CONFIG+=release DENG_BUILD=%s ' % (mkspec, DOOMSDAY_BUILD_NUMBER) +
'../doomsday/doomsday.pro && make -j2 -w'):
if os.system('PATH=`qmake-qt5 -query QT_INSTALL_BINS`:$PATH qmake -r CONFIG+=release DENG_BUILD=%s ' % (DOOMSDAY_BUILD_NUMBER) +
'../doomsday/doomsday.pro && PATH=`qmake-qt5 -query QT_INSTALL_BINS`:$PATH make -j2 -w'):
raise Exception("Failed to build from source.")

# Now we can proceed to packaging.
Expand All @@ -242,6 +242,27 @@ def mac_release():
os.system('chmod -R o-w "Doomsday Engine.app"')
os.system('chmod -R o-w "Doomsday Shell.app"')

if mac_os_version() != '10.6':
print 'Packaging apps onto a disk image (unsigned)...'
templateFile = 'appdisk.sparseimage'
os.system('bunzip2 -k -c %s > %s' % (os.path.join(SNOWBERRY_DIR, 'template-image/template.sparseimage.bz2'),
templateFile))
remkdir('imaging')
os.system('hdiutil attach %s -noautoopen -quiet -mountpoint imaging' % templateFile)

remove('imaging/Doomsday.pkg') # included in bzipped image
duptree('Doomsday Engine.app', 'imaging/Doomsday Engine.app')
duptree('Doomsday Shell.app', 'imaging/Doomsday Shell.app')
shutil.copy(os.path.join(DOOMSDAY_DIR, "doc/output/Read Me.rtf"), 'imaging/Read Me.rtf')

volumeName = "Doomsday Engine " + DOOMSDAY_VERSION_FULL
os.system('/usr/sbin/diskutil rename ' + os.path.abspath('imaging') + ' "' + volumeName + '"')

os.system('hdiutil detach -quiet imaging')
os.system('hdiutil convert %s -format UDZO -imagekey zlib-level=9 -o "../releases/%s"' % (
templateFile, output_filename('_apps-' + mac_osx_suffix() + '.dmg')))
remove(templateFile)

def codesign(fn, opts=''):
os.system('codesign --verbose -s "Developer ID Application: Jaakko Keranen" %s "%s"' % (opts, fn))

Expand All @@ -263,7 +284,7 @@ def fw_codesign(app):
fw_codesign('Doomsday Shell.app')

print 'Signing Doomsday.app...'
codesign('Doomsday Engine.app/Contents/Doomsday.app/Contents/Frameworks/SDL.framework/SDL')
codesign('Doomsday Engine.app/Contents/Doomsday.app/Contents/Frameworks/SDL2.framework/SDL2')
codesign("Doomsday Engine.app/Contents/Doomsday.app")

print 'Signing Doomsday Engine.app...'
Expand All @@ -276,27 +297,6 @@ def fw_codesign(app):
print 'Signing Doomsday Shell.app...'
codesign("Doomsday Shell.app")

if mac_os_version() != '10.6':
print 'Packaging apps onto a disk image...'
templateFile = 'appdisk.sparseimage'
os.system('bunzip2 -k -c %s > %s' % (os.path.join(SNOWBERRY_DIR, 'template-image/template.sparseimage.bz2'),
templateFile))
remkdir('imaging')
os.system('hdiutil attach %s -noautoopen -quiet -mountpoint imaging' % templateFile)

remove('imaging/Doomsday.pkg') # included in bzipped image
duptree('Doomsday Engine.app', 'imaging/Doomsday Engine.app')
duptree('Doomsday Shell.app', 'imaging/Doomsday Shell.app')
shutil.copy(os.path.join(DOOMSDAY_DIR, "doc/output/Read Me.rtf"), 'imaging/Read Me.rtf')

volumeName = "Doomsday Engine " + DOOMSDAY_VERSION_FULL
os.system('/usr/sbin/diskutil rename ' + os.path.abspath('imaging') + ' "' + volumeName + '"')

os.system('hdiutil detach -quiet imaging')
os.system('hdiutil convert %s -format UDZO -imagekey zlib-level=9 -o "../releases/%s"' % (
templateFile, output_filename('_apps-' + mac_osx_suffix() + '.dmg')))
remove(templateFile)

# Package the apps and create an installer package.
os.system('mkdir package')
duptree('Doomsday Engine.app', 'package/Doomsday Engine.app')
Expand Down
3 changes: 1 addition & 2 deletions doomsday/libcore/libcore.pro
Expand Up @@ -186,8 +186,7 @@ OTHER_FILES += \
macx {
defineTest(fixInstallName) {
doPostLink("install_name_tool -change $$1 @rpath/$$1 libdeng_core.2.dylib")
doPostLink("install_name_tool -change $$(QTDIR)lib/$$1 @rpath/$$1 libdeng_core.2.dylib")
doPostLink("install_name_tool -change $$(QTDIR)/lib/$$1 @rpath/$$1 libdeng_core.2.dylib")
doPostLink("install_name_tool -change $$[QT_INSTALL_LIBS]/$$1 @rpath/$$1 libdeng_core.2.dylib")
}
doPostLink("install_name_tool -id @rpath/libdeng_core.2.dylib libdeng_core.2.dylib")
fixInstallName("QtCore.framework/Versions/$$QT_MAJOR_VERSION/QtCore")
Expand Down
8 changes: 8 additions & 0 deletions doomsday/postbuild/bundleapp.sh
Expand Up @@ -121,6 +121,10 @@ if [ -e "$APPDIR/Frameworks/QtCore.framework/Versions/$QT_MAJOR" ]; then
ln -fs Versions/$QT_MAJOR/QtGui $APPDIR/Frameworks/QtGui.framework/QtGui
ln -fs Versions/$QT_MAJOR/QtNetwork $APPDIR/Frameworks/QtNetwork.framework/QtNetwork
ln -fs Versions/$QT_MAJOR/QtOpenGL $APPDIR/Frameworks/QtOpenGL.framework/QtOpenGL
if [ "$QT_MAJOR" == "5" ]; then
ln -fs Versions/$QT_MAJOR/QtWidgets "$APPDIR/Frameworks/QtWidgets.framework/QtWidgets"
ln -fs Versions/$QT_MAJOR/QtPrintSupport "$APPDIR/Frameworks/QtPrintSupport.framework/QtPrintSupport"
fi
fi

echo "Bundling Doomsday Shell.app..."
Expand All @@ -138,6 +142,10 @@ if [ -e "$APPDIR/Frameworks/QtCore.framework/Versions/$QT_MAJOR" ]; then
ln -fs Versions/$QT_MAJOR/QtCore "$APPDIR/Frameworks/QtCore.framework/QtCore"
ln -fs Versions/$QT_MAJOR/QtGui "$APPDIR/Frameworks/QtGui.framework/QtGui"
ln -fs Versions/$QT_MAJOR/QtNetwork "$APPDIR/Frameworks/QtNetwork.framework/QtNetwork"
if [ "$QT_MAJOR" == "5" ]; then
ln -fs Versions/$QT_MAJOR/QtWidgets "$APPDIR/Frameworks/QtWidgets.framework/QtWidgets"
ln -fs Versions/$QT_MAJOR/QtPrintSupport "$APPDIR/Frameworks/QtPrintSupport.framework/QtPrintSupport"
fi
fi

echo "Bundling done."

0 comments on commit e83fbd7

Please sign in to comment.