forked from Taiko2k/Tauon
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmac.spec
More file actions
121 lines (110 loc) · 3.05 KB
/
mac.spec
File metadata and controls
121 lines (110 loc) · 3.05 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
import os
import subprocess
import certifi
import sys
from pathlib import Path
python_ver = f"{sys.version_info.major}.{sys.version_info.minor}"
python_ver_dotless = f"{sys.version_info.major}{sys.version_info.minor}"
block_cipher = None
# default PATH=/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Tauon.app/Contents/Frameworks
# Should resolve as /opt/homebrew
prefix = subprocess.run(["brew", "--prefix"], capture_output=True, text=True).stdout.strip()
libs = [
"libpangocairo-1.0.0.dylib",
"libharfbuzz.0.dylib",
"libgobject-2.0.0.dylib",
"libgio-2.0.0.dylib",
"librsvg-2.2.dylib",
"libSDL3.dylib",
"libSDL3_image.dylib",
]
lib_paths = [(f"{prefix}/lib/{lib}", ".") for lib in libs]
x64_path = f"build/lib.macosx-13.0-x86_64-cpython-{python_ver_dotless}/phazor.cpython-{python_ver_dotless}-darwin.so"
arm64_path = f"build/lib.macosx-15.0-arm64-cpython-{python_ver_dotless}/phazor.cpython-{python_ver_dotless}-darwin.so"
phazor_path = x64_path if Path(x64_path).exists() else arm64_path
# Optional: macOS Now Playing helper app (built by src/nowplaying/build_app.sh)
nowplaying_app_src = Path("src/nowplaying/build/TauonNowPlaying.app")
nowplaying_datas = []
if nowplaying_app_src.exists():
nowplaying_datas.append((str(nowplaying_app_src), "lib/TauonNowPlaying.app"))
a = Analysis(
["src/tauon/__main__.py"],
binaries=[
*lib_paths,
(phazor_path, "."),
(f"{prefix}/bin/ffmpeg", "."),
],
datas=[
(certifi.where(), "certifi"),
("src/tauon/assets/Assets.car", "."),
("src/tauon/assets", "assets"),
("src/tauon/locale", "locale"),
("src/tauon/theme", "theme"),
("src/tauon/templates", "templates"),
("lrclib-solver", "."),
*nowplaying_datas,
],
hiddenimports=[
"AppKit",
"Foundation",
"objc",
"phazor",
"pylast",
# Zeroconf is hacked until this issue is resolved: https://github.com/pyinstaller/pyinstaller-hooks-contrib/issues/840
"zeroconf._utils.ipaddress",
"zeroconf._handlers.answers",
],
hookspath=["extra/pyinstaller-hooks"],
hooksconfig={},
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="Tauon",
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="src/tauon/assets/tau-mac.icns")
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name="Tauon")
app = BUNDLE(
coll,
name="Tauon.app",
icon="src/tauon/assets/tau-mac.icns",
bundle_identifier=None,
info_plist={
"CFBundleName": "Tauon",
"CFBundleDisplayName": "Tauon",
"CFBundleIconName": "tau",
"LSEnvironment": {
"LANG": "en_US.UTF-8",
"LC_CTYPE": "en_US.UTF-8",
}})
for lib in lib_paths:
lib_name, _ = lib
os.system(f'install_name_tool -add_rpath "@executable_path/." "{lib_name}"')
os.system(f'install_name_tool -add_rpath "@executable_path/." "{phazor_path}"')