summarylogtreecommitdiffstats
path: root/main.spec
blob: 86ecc88c62ccd2fe4f4e18139c36c1a50cac570a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# -*- mode: python ; coding: utf-8 -*-

a = Analysis(
    ["main.py"],
    pathex=[
        '/usr/lib'
    ],
    binaries=[],
    datas=[("icon.ico", "."), ("data.json", ".")],
    hiddenimports=[
        "tiktoken_ext.openai_public",
        "tiktoken_ext",
        "PySide6",
        "PySide6.QtCore",
        "PySide6.QtGui",
        "qfluentwidgets",
    ],
    hookspath=[],
    hooksconfig={},
    runtime_hooks=[],
    excludes=[],
    noarchive=False,
    optimize=0,
)

exclude_prefix = [
    "PySide6/Qt6Pdf",
    "PySide6/Qt6Network",
    "PySide6/QtNetwork",
    "PySide6/Qt6VirtualKeyboard",
    "PySide6/Qt6Qml",
    "PySide6/Qt6Quick",
    "PySide6/Qt6OpenGL",
    "PySide6/Qt6QmlModels",
    "PySide6/translations",
]


def should_include(t):
    return not any(t[0].startswith(prefix) for prefix in exclude_prefix)


a.binaries = list(filter(should_include, a.binaries))
a.datas = list(filter(should_include, a.datas))

pyz = PYZ(a.pure)


exe = EXE(
    pyz,
    a.scripts,
    a.binaries,
    a.datas,
    [],
    name="sakura_launcher",
    debug=False,
    bootloader_ignore_signals=False,
    strip=False,
    upx=False,  # https://pyinstaller.org/en/stable/usage.html#using-upx
    upx_exclude=[],
    runtime_tmpdir=None,
    console=True,
    disable_windowed_traceback=False,
    argv_emulation=False,
    target_arch=None,
    codesign_identity=None,
    entitlements_file=None,
)