- label_app.spec: one-file build bundling fonts, emoji data, ttkbootstrap themes and (on Windows) fribidi.dll so Pillow can shape emoji sequences - build-windows.ps1 helper; assets/icon.ico app icon - Fonts resolved from assets/fonts first, then system dirs, so the app runs from a bundle or a checkout on any OS - Bump Pillow pin to 12.3
49 lines
1.3 KiB
RPMSpec
49 lines
1.3 KiB
RPMSpec
# -*- mode: python ; coding: utf-8 -*-
|
|
# PyInstaller spec for the Niimbot label designer.
|
|
# Windows: pyinstaller label_app.spec -> dist/NiimbotLabel.exe
|
|
# Linux: pyinstaller label_app.spec -> dist/NiimbotLabel
|
|
# Build on the target OS; PyInstaller does not cross-compile.
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
from PyInstaller.utils.hooks import collect_data_files
|
|
|
|
ROOT = Path(SPECPATH)
|
|
|
|
datas = [
|
|
(str(ROOT / "assets" / "fonts"), "assets/fonts"),
|
|
*collect_data_files("emoji_data_python"), # emoji.json
|
|
*collect_data_files("ttkbootstrap"), # themes
|
|
]
|
|
|
|
# Pillow's Windows wheel needs fribidi.dll for raqm text shaping (emoji sequences)
|
|
binaries = []
|
|
if sys.platform == "win32":
|
|
binaries.append((str(ROOT / "assets" / "win" / "fribidi.dll"), "."))
|
|
|
|
a = Analysis(
|
|
[str(ROOT / "label_app.py")],
|
|
pathex=[str(ROOT)],
|
|
datas=datas,
|
|
binaries=binaries,
|
|
hiddenimports=["serial.tools.list_ports", "PIL.ImageTk", "PIL._tkinter_finder"],
|
|
excludes=["numpy", "matplotlib", "scipy", "pandas", "IPython"],
|
|
noarchive=False,
|
|
)
|
|
pyz = PYZ(a.pure)
|
|
|
|
exe = EXE(
|
|
pyz,
|
|
a.scripts,
|
|
a.binaries,
|
|
a.datas,
|
|
[],
|
|
name="NiimbotLabel",
|
|
icon=str(ROOT / "assets" / "icon.ico") if sys.platform == "win32" else None,
|
|
console=False, # GUI app: no console window
|
|
upx=False,
|
|
strip=False,
|
|
onefile=True,
|
|
)
|