-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: pyinstaller spec file for Mac OS X
- Loading branch information
1 parent
6a6cbfa
commit e22d6eb
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# -*- mode: python -*- | ||
|
||
from importlib.machinery import SourceFileLoader | ||
|
||
version = SourceFileLoader("module.name", os.path.abspath(".")+os.sep+"version.py").load_module() | ||
Oe2sSLE_VERSION = version.Oe2sSLE_VERSION | ||
|
||
def resource_path(relative_path): | ||
""" Get absolute path to resource, works for dev and for PyInstaller """ | ||
try: | ||
# PyInstaller creates a temp folder and stores path in _MEIPASS | ||
base_path = sys._MEIPASS | ||
except Exception: | ||
base_path = os.path.abspath(".") | ||
|
||
return os.path.join(base_path, relative_path) | ||
|
||
|
||
block_cipher = None | ||
|
||
|
||
added_files = [ | ||
( 'images','images'), | ||
] | ||
|
||
a = Analysis(['Oe2sSLE_GUI.py'], | ||
pathex=['.'], | ||
binaries=None, | ||
datas=added_files, | ||
hiddenimports=[], | ||
hookspath=[], | ||
runtime_hooks=[], | ||
excludes=[], | ||
cipher=block_cipher) | ||
|
||
pyz = PYZ(a.pure, a.zipped_data, | ||
cipher=block_cipher) | ||
exe = EXE(pyz, | ||
a.scripts, | ||
a.binaries, | ||
a.zipfiles, | ||
a.datas, | ||
name='Oe2sSLE-'+str(Oe2sSLE_VERSION[0])+'.'+str(Oe2sSLE_VERSION[1])+'.'+str(Oe2sSLE_VERSION[2])+'-osx-x64', | ||
debug=False, | ||
strip=False, | ||
upx=True, | ||
console=False ) | ||
|
||
app = BUNDLE(exe, | ||
name='Oe2sSLE-'+str(Oe2sSLE_VERSION[0])+'.'+str(Oe2sSLE_VERSION[1])+'.'+str(Oe2sSLE_VERSION[2])+'.app', | ||
icon=None, | ||
bundle_identifier=None) |