no-upx*
This commit is contained in:
parent
93c08e2338
commit
b425141855
2 changed files with 39 additions and 22 deletions
|
@ -62,8 +62,7 @@ Some of the include files are specific to my instalation, so you might have to e
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
sys.exit("KeyboardInterrupt")
|
sys.exit("KeyboardInterrupt")
|
||||||
|
|
||||||
exclude_modules = ['tkinter',
|
exclude_modules = ['collections.sys',
|
||||||
'collections.sys',
|
|
||||||
'collections._sre',
|
'collections._sre',
|
||||||
'collections._json',
|
'collections._json',
|
||||||
'collections._locale',
|
'collections._locale',
|
||||||
|
@ -92,7 +91,7 @@ exclude_modules = ['tkinter',
|
||||||
# (when QtMultimedia stops relying on local codecs </3)
|
# (when QtMultimedia stops relying on local codecs </3)
|
||||||
'pygame.examples',
|
'pygame.examples',
|
||||||
'pygame.tests',
|
'pygame.tests',
|
||||||
'pydoc_data'],
|
'pydoc_data']
|
||||||
|
|
||||||
add_data = ['quirks;quirks',
|
add_data = ['quirks;quirks',
|
||||||
'smilies;smilies',
|
'smilies;smilies',
|
||||||
|
@ -168,20 +167,19 @@ if sys.platform == 'win32':
|
||||||
'--clean', # Clear cache
|
'--clean', # Clear cache
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if (sys.version_info.major == 3) & (sys.version_info.minor == 8):
|
||||||
|
exclude_modules.append('tkinter')
|
||||||
if upx_enabled == True:
|
if upx_enabled == True:
|
||||||
if os.path.isdir(upx_dir):
|
if os.path.isdir(upx_dir):
|
||||||
run_win32.append('--upx-dir=%s' % upx_dir)
|
run_win32.append('--upx-dir=%s' % upx_dir)
|
||||||
else:
|
else:
|
||||||
run_win32.append('--noupx')
|
run_win32.append('--noupx')
|
||||||
|
|
||||||
for x in upx_exclude:
|
for x in upx_exclude:
|
||||||
run_win32.append('--upx-exclude=%s' % x )
|
run_win32.append('--upx-exclude=%s' % x )
|
||||||
# Lower case variants are required.
|
# Lower case variants are required.
|
||||||
run_win32.append('--upx-exclude=%s' % x.lower() )
|
run_win32.append('--upx-exclude=%s' % x.lower() )
|
||||||
|
|
||||||
for x in exclude_modules:
|
for x in exclude_modules:
|
||||||
run_win32.append('--exclude-module=%s' % x )
|
run_win32.append('--exclude-module=%s' % x )
|
||||||
|
|
||||||
for x in add_data:
|
for x in add_data:
|
||||||
run_win32.append('--add-data=%s' % x )
|
run_win32.append('--add-data=%s' % x )
|
||||||
|
|
||||||
|
@ -275,7 +273,10 @@ if sys.platform == 'win32':
|
||||||
run_win32.append('--add-binary=%s\\api-ms-win-crt-utility-l1-1-0.dll;.' % crt_path)
|
run_win32.append('--add-binary=%s\\api-ms-win-crt-utility-l1-1-0.dll;.' % crt_path)
|
||||||
run_win32.append('--add-binary=%s\\ucrtbase.dll;.' % crt_path)
|
run_win32.append('--add-binary=%s\\ucrtbase.dll;.' % crt_path)
|
||||||
|
|
||||||
|
print(run_win32)
|
||||||
|
|
||||||
PyInstaller.__main__.run(run_win32)
|
PyInstaller.__main__.run(run_win32)
|
||||||
|
|
||||||
#MacOS
|
#MacOS
|
||||||
elif sys.platform == 'darwin' :
|
elif sys.platform == 'darwin' :
|
||||||
run_darwin =[
|
run_darwin =[
|
||||||
|
@ -285,24 +286,28 @@ elif sys.platform == 'darwin' :
|
||||||
#'--noconfirm', # Overwrite output directory.
|
#'--noconfirm', # Overwrite output directory.
|
||||||
'--icon=trayicon32.icns', # Icon
|
'--icon=trayicon32.icns', # Icon
|
||||||
'--onedir',
|
'--onedir',
|
||||||
|
'--clean', # Clear cache
|
||||||
#'--noupx'
|
#'--noupx'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if upx_enabled == True:
|
||||||
|
if os.path.isdir(upx_dir):
|
||||||
|
run_darwin.append('--upx-dir=%s' % upx_dir)
|
||||||
|
else:
|
||||||
|
run_darwin.append('--noupx')
|
||||||
if os.path.isdir(upx_dir):
|
if os.path.isdir(upx_dir):
|
||||||
run_darwin.append('--upx-dir=%s' % upx_dir)
|
run_darwin.append('--upx-dir=%s' % upx_dir)
|
||||||
|
|
||||||
for x in upx_exclude:
|
for x in upx_exclude:
|
||||||
run_darwin.append('--upx-exclude=%s' % x )
|
run_darwin.append('--upx-exclude=%s' % x )
|
||||||
# Lower case variants are required.
|
# Lower case variants are required.
|
||||||
run_darwin.append('--upx-exclude=%s' % x.lower() )
|
run_darwin.append('--upx-exclude=%s' % x.lower() )
|
||||||
|
|
||||||
for x in exclude_modules:
|
for x in exclude_modules:
|
||||||
run_darwin.append('--exclude-module=%s' % x )
|
run_darwin.append('--exclude-module=%s' % x )
|
||||||
|
|
||||||
for x in add_data:
|
for x in add_data:
|
||||||
run_darwin.append('--add-data=%s' % x.replace(';',':') )
|
run_darwin.append('--add-data=%s' % x.replace(';',':') )
|
||||||
|
|
||||||
PyInstaller.__main__.run(run_darwin)
|
PyInstaller.__main__.run(run_darwin)
|
||||||
|
|
||||||
#Linux
|
#Linux
|
||||||
elif sys.platform == 'linux':
|
elif sys.platform == 'linux':
|
||||||
run_linux =[
|
run_linux =[
|
||||||
|
@ -311,42 +316,51 @@ elif sys.platform == 'linux':
|
||||||
#'--windowed', # Hide console
|
#'--windowed', # Hide console
|
||||||
#'--noconfirm', # Overwrite output directory.
|
#'--noconfirm', # Overwrite output directory.
|
||||||
'--icon=trayicon32.icns', # Icon
|
'--icon=trayicon32.icns', # Icon
|
||||||
|
'--clean', # Clear cache
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if upx_enabled == True:
|
||||||
|
if os.path.isdir(upx_dir):
|
||||||
|
run_linux.append('--upx-dir=%s' % upx_dir)
|
||||||
|
else:
|
||||||
|
run_linux.append('--noupx')
|
||||||
if os.path.isdir(upx_dir):
|
if os.path.isdir(upx_dir):
|
||||||
run_linux.append('--upx-dir=%s' % upx_dir)
|
run_linux.append('--upx-dir=%s' % upx_dir)
|
||||||
|
|
||||||
for x in upx_exclude:
|
for x in upx_exclude:
|
||||||
run_linux.append('--upx-exclude=%s' % x )
|
run_linux.append('--upx-exclude=%s' % x )
|
||||||
# Lower case variants are required.
|
# Lower case variants are required.
|
||||||
run_linux.append('--upx-exclude=%s' % x.lower() )
|
run_linux.append('--upx-exclude=%s' % x.lower() )
|
||||||
|
|
||||||
for x in exclude_modules:
|
for x in exclude_modules:
|
||||||
run_linux.append('--exclude-module=%s' % x )
|
run_linux.append('--exclude-module=%s' % x )
|
||||||
|
|
||||||
for x in add_data:
|
for x in add_data:
|
||||||
run_linux.append('--add-data=%s' % x.replace(';',':') )
|
run_linux.append('--add-data=%s' % x.replace(';',':') )
|
||||||
|
|
||||||
|
print(run_linux)
|
||||||
PyInstaller.__main__.run(run_linux)
|
PyInstaller.__main__.run(run_linux)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print("Unknown platform.")
|
print("Unknown platform.")
|
||||||
|
|
||||||
run_generic =[
|
run_generic =[
|
||||||
'pesterchum.py',
|
'pesterchum.py',
|
||||||
'--name=Pesterchum',
|
'--name=Pesterchum'
|
||||||
'--upx-dir=%s' % upx_dir # Set Upx directory. (I think it also works from path.)
|
'--clean', # Clear cache
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if upx_enabled == True:
|
||||||
|
if os.path.isdir(upx_dir):
|
||||||
|
run_generic.append('--upx-dir=%s' % upx_dir)
|
||||||
|
else:
|
||||||
|
run_generic.append('--noupx')
|
||||||
for x in upx_exclude:
|
for x in upx_exclude:
|
||||||
run_generic.append('--upx-exclude=%s' % x )
|
run_generic.append('--upx-exclude=%s' % x )
|
||||||
# Lower case variants are required.
|
# Lower case variants are required.
|
||||||
run_generic.append('--upx-exclude=%s' % x.lower() )
|
run_generic.append('--upx-exclude=%s' % x.lower() )
|
||||||
|
|
||||||
for x in exclude_modules:
|
for x in exclude_modules:
|
||||||
run_generic.append('--exclude-module=%s' % x )
|
run_generic.append('--exclude-module=%s' % x )
|
||||||
|
|
||||||
for x in add_data:
|
for x in add_data:
|
||||||
run_generic.append('--add-data=%s' % x.replace(';',':') )
|
run_generic.append('--add-data=%s' % x.replace(';',':') )
|
||||||
|
|
||||||
|
print(run_generic)
|
||||||
|
|
||||||
PyInstaller.__main__.run(run_generic)
|
PyInstaller.__main__.run(run_generic)
|
||||||
|
|
7
setup.py
7
setup.py
|
@ -38,8 +38,7 @@ build_exe_options = {
|
||||||
"includes": ['PyQt5.QtCore',
|
"includes": ['PyQt5.QtCore',
|
||||||
'PyQt5.QtGui',
|
'PyQt5.QtGui',
|
||||||
'PyQt5.QtWidgets'],
|
'PyQt5.QtWidgets'],
|
||||||
"excludes": ['tkinter',
|
"excludes": ['collections.sys',
|
||||||
'collections.sys',
|
|
||||||
'collections._sre',
|
'collections._sre',
|
||||||
'collections._json',
|
'collections._json',
|
||||||
'collections._locale',
|
'collections._locale',
|
||||||
|
@ -75,6 +74,10 @@ build_exe_options = {
|
||||||
# VCRUNTIME140.dll <3
|
# VCRUNTIME140.dll <3
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sys.platform == 'win32') & (sys.version_info.major == 3) & (sys.version_info.minor == 8):
|
||||||
|
build_exe_options["excludes"].append('tkinter')
|
||||||
|
|
||||||
|
|
||||||
bdist_mac_options = {
|
bdist_mac_options = {
|
||||||
'iconfile': 'trayicon32.icns',
|
'iconfile': 'trayicon32.icns',
|
||||||
'bundle_name': "Pesterchum"
|
'bundle_name': "Pesterchum"
|
||||||
|
|
Loading…
Reference in a new issue