1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
|
# -*- mode: python -*-
block_cipher = None
# This is the spec file to be run with pyinstaller.
# However, it's what amounts to a python script, so
# we can do some incredibly cursed things to make
# sure it builds, and the way we want it to.
# For some reason we need to explicitly include the current directory. Unsure why.
import os
import sys
file_dir = os.path.dirname(".")
sys.path.append(file_dir)
# We're grabbing the current git SHA short to use in the version.
from util.hashed_version import writeVersionPlusHash
version = writeVersionPlusHash()
a = Analysis(
["bin/manuskript"],
pathex=["."],
binaries=None,
datas=[
("icons", "icons"),
("libs", "libs"),
("resources", "resources"),
("sample-projects", "sample-projects"),
("i18n", "i18n"),
],
hiddenimports=["xml.dom"],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE(
pyz,
a.scripts,
exclude_binaries=True,
name="manuskript",
debug=False,
strip=False,
upx=True,
console=True,
icon=os.path.join(SPECPATH, "icons/Manuskript/manuskript.ico"),
)
wexe = EXE(
pyz,
a.scripts,
exclude_binaries=True,
name="manuskriptw",
debug=False,
strip=False,
upx=True,
console=False,
icon=os.path.join(SPECPATH, "icons/Manuskript/manuskript.ico"),
)
coll = COLLECT(
exe, wexe, a.binaries, a.zipfiles, a.datas, strip=False, upx=True, name="manuskript"
)
app = BUNDLE(
coll,
name="manuskript.app",
icon=os.path.join(SPECPATH, "icons/Manuskript/Manuskript.icns"),
bundle_identifier="ch.theologeek.manuskript",
version=version,
info_plist={
"NSPrincipalClass": "NSApplication",
"NSAppleScriptEnabled": False,
"NSHighResolutionCapable": True,
"CFBundleURLTypes": [
{
"CFBundleURLName": "MSK",
"CFBundleTypeRole": "Editor",
"CFBundleURLSchemes": ["msk"],
}
],
"CFBundleDocumentTypes": [
{
"CFBundleTypeName": "MSK",
"CFBundleTypeIconFile": "icons/Manuscript/manuskript",
"CFBundleTypeExtensions": ["msk"],
"CFBundleTypeRole": "Editor",
"LSHandlerRank": "Owner",
}
],
},
)
|