Skip to content

Commit

Permalink
Add files for v1.0.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
odest committed Sep 4, 2024
1 parent 1a2948f commit 484aa3d
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ MANIFEST
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
Expand Down
86 changes: 86 additions & 0 deletions main.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# -*- mode: python ; coding: utf-8 -*-
# vi: ft=python


from argparse import ArgumentParser
import sys
from PyInstaller.building.api import COLLECT, EXE, PYZ
from PyInstaller.building.build_main import Analysis
from PyInstaller.building.osx import BUNDLE


parser = ArgumentParser()
parser.add_argument('--portable', action='store_true')
options = parser.parse_args()


name = 'DonkeyDoc' if sys.platform == 'win32' else 'donkeydoc'
icon = None
if sys.platform == 'win32':
icon = 'docs/logo.ico'
elif sys.platform == 'darwin':
icon = 'docs/logo.icns'


a = Analysis(
['main.py'],
pathex=[],
binaries=[],
datas=[('docs', './docs'), ('app', './app'), ('lib', './lib')],
hiddenimports=[],
hookspath=[],
hooksconfig={},
excludes=[],
runtime_hooks=[],
noarchive=False,
optimize=0,
)

pyz = PYZ(a.pure)

include = [a.scripts]
if options.portable:
include += (a.binaries, a.datas)
exe = EXE(
pyz,
*include,
[],
bootloader_ignore_signals=False,
console=False,
hide_console='hide-early',
disable_windowed_traceback=False,
debug=False,
name=name,
exclude_binaries=not options.portable,
icon=icon,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None
)

coll = None if options.portable else COLLECT(
exe,
a.binaries,
a.datas,
name=name,
strip=False,
upx=True,
upx_exclude=[],
)

app = BUNDLE(
exe if coll is None else coll,
name='DonkeyDoc.app',
icon=icon,
bundle_identifier='com.github.donkeydocdev',
version='0.0.0',
info_plist={
'NSAppleScriptEnabled': False,
'NSPrincipalClass': 'NSApplication',
}
)

0 comments on commit 484aa3d

Please sign in to comment.