Skip to content

Commit

Permalink
Fixed|Builder|OS X: Signing binaries on Mavericks
Browse files Browse the repository at this point in the history
OS X 10.9 requires that *all* binaries are signed, not just the applications
themselves.

This commit calls codesign on bundled shared libraries, Qt frameworks,
Qt plugins, and other binaries. Also, a number of symbolic links in the
frameworks are recreated since they seem to have gone missing (bug in
macdeployqt?).
  • Loading branch information
skyjake committed Oct 28, 2013
1 parent 513edb6 commit 5cfd323
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 4 deletions.
33 changes: 29 additions & 4 deletions distrib/platform_release.py
Expand Up @@ -239,15 +239,40 @@ def mac_release():
os.system('chmod -R o-w "Doomsday Engine.app"')
os.system('chmod -R o-w "Doomsday Shell.app"')

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

def fw_codesign(app):
print 'Signing libraries in %s...' % app
for f in glob.glob(app + '/Contents/Frameworks/*.dylib'):
codesign(f)

print 'Signing Qt frameworks in %s...' % app
for f in glob.glob(app + '/Contents/Frameworks/Qt*.framework'):
name = f[f.find('/Qt'):-10]
codesign(f + name)

print 'Signing Qt plugins in %s...' % app
for f in glob.glob(app + '/Contents/PlugIns/*/*.dylib'):
codesign(f)

fw_codesign('Doomsday Engine.app/Contents/Doomsday.app')
fw_codesign('Doomsday Shell.app')

print 'Signing Doomsday.app...'
os.system('codesign --verbose -s "Developer ID Application: Jaakko Keranen" "Doomsday Engine.app/Contents/Doomsday.app"')
codesign('Doomsday Engine.app/Contents/Doomsday.app/Contents/Frameworks/SDL.framework/SDL')
codesign("Doomsday Engine.app/Contents/Doomsday.app")

print 'Signing Doomsday Engine.app...'
os.system('codesign --verbose -s "Developer ID Application: Jaakko Keranen" "Doomsday Engine.app"')
os.system('ln -fs Versions/2.5/Python "Doomsday Engine.app/Contents/Frameworks/Python.framework/Python"')
codesign("Doomsday Engine.app/Contents/Frameworks/Python.framework/Python")
codesign("Doomsday Engine.app/Contents/Frameworks/libwx_macud-2.8.0.dylib")
codesign("Doomsday Engine.app/Contents/MacOS/python")
codesign("Doomsday Engine.app")

print 'Signing Doomsday Shell.app...'
os.system('codesign --verbose -s "Developer ID Application: Jaakko Keranen" "Doomsday Shell.app"')

codesign("Doomsday Shell.app")
print 'Creating disk:', target
os.system('osascript /Users/jaakko/Dropbox/Doomsday/package-installer.applescript')

Expand Down
15 changes: 15 additions & 0 deletions doomsday/postbuild/bundleapp.sh
Expand Up @@ -104,6 +104,14 @@ if [ -e plugins/fluidsynth/audio_fluidsynth.bundle ]; then
@executable_path/../Frameworks/libintl.8.dylib $DSFS
fi

if [ -e "$APPDIR/Frameworks/QtCore.framework/Versions/4" ]; then
echo "Fixing Qt 4 frameworks..."
ln -fs Versions/4/QtCore $APPDIR/Frameworks/QtCore.framework/QtCore
ln -fs Versions/4/QtGui $APPDIR/Frameworks/QtGui.framework/QtGui
ln -fs Versions/4/QtNetwork $APPDIR/Frameworks/QtNetwork.framework/QtNetwork
ln -fs Versions/4/QtOpenGL $APPDIR/Frameworks/QtOpenGL.framework/QtOpenGL
fi

echo "Bundling Doomsday Shell.app..."

BUILDDIR=tools/shell/shell-gui
Expand All @@ -114,4 +122,11 @@ mkdir -p "$APPDIR/Frameworks"
$CP libdeng2/libdeng2*dylib "$APPDIR/Frameworks"
$CP libshell/libdeng_shell*dylib "$APPDIR/Frameworks"

if [ -e "$APPDIR/Frameworks/QtCore.framework/Versions/4" ]; then
echo "Fixing Qt 4 frameworks..."
ln -fs Versions/4/QtCore "$APPDIR/Frameworks/QtCore.framework/QtCore"
ln -fs Versions/4/QtGui "$APPDIR/Frameworks/QtGui.framework/QtGui"
ln -fs Versions/4/QtNetwork "$APPDIR/Frameworks/QtNetwork.framework/QtNetwork"
fi

echo "Bundling done."

0 comments on commit 5cfd323

Please sign in to comment.