diff options
Diffstat (limited to 'backend/pyinstaller.spec')
| -rw-r--r-- | backend/pyinstaller.spec | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/backend/pyinstaller.spec b/backend/pyinstaller.spec index 13ac66a0..3ef888f5 100644 --- a/backend/pyinstaller.spec +++ b/backend/pyinstaller.spec @@ -3,21 +3,38 @@ from PyInstaller.building.build_main import Analysis from PyInstaller.building.api import EXE, PYZ from PyInstaller.utils.hooks import copy_metadata +noconsole_str = os.getenv('DECKY_NOCONSOLE', '0') +noconsole = bool(noconsole_str) +repo = os.getenv('DECKY_REPO', 'SteamDeckHomebrew/decky-loader') +branch = os.getenv('DECKY_BRANCH', 'main') +with open('build_config.py', 'w') as f: + f.write(f""" +import os +os.environ['DECKY_PACKAGED_BUILD'] = '1' + +# Build info +os.environ['DECKY_REPO'] = {repr(repo)} +os.environ['DECKY_BRANCH'] = {repr(branch)} + +# Windows-specific +os.environ['DECKY_NOCONSOLE'] = {repr(noconsole_str)} +""") + +name = "PluginLoader" +# if noconsole: +# name += "_noconsole" + a = Analysis( ['main.py'], datas=[ ('decky_loader/locales', 'decky_loader/locales'), ('decky_loader/static', 'decky_loader/static'), ] + copy_metadata('decky_loader'), + runtime_hooks=['build_config.py'], hiddenimports=['logging.handlers', 'sqlite3', 'http.server', 'socketserver', 'configparser', 'decky_plugin', 'decky'], ) pyz = PYZ(a.pure, a.zipped_data) -noconsole = bool(os.getenv('DECKY_NOCONSOLE')) -name = "PluginLoader" -if noconsole: - name += "_noconsole" - exe = EXE( pyz, a.scripts, |
