-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmdu.spec
104 lines (92 loc) · 2.62 KB
/
mdu.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
# -*- mode: python ; coding: utf-8 -*-
import sys
import os
from PySide6 import QtCore
import platform
# Determine the current platform
current_platform = platform.system().lower()
# Get Qt plugin directories
qt_plugin_path = os.path.join(os.path.dirname(QtCore.__file__), "plugins")
# Specify the bin folder path
bin_folder = os.path.join(os.getcwd(), 'bin')
# Platform specific configurations
if current_platform == "windows":
bin_include = [(os.path.join(bin_folder, 'win'), 'bin/win')]
icon = os.path.join("icon", "win", "icon.ico")
elif current_platform == "darwin":
bin_include = [(os.path.join(bin_folder, 'mac'), 'bin/mac')]
icon = os.path.join("icon", "mac", "icon.icns")
block_cipher = None
a = Analysis(
['main.py'],
pathex=[],
binaries=[],
datas=[
*bin_include, # Include platform-specific binaries
('info.json', '.'), # Include info.json in root
],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=['tkinter'],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)
# Collect Qt plugins
qt_plugins = [
('platforms', os.path.join(qt_plugin_path, 'platforms')),
('styles', os.path.join(qt_plugin_path, 'styles')),
]
for plugin_type, plugin_path in qt_plugins:
if os.path.exists(plugin_path):
a.datas += Tree(plugin_path, prefix=os.path.join('PySide6', 'plugins', plugin_type))
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name='mdu',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=False,
disable_windowed_traceback=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=icon,
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='mdu',
)
# macOS specific
if current_platform == "darwin":
app = BUNDLE(
coll,
name='MDU YouTube Downloader.app',
icon=icon,
bundle_identifier='com.mdu.ytdownloader',
info_plist={
'CFBundleShortVersionString': "2024.12.22",
'CFBundleVersion': "2024.12.22",
'CFBundleName': 'MDU YouTube Downloader',
'CFBundleDisplayName': 'MDU YouTube Downloader',
'CFBundleIdentifier': 'com.mdu.ytdownloader',
'CFBundlePackageType': 'APPL',
'CFBundleSignature': '????',
'LSMinimumSystemVersion': '10.13.0',
'NSHighResolutionCapable': True,
}
)