Add a plist to the utils bundle

Also move it to where it is easy to sign
This commit is contained in:
Kovid Goyal 2019-08-30 13:59:11 +05:30
parent 1db4a15d89
commit 133ed8968f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 25 additions and 6 deletions

View File

@ -168,7 +168,7 @@ class Freeze(object):
self.resources_dir = join(self.contents_dir, 'Resources')
self.frameworks_dir = join(self.contents_dir, 'Frameworks')
self.exe_dir = join(self.contents_dir, 'MacOS')
self.helpers_dir = join(self.build_dir, 'Helpers', 'utils.app', 'Contents', 'MacOS')
self.helpers_dir = join(self.contents_dir, 'utils.app', 'Contents', 'MacOS')
self.site_packages = join(self.resources_dir, 'Python', 'site-packages')
self.to_strip = []
self.warnings = []
@ -375,6 +375,24 @@ class Freeze(object):
dest = join(cdir, 'Resources')
src = self.resources_dir
os.symlink(os.path.relpath(src, cdir), dest)
pl = dict(
CFBundleDevelopmentRegion='English',
CFBundleDisplayName=APPNAME + ' - utils',
CFBundleName=APPNAME + '-utils',
CFBundleIdentifier='com.calibre-ebook.utils',
LSBackgroundOnly='1',
CFBundleVersion=VERSION,
CFBundleShortVersionString=VERSION,
CFBundlePackageType='APPL',
CFBundleSignature='????',
CFBundleExecutable='pdftohtml',
LSMinimumSystemVersion='10.14.0',
LSRequiresNativeExecution=True,
NSAppleScriptEnabled=False,
CFBundleIconFile='',
)
with open(join(cdir, 'Info.plist'), 'wb') as p:
plistlib.dump(pl, p)
@flush
def add_calibre_plugins(self):
@ -412,7 +430,7 @@ class Freeze(object):
CFBundleSignature='????',
CFBundleExecutable='calibre',
CFBundleDocumentTypes=docs,
LSMinimumSystemVersion='10.9.5',
LSMinimumSystemVersion='10.14.0',
LSRequiresNativeExecution=True,
NSAppleScriptEnabled=False,
NSHumanReadableCopyright=time.strftime('Copyright %Y, Kovid Goyal'),

View File

@ -109,7 +109,8 @@ def do_sign_app(appdir):
# Sign everything in MacOS except the main executables of the various
# app bundles which will be signed automatically by codesign when
# signing the app bundles
with current_dir('MacOS'):
for MacOS in ('MacOS', 'utils.app/Contents/MacOS'):
with current_dir(MacOS):
items = set(os.listdir('.')) - executables
codesign(expand_dirs(items))

View File

@ -34,7 +34,7 @@ def popen(cmd, **kw):
if isosx and hasattr(sys, 'frameworks_dir'):
base = os.path.join(os.path.dirname(os.path.dirname(sys.frameworks_dir)), 'Helpers', 'utils.app', 'Contents', 'MacOS')
base = os.path.join(os.path.dirname(sys.frameworks_dir), 'utils.app', 'Contents', 'MacOS')
PDFTOHTML = os.path.join(base, PDFTOHTML)
if iswindows and hasattr(sys, 'frozen'):
base = sys.extensions_location if hasattr(sys, 'new_app_layout') else os.path.dirname(sys.executable)