forked from liamcottle/reticulum-meshchat
-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathsetup.py
More file actions
55 lines (50 loc) · 2.07 KB
/
Copy pathsetup.py
File metadata and controls
55 lines (50 loc) · 2.07 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
import json
from pathlib import Path
from cx_Freeze import setup, Executable
project_dir = Path(__file__).resolve().parent
package_metadata = json.loads((project_dir / 'package.json').read_text(encoding='utf-8'))
setup(
name='Crosstalk',
version=package_metadata['version'],
description='A simple mesh network communications app powered by the Reticulum Network Stack',
executables=[
Executable(
script='crosstalk.py', # this script to run
base=None, # we are running a console application, not a gui
target_name='Crosstalk', # creates Crosstalk.exe
shortcut_name='Crosstalk', # name shown in shortcut
shortcut_dir='ProgramMenuFolder', # put the shortcut in windows start menu
icon='logo/icon.ico', # set the icon for the exe
),
],
options={
'build_exe': {
# libs that are required
'packages': [
# required for dynamic import fix
# https://github.com/marcelotduarte/cx_Freeze/discussions/2039
# https://github.com/marcelotduarte/cx_Freeze/issues/2041
'RNS',
],
# files that are required
'include_files': [
'package.json', # used to determine app version from python
'public/', # static files served by web server
(
'src/backend/interfaces/IridiumIMTInterface.py',
'src/backend/interfaces/IridiumIMTInterface.py',
),
],
# slim down the build by excluding these unused libs
'excludes': [
'PIL', # saves ~200MB
],
# this has the same effect as the -O command line option when executing CPython directly.
# it also prevents assert statements from executing, removes docstrings and sets __debug__ to False.
# https://stackoverflow.com/a/57948104
"optimize": 2,
# change where exe is built to
'build_exe': 'build/exe',
},
},
)