This repository has been archived by the owner on Jul 21, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
j2dx.spec
142 lines (134 loc) · 3.61 KB
/
j2dx.spec
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# -*- mode: python ; coding: utf-8 -*-
import os
import platform
from pathlib import Path
from PyInstaller.utils.hooks import collect_submodules
APP = 'j2dx'
DEBUG = os.getenv('BUILD_MODE') == 'development'
block_cipher = None
hidden_imports = [
'engineio.async_drivers.eventlet',
*collect_submodules('eventlet.hubs'),
*collect_submodules('dns'),
]
linux_data = [
(f'assets/tk.ozymandias.{APP}.desktop', 'usr/share/applications'),
(f'assets/tk.ozymandias.{APP}.svg', 'usr/share/icons/hicolor'),
(f'assets/tk.ozymandias.{APP}.appdata.xml', 'usr/share/metainfo'),
]
windows_binaries = [
('C:/Windows/System32/msvcp140.dll', '.'),
('C:/Windows/System32/concrt140.dll', '.'),
('C:/Windows/System32/downlevel/api-ms-win-crt-runtime-l1-1-0.dll', 'crt'),
('C:/Windows/System32/downlevel/api-ms-win-crt-heap-l1-1-0.dll', 'crt'),
('C:/Windows/System32/downlevel/api-ms-win-crt-string-l1-1-0.dll', 'crt'),
('C:/Windows/System32/downlevel/api-ms-win-crt-locale-l1-1-0.dll', 'crt'),
('C:/Windows/System32/downlevel/api-ms-win-crt-stdio-l1-1-0.dll', 'crt'),
('C:/Windows/System32/downlevel/api-ms-win-crt-filesystem-l1-1-0.dll', 'crt'),
('C:/Windows/System32/downlevel/api-ms-win-crt-time-l1-1-0.dll', 'crt'),
('C:/Windows/System32/downlevel/api-ms-win-crt-environment-l1-1-0.dll', 'crt'),
('C:/Windows/System32/downlevel/api-ms-win-crt-math-l1-1-0.dll', 'crt'),
('C:/Windows/System32/downlevel/api-ms-win-crt-convert-l1-1-0.dll', 'crt'),
('C:/Windows/System32/downlevel/api-ms-win-crt-utility-l1-1-0.dll', 'crt'),
('j2dx/win/ViGEm/x64/ViGEmClient.dll', 'x64'),
('j2dx/win/ViGEm/x86/ViGEmClient.dll', 'x86'),
]
if platform.system() == 'Linux':
a = Analysis(
['j2dx/__init__.py'],
pathex=[Path.cwd()],
binaries=[],
datas=linux_data,
hiddenimports=hidden_imports,
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)
pyz = PYZ(
a.pure,
a.zipped_data,
cipher=block_cipher,
)
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name=APP,
debug=DEBUG,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True,
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name=APP,
)
try:
launcher = Path(f'{DISTPATH}/{APP}/tk.ozymandias.{APP}.desktop')
if launcher.exists():
launcher.unlink()
launcher.symlink_to(f'usr/share/applications/tk.ozymandias.{APP}.desktop')
icon = Path(f'{DISTPATH}/{APP}/tk.ozymandias.{APP}.svg')
if icon.exists():
icon.unlink()
icon.symlink_to(f'usr/share/icons/hicolor/tk.ozymandias.{APP}.svg')
dir_icon = Path(f'{DISTPATH}/{APP}/.DirIcon')
if dir_icon.exists():
dir_icon.unlink()
dir_icon.symlink_to(f'usr/share/icons/hicolor/tk.ozymandias.{APP}.svg')
app_run = Path(f'{DISTPATH}/{APP}/AppRun')
if app_run.exists():
app_run.unlink()
app_run.symlink_to(f'{APP}')
except Exception as e:
print(f'ERROR CREATING SYMLINKS::{e.errno}')
else:
a = Analysis(
['j2dx/__init__.py'],
pathex=[Path.cwd()],
binaries=windows_binaries,
datas=[],
hiddenimports=hidden_imports,
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)
pyz = PYZ(
a.pure,
a.zipped_data,
cipher=block_cipher,
)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name=APP,
debug=DEBUG,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=['vcruntime140.dll'],
runtime_tmpdir=None,
console=True,
icon='assets/j2dx.ico',
version='assets/version.rc',
)