Files
dxdesigner-part-replacement/packaging/DxPartReplace.spec
T

97 lines
2.4 KiB
RPMSpec

# -*- mode: python ; coding: utf-8 -*-
"""PyInstaller definition for the automatic DxDesigner replacement tool."""
from pathlib import Path
import shutil
import win32com.client.gencache
project_root = Path(SPECPATH).parent
generated_root = project_root / "build" / "DxPartReplace-generated"
generated_root.mkdir(parents=True, exist_ok=True)
viewdraw_api = win32com.client.gencache.EnsureModule(
"{4ADEF4E1-690A-11CE-9261-0020C5E26659}", 0, 1, 0
)
if viewdraw_api is None:
raise RuntimeError("DxDesigner EE 7.9.5 type library is required for packaging")
shutil.copyfile(viewdraw_api.__file__, generated_root / "viewdraw_api.py")
legacy_runtime_datas = [
(
str(project_root / "integration" / "dxdesigner795" / "QuickPartReplace.vbs"),
"legacy-runtime/dxdesigner795",
),
]
a = Analysis(
[str(project_root / "src" / "dx_productivity" / "trial_task_center" / "application.py")],
pathex=[str(project_root / "src"), str(generated_root)],
binaries=[],
datas=legacy_runtime_datas,
hiddenimports=[
"viewdraw_api",
"win32com.client",
"win32com.client.dynamic",
"win32con",
"win32gui",
"win32process",
"pywinauto",
"pywinauto.controls.uiawrapper",
],
excludes=[
"PySide6.QtDesigner",
"PySide6.QtMultimedia",
"PySide6.QtMultimediaWidgets",
"PySide6.QtOpenGL",
"PySide6.QtOpenGLWidgets",
"PySide6.QtPdf",
"PySide6.QtPdfWidgets",
"PySide6.QtQml",
"PySide6.QtQuick",
"PySide6.QtQuickWidgets",
"PySide6.QtWebChannel",
"PySide6.QtWebEngineCore",
"PySide6.QtWebEngineWidgets",
],
noarchive=False,
)
excluded_qt_binaries = {
"icudt78.dll",
"icuuc.dll",
"qpdf.dll",
"qt6pdf.dll",
"qt6qml.dll",
"qt6qmlmeta.dll",
"qt6qmlmodels.dll",
"qt6qmlworkerscript.dll",
"qt6quick.dll",
}
a.binaries = [
entry
for entry in a.binaries
if Path(entry[0]).name.casefold() not in excluded_qt_binaries
]
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name='DxPartReplace',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=False,
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name="DxPartReplace",
)