-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathiris_wallet_desktop.spec
128 lines (118 loc) · 3.55 KB
/
iris_wallet_desktop.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
# -*- mode: python ; coding: utf-8 -*-
import sys
import os
from PyInstaller.utils.hooks import collect_submodules, collect_data_files
from PyInstaller.building.build_main import Analysis, PYZ, EXE, BUNDLE, COLLECT
from PyInstaller.utils.hooks import collect_dynamic_libs
print(sys.platform)
block_cipher = None
spec_file_path = os.path.abspath(sys.argv[0])
current_dir = os.path.dirname(spec_file_path)
sys.path.append(current_dir)
sys.path.append(os.path.join(current_dir, 'src/utils'))
from src.version import __version__
from src.flavour import __network__
from src.utils.constant import APP_NAME, ORGANIZATION_DOMAIN
print(__version__)
print(__network__)
# Collect data files from pyqttoast, bip32utils, mnemonic, and cryptography
pyqttoast_datas = collect_data_files('pyqttoast')
base_project_path = os.path.abspath(__name__)
print(base_project_path)
ln_node_binary = os.path.abspath(os.path.join(base_project_path, "../ln_node_binary", 'rgb-lightning-node'))
print(ln_node_binary)
if sys.platform.startswith('win'):
ln_node_binary = os.path.abspath(os.path.join(base_project_path, "../ln_node_binary/rgb-lightning-node.exe"))
else:
ln_node_binary = os.path.abspath(os.path.join(base_project_path, "../ln_node_binary/rgb-lightning-node"))
# Define data files
datas = [
('./src/assets/icons/*', './assets/icons/'),
('./src/views/qss/*.qss', './views/qss/'),
('./build_info.json', './build_info.json'),
(ln_node_binary, './ln_node_binary/'),
('binary', './binary/')
] + pyqttoast_datas
# Common Analysis
a = Analysis(
['src/main.py'],
pathex=[],
binaries=[],
datas=datas,
hiddenimports=['pyqttoast', 'PySide6', 'bip32utils', 'mnemonic', 'importlib_metadata', 'hashlib'],
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 = None
# Platform-specific EXE
if sys.platform == 'darwin':
exe = EXE(
pyz,
a.scripts,
exclude_binaries=True,
name=APP_NAME,
debug=False,
strip=False,
upx=True,
console=False
)
elif sys.platform.startswith('win'):
icon_path = f'./src/assets/icons/{__network__}-icon.ico'
exe = EXE(
pyz,
a.scripts,
exclude_binaries=True,
name=APP_NAME,
debug=False,
strip=False,
upx=True,
console=False,
icon=icon_path
)
elif sys.platform == 'linux':
exe = EXE(
pyz,
a.scripts,
exclude_binaries=True,
name=APP_NAME,
debug=False,
strip=False,
upx=True,
console=False
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
name=APP_NAME,
strip=False,
upx=True
)
# Build a .app bundle if on macOS
if sys.platform == 'darwin':
app = BUNDLE(
coll,
name=f"{APP_NAME}.app",
version=__version__,
bundle_identifier=ORGANIZATION_DOMAIN,
icon='./src/assets/icons/iriswallet.icns',
info_plist={
'NSPrincipalClass': 'NSApplication',
'NSAppleScriptEnabled': False,
'CFBundleVersion': __version__,
'CFBundleShortVersionString': __version__,
'CFBundleName': APP_NAME,
'CFBundleDocumentTypes': [{
'CFBundleTypeName': 'Iriswallet Document',
'CFBundleTypeIconFile': 'iriswallet.icns',
'LSItemContentTypes': [ORGANIZATION_DOMAIN],
'LSHandlerRank': 'Owner'
}]
},
)