-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathgcft.spec
More file actions
90 lines (80 loc) · 2.88 KB
/
Copy pathgcft.spec
File metadata and controls
90 lines (80 loc) · 2.88 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
# -*- mode: python -*-
block_cipher = None
from version import VERSION
build_version = VERSION
import os
import glob
def build_datas_recursive(paths):
datas = []
for path in paths:
for filename in glob.iglob(path, recursive=True):
dest_dirname = os.path.dirname(filename)
if dest_dirname == "":
dest_dirname = "."
data_entry = (filename, dest_dirname)
datas.append(data_entry)
#print(data_entry)
return datas
import platform
import glob
def get_binaries():
if platform.system() in ["Darwin", "Linux"]:
return [('./PyJ3DUltra/build/J3DUltra*.so', '.')]
assert platform.system() == "Windows"
for glob_pattern in [
'./PyJ3DUltra/build/J3DUltra*.pyd',
'./PyJ3DUltra/build/Debug/J3DUltra*.pyd',
'./PyJ3DUltra/build/Release/J3DUltra*.pyd',
]:
if glob.glob(glob_pattern):
return [(glob_pattern, '.')]
raise Exception("Could not find Windows PyJ3DUltra executable")
a = Analysis(['gcft.py'],
pathex=["./gclib", "./gclib/gclib"],
binaries=get_binaries(),
datas=build_datas_recursive([
'assets/**/*.*',
'version.txt',
'gcft_ui/*.ui',
]),
hiddenimports=[
'_cffi_backend', # For imagequant (gclib)
'OpenGL.platform.glx', # For Linux X11 support
'OpenGL.platform.egl', # For Linux Wayland support
],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
name='GameCube File Tools',
debug=False,
strip=False,
upx=True,
runtime_tmpdir=None,
console=False,
icon="assets/icon.ico" )
# Disabled code for building macOS .app bundles below.
# This was for PyInstaller's onefile mode, which apparently isn't supposed to be used with macOS bundles.
# In order properly support macOS, onedir mode (COLLECT) should be used instead.
# But as GitHub Actions doesn't seem to properly support building macOS bundles with PyInstaller anymore either way this doesn't seem worthwhile.
# If anyone is interested in adding support for macOS builds again it may require some completely different method.
# app = BUNDLE(exe,
# name='GameCube File Tools.app',
# icon="assets/icon.icns",
# bundle_identifier=None,
# info_plist={
# "LSBackgroundOnly": False,
# "CFBundleDisplayName": "GameCube File Tools",
# "CFBundleName": "GCFT", # 15 character maximum
# "CFBundleShortVersionString": build_version,
# }
# )