Added support for --onefile on spec files

This commit is contained in:
RemixDev 2020-09-08 14:18:21 +02:00
parent 326ea8a112
commit 79ff9ba88e
2 changed files with 53 additions and 25 deletions

View file

@ -1,7 +1,5 @@
# -*- mode: python ; coding: utf-8 -*-
import deemix
import sys
from os.path import dirname
block_cipher = None
@ -31,7 +29,7 @@ if sys.platform.startswith('darwin'):
strip=False,
upx=True,
console=False,
icon=f"icon.icns")
icon="icon.icns")
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
@ -44,6 +42,21 @@ if sys.platform.startswith('darwin'):
name='deemix-pyweb.app',
icon="icon.icns",
bundle_identifier=None)
elif '--onefile' in sys.argv or '-F' in sys.argv:
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='deemix-pyweb',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False , icon='icon.ico')
else:
exe = EXE(pyz,
a.scripts,
@ -55,7 +68,7 @@ else:
strip=False,
upx=True,
console=False,
icon=f"icon.ico")
icon="icon.ico")
coll = COLLECT(exe,
a.binaries,
a.zipfiles,

View file

@ -1,7 +1,5 @@
# -*- mode: python ; coding: utf-8 -*-
import deemix
import sys
from os.path import dirname
block_cipher = None
@ -9,7 +7,7 @@ sys.modules['FixTk'] = None
a = Analysis(['server.py'],
binaries=[],
datas=[('webui/public', 'webui')],
datas=[('webui/public', 'webui'), ('icon.ico', '.')],
hiddenimports=['engineio.async_drivers.threading', 'pkg_resources.py2_warn'],
hookspath=[],
runtime_hooks=[],
@ -20,21 +18,38 @@ a = Analysis(['server.py'],
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
[],
exclude_binaries=True,
name='deemix_webui',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True )
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='server')
if '--onefile' in sys.argv or '-F' in sys.argv:
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='deemix-server',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True , icon='icon.ico')
else:
exe = EXE(pyz,
a.scripts,
[],
exclude_binaries=True,
name='deemix-server',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True,
icon="icon.ico")
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='deemix-server')