-
Notifications
You must be signed in to change notification settings - Fork 16
/
setup.py
147 lines (137 loc) · 4.62 KB
/
setup.py
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#
#This file is part of Cosmonium.
#
#Copyright (C) 2018-2019 Laurent Deru.
#
#Cosmonium is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#
#Cosmonium is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with Cosmonium. If not, see <https://www.gnu.org/licenses/>.
#
from setuptools import setup
import sys
# Add lib/ directory to import path to be able to load the c++ libraries
sys.path.insert(0, 'lib')
# Add third-party/ directory to import path to be able to load the external libraries
sys.path.insert(0, 'third-party')
# CEFPanda and glTF modules aree not at top level
sys.path.insert(0, 'third-party/cefpanda')
sys.path.insert(0, 'third-party/gltf')
from cosmonium.version import version_str
log_filename = '$USER_APPDATA/cosmonium/output.log'
requirements_path = None
include_modules = ['numpy.core._multiarray_tests']
if '--cosmonium-test' in sys.argv:
sys.argv.remove('--cosmonium-test')
log_filename = None
for (index, arg) in enumerate(sys.argv):
if arg == '-p':
platform = sys.argv[index + 1]
if platform.startswith('macos'):
log_filename = '$HOME/Library/Logs/cosmonium/output.log'
elif platform.startswith('win'):
log_filename = '$USER_APPDATA/Cosmonium/Logs/output.log'
include_modules.append('win32')
else:
log_filename = '$HOME/.cache/cosmonium/log/output.log'
break
for (index, arg) in enumerate(sys.argv):
if arg == '-r':
requirements_path = sys.argv[index + 1]
sys.argv.pop(index)
sys.argv.pop(index)
break
if requirements_path is None:
print("Missing path for requirements.txt !")
exit(1)
config = {
'name': "cosmonium",
'version': version_str,
'license': 'GPLv3+',
'options': {
'build_apps': {
'requirements_path': requirements_path,
'platforms': ['manylinux1_x86_64', 'manylinux1_i686', 'macosx_10_9_x86_64'],
'prefer_discrete_gpu': True,
'include_patterns': [
'config/**',
'shaders/**',
'data/**',
'models/**',
'doc/**',
'fonts/**',
'ralph-data/**',
'textures/**',
'*.md',
'locale/**'
],
'exclude_patterns': [
'data/**/level1/**',
'data/**/level2/**',
'data/**/level3/**',
'data/**/level4/**',
'data/**/level5/**',
'data/**/level6/**',
'data/**/level7/**',
'data/**/level8/**',
'data/**/level9/**',
'data/tools/**',
'data/data/**',
],
'package_data_dirs':
{
'win32': [('pywin32_system32/*', '', {}),
('win32/*.pyd', '', {}),
('win32/lib/win32con.py', '', {})],
},
'include_modules':
{
'*': include_modules,
},
'gui_apps': {
'cosmonium': 'main.py',
#'ralph': 'ralph.py',
},
'macos_main_app': 'cosmonium',
'log_filename': log_filename,
'log_append': False,
'plugins': [
'pandagl',
'p3ptloader',
'p3assimp',
'p3interrogatedb'
],
'icons' : {
"cosmonium" : [
"textures/cosmonium-512.png",
"textures/cosmonium-256.png",
"textures/cosmonium-128.png",
"textures/cosmonium-64.png",
"textures/cosmonium-48.png",
"textures/cosmonium-32.png",
"textures/cosmonium-16.png",
],
},
'bam_model_extensions': [],
},
'bdist_apps': {
'installers': {
'manylinux1_x86_64': 'gztar',
'manylinux1_i686': 'gztar',
'macosx_10_9_x86_64': 'zip',
'win_amd64': 'nsis',
'win32': 'nsis',
}
}
}
}
if __name__ == '__main__':
setup(**config)