-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain-macos.spec
More file actions
102 lines (91 loc) · 2.36 KB
/
main-macos.spec
File metadata and controls
102 lines (91 loc) · 2.36 KB
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
# -*- mode: python ; coding: utf-8 -*-
import os
data_files = [
('data/add-one-hover.svg', 'data'),
('data/add-one.svg', 'data'),
('data/close-one-hover.svg', 'data'),
('data/close-one.svg', 'data'),
('data/Music bot.png','data'),
('data/reduce-one-hover.svg','data'),
('data/reduce-one.svg','data'),
('data/refresh-1.svg','data'),
('data/refresh.svg','data'),
('data/shuffle.svg','data'),
('data/volume-down.svg','data'),
('data/volume-mute.svg','data'),
('data/volume-notice.svg','data'),
('data/volume-up.svg','data'),
('data/edit-add.svg','data'),
('data/edit-clear.svg','data'),
('data/Music bot.icns','data')
]
if os.path.exists('.env'):
data_files.append(('.env', '.'))
a = Analysis(
['main.py'],
pathex=['core', 'ui'],
binaries=[],
datas=data_files,
hiddenimports=[
'PIL', 'PIL.Image',
'pydub', 'PyQt5', 'numpy', 'qasync', 'mutagen', 'pyimgur', 'dotenv', 'pyqtgraph', 'pypresence'
],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name='BIT_SCRIPTS_-_Musique',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon='data/Music bot.icns',
)
coll = COLLECT(
exe,
a.binaries,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='BIT_SCRIPTS_-_Musique',
)
app = BUNDLE(
coll,
name='BIT_SCRIPTS_-_Musique.app',
icon='data/Music bot.icns',
bundle_identifier=None,
)
## Make app bundle double-clickable
import plistlib
from pathlib import Path
app_path = Path(app.name)
# read Info.plist
with open(app_path / 'Contents/Info.plist', 'rb') as f:
pl = plistlib.load(f)
# write Info.plist
with open(app_path / 'Contents/Info.plist', 'wb') as f:
pl['CFBundleExecutable'] = 'wrapper'
plistlib.dump(pl, f)
# write new wrapper script
shell_script = """#!/bin/bash
dir=$(dirname $0)
open file://${dir}/%s &> /dev/null &""" % app.appname
with open(app_path / 'Contents/MacOS/wrapper', 'w') as f:
f.write(shell_script)
# make it executable
(app_path / 'Contents/MacOS/wrapper').chmod(0o755)