Add PyInstaller spec for Windows

This commit is contained in:
Stephen Horvath
2025-03-24 20:50:34 +10:00
parent d65a033523
commit 076f903fbc
6 changed files with 51 additions and 4 deletions

2
.gitignore vendored
View File

@@ -30,7 +30,7 @@ MANIFEST
# Usually these files are written by a python script from a template # Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it. # before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest *.manifest
*.spec #*.spec
# Installer logs # Installer logs
pip-log.txt pip-log.txt

View File

@@ -1,2 +1 @@
include yafi/ui/*.ui
include yafi/yafi.gresource include yafi/yafi.gresource

View File

@@ -1,7 +1,7 @@
# Yet Another Framework Interface # Yet Another Framework Interface
YAFI is another GUI for the Framework Laptop Embedded Controller. YAFI is another GUI for the Framework Laptop Embedded Controller.
It is written in Python with a GTK4 Adwaita theme, and uses the `CrOS_EC_Python` library to communicate with the EC. It is written in Python with a GTK4 Adwaita theme, and uses the [`CrOS_EC_Python`](https://github.com/Steve-Tech/CrOS_EC_Python) library to communicate with the EC.
It has support for fan control, temperature monitoring, LED control, and battery limiting. It has support for fan control, temperature monitoring, LED control, and battery limiting.

5
pyinstaller/winyafi.py Normal file
View File

@@ -0,0 +1,5 @@
import os
os.environ["GDK_SCALE"] = "2"
from yafi import main
main()

43
pyinstaller/winyafi.spec Normal file
View File

@@ -0,0 +1,43 @@
# -*- mode: python ; coding: utf-8 -*-
from PyInstaller.utils.hooks import collect_data_files
datas = []
datas += collect_data_files('yafi')
a = Analysis(
['winyafi.py'],
pathex=[],
binaries=[('WinRing0x64.dll', '.')],
datas=datas,
hiddenimports=['cros_ec_python'],
hookspath=[],
hooksconfig={"gi":{"module-versions": {"Gtk": "4.0"}}},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='winyafi',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
uac_admin=True,
)

View File

@@ -8,7 +8,7 @@ description = "Yet Another Framework Interface"
readme = "README.md" readme = "README.md"
requires-python = ">=3.10" requires-python = ">=3.10"
dependencies = [ dependencies = [
"cros_ec_python >= 0.0.2", "cros_ec_python >= 0.0.3",
"PyGObject" "PyGObject"
] ]
classifiers = [ classifiers = [