# -*- mode: python ; coding: utf-8 -*- """PyInstaller spec for the MoonBite desktop wallet. Build with: pyinstaller moonbite.spec Creates a ONE-DIRECTORY build (dist/MoonBite/): - Windows: dist/MoonBite/MoonBite.exe + its DLLs and Python runtime beside it - macOS: dist/MoonBite.app - Linux: dist/MoonBite/MoonBite Antivirus hygiene (docs/ADR-013-miner-distribution-policy.md). The choices below are deliberate; do not "optimise" them away: - upx=False. UPX packing is the single most common heuristic trigger for "unknown packed executable". A larger download is cheaper than a quarantine. - One-directory, not --onefile. A onefile build is a self-extracting stub that unpacks the whole runtime into %TEMP% on every start and executes it from there, which is exactly the pattern droppers use and which many engines score against. Onedir runs in place, from the folder the user unzipped. Do NOT pass --onefile on the command line. - A full VERSIONINFO resource (windows-version-info.txt): CompanyName, FileDescription, ProductName, FileVersion. A binary with an empty version block scores worse than one that says who made it. - No runtime_tmpdir, no bootloader tricks, no obfuscation, no cipher. - codesign_identity stays None until a legal entity exists to hold a certificate; releases rely on checksums, minisign and build attestations (see the ADR). skip_notarization=True for the same reason. This spec builds the WALLET only. It must never pull in moonbited, the mine scripts or any mining code: the miner is a separate download by policy. """ import sys from pathlib import Path block_cipher = None ICON = 'website/favicon.svg' if Path('website/favicon.svg').exists() else None # Windows VERSIONINFO resource; ignored on other platforms by PyInstaller. VERSION_FILE = 'windows-version-info.txt' if Path('windows-version-info.txt').exists() else None a = Analysis( ['gui.py'], pathex=[], binaries=[], datas=[], hiddenimports=['PyQt6.QtCore', 'PyQt6.QtGui', 'PyQt6.QtWidgets', 'ecdsa', 'mnemonic'], hookspath=[], hooksconfig={}, runtime_hooks=[], excludedimports=[], win_no_prefer_redirects=False, win_private_assemblies=False, cipher=block_cipher, noarchive=False, ) pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) # exclude_binaries=True + COLLECT below = one-directory build. exe = EXE( pyz, a.scripts, [], exclude_binaries=True, name='MoonBite', debug=False, bootloader_ignore_signals=False, strip=False, upx=False, console=False, disable_windowed_traceback=False, target_arch=None, codesign_identity=None, entitlements_file=None, version=VERSION_FILE, icon=ICON, ) coll = COLLECT( exe, a.binaries, a.zipfiles, a.datas, strip=False, upx=False, upx_exclude=[], name='MoonBite', ) app = BUNDLE( coll, name='MoonBite.app', icon=ICON, bundle_identifier='org.moonbite.wallet', info_plist={ 'NSPrincipalClass': 'NSApplication', 'NSHighResolutionCapable': 'True', }, bootloader_ignore_signals=False, skip_notarization=True, )