From 1fc9b2941d20707847160b15b06b20c2abd7baeb Mon Sep 17 00:00:00 2001 From: blitzmann Date: Sun, 12 Nov 2017 13:43:19 -0500 Subject: [PATCH] Add spac file for mac --- pyfa-mac.spec | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 pyfa-mac.spec diff --git a/pyfa-mac.spec b/pyfa-mac.spec new file mode 100644 index 000000000..d10728185 --- /dev/null +++ b/pyfa-mac.spec @@ -0,0 +1,71 @@ +# -*- mode: python -*- + +import os +from itertools import chain +import subprocess + +label = subprocess.check_output([ + "git", "describe", "--tags"]).strip() + +with open('gitversion', 'w+') as f: + f.write(label.decode()) + +block_cipher = None + +added_files = [ + ( 'imgs/gui/*.png', 'imgs/gui' ), + ( 'imgs/gui/*.gif', 'imgs/gui' ), + ( 'imgs/icons/*.png', 'imgs/icons' ), + ( 'imgs/renders/*.png', 'imgs/renders' ), + ( 'dist_assets/win/pyfa.ico', '.' ), + ( 'dist_assets/cacert.pem', '.' ), + ( 'eve.db', '.' ), + ( 'README.md', '.' ), + ( 'LICENSE', '.' ), + ( 'gitversion', '.' ), + ] + +import_these = [] + +# Walk directories that do dynamic importing +paths = ('eos/effects', 'eos/db/migrations', 'service/conversions') +for root, folders, files in chain.from_iterable(os.walk(path) for path in paths): + for file_ in files: + if file_.endswith(".py") and not file_.startswith("_"): + mod_name = "{}.{}".format( + root.replace("/", "."), + file_.split(".py")[0], + ) + import_these.append(mod_name) + +a = Analysis([r'pyfa.py'], + pathex=[], + binaries=[], + datas=added_files, + hiddenimports=import_these, + hookspath=[], + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + 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='pyfa', + debug=False, + strip=False, + upx=True, + runtime_tmpdir=None, + console=False , + icon='dist_assets/mac/pyfa.icns', + ) + +app = BUNDLE(exe, + name='pyfa.app', + icon=None, + bundle_identifier=None) \ No newline at end of file