deploy-ng: add icon support for macOS (#468)

This commit is contained in:
Mitchell Stokes 2019-08-18 11:12:59 +02:00 committed by rdb
parent f708402760
commit d3c9199d9f

View File

@ -506,6 +506,15 @@ class build_apps(setuptools.Command):
'CFBundleSignature': '', #TODO 'CFBundleSignature': '', #TODO
'CFBundleExecutable': self.macos_main_app, 'CFBundleExecutable': self.macos_main_app,
} }
icon = self.icon_objects.get(
self.macos_main_app,
self.icon_objects.get('*', None)
)
if icon is not None:
plist['CFBundleIconFile'] = 'iconfile'
icon.makeICNS(os.path.join(resdir, 'iconfile.icns'))
with open(os.path.join(contentsdir, 'Info.plist'), 'wb') as f: with open(os.path.join(contentsdir, 'Info.plist'), 'wb') as f:
if hasattr(plistlib, 'dump'): if hasattr(plistlib, 'dump'):
plistlib.dump(plist, f) plistlib.dump(plist, f)