- paths: per-platform detection behind an injectable Env. Windows finds Player.log in the user profile and the install via Steam (registry), the standalone installer, Epic, or the uninstall registry. App dirs come from platformdirs (unchanged XDG locations on Linux). - logtail: open Player.log only while reading, so Windows can still rotate it when MTGA restarts. - carddb: on Windows read a private copy of the card database so MTGA's updater can replace the original. - App icon (SVG source + generated ICO/PNG), Windows taskbar identity, and a Windows-safe timer glyph. - PyInstaller spec, launcher and PowerShell build script producing a one-folder windowed build and zip. - Tests for path detection, the log follower and the card-DB copy; README covers Windows usage, building and per-OS locations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
43 lines
1.3 KiB
RPMSpec
43 lines
1.3 KiB
RPMSpec
# PyInstaller spec for MTGA Assistant: a one-folder, windowed build.
|
|
# Build on the target OS (PyInstaller can't cross-compile), e.g. on Windows:
|
|
# powershell -ExecutionPolicy Bypass -File packaging\build_windows.ps1
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(SPECPATH).parent
|
|
SRC = ROOT / "src"
|
|
|
|
a = Analysis(
|
|
[str(ROOT / "packaging" / "launch.py")],
|
|
pathex=[str(SRC)],
|
|
datas=[(str(SRC / "mtga_assistant" / "icon.png"), "mtga_assistant")],
|
|
# Qt modules the app doesn't use; keeps the bundle smaller.
|
|
excludes=[
|
|
"tkinter",
|
|
"PySide6.QtNetwork",
|
|
"PySide6.QtQml",
|
|
"PySide6.QtQuick",
|
|
"PySide6.QtSql",
|
|
"PySide6.QtTest",
|
|
"PySide6.QtOpenGL",
|
|
"PySide6.QtPdf",
|
|
],
|
|
noarchive=False,
|
|
)
|
|
# Not needed by a Qt Widgets app: the software OpenGL fallback (~20 MB) and Qt's translations.
|
|
a.binaries = [b for b in a.binaries if Path(b[0]).name.lower() != "opengl32sw.dll"]
|
|
a.datas = [d for d in a.datas if "translations" not in Path(d[0]).parts]
|
|
|
|
pyz = PYZ(a.pure)
|
|
|
|
exe = EXE(
|
|
pyz,
|
|
a.scripts,
|
|
[],
|
|
exclude_binaries=True,
|
|
name="MTGA Assistant",
|
|
console=False,
|
|
icon=str(ROOT / "assets" / "icon.ico") if sys.platform == "win32" else None,
|
|
)
|
|
coll = COLLECT(exe, a.binaries, a.datas, name="MTGA Assistant")
|