From e22d6eb6642489945b36613ef09f6cecc6740bef Mon Sep 17 00:00:00 2001 From: Jonathan Taquet Date: Thu, 20 Oct 2016 22:57:36 +0200 Subject: [PATCH] add: pyinstaller spec file for Mac OS X --- osx-x64-Oe2sSLE_GUI.spec | 52 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100755 osx-x64-Oe2sSLE_GUI.spec diff --git a/osx-x64-Oe2sSLE_GUI.spec b/osx-x64-Oe2sSLE_GUI.spec new file mode 100755 index 0000000..18d3ce6 --- /dev/null +++ b/osx-x64-Oe2sSLE_GUI.spec @@ -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)