forked from strawlab/fsee
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
113 lines (90 loc) · 3.5 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
# Copyright (C) 2005-2008 California Institute of Technology, All rights reserved
import os, glob, sys, time, shutil
from setuptools import setup, find_packages
from setuptools.dist import Distribution
fsee_package_data = [
'data/models/alice_cylinder/*',
'data/models/mamarama_checkerboard/*',
]
if 1:
fsee_package_data.extend([
'data/models/fly/wing.osg',
'data/models/fly/wingim.jpg',
'data/models/fly/body.osg',
'data/models/fly/brownredwhite.png',
'data/models/floor_only/floor_only.osg',
'data/models/floor_only/rocks.jpg',
'data/models/WT1/WT1.osg',
'data/models/WT1/post_black.png',
'data/models/WT1/tunnel_floor_texture.png',
'data/models/WT1/tunnel_wall_inside_texture.png',
'data/models/WT1/vent.png',
'data/models/tunnel_one_wall/tunnel.osg',
'data/models/tunnel_one_wall/random.png',
'data/models/tunnel_one_wall/rocks.jpg',
'data/models/tunnel_leftturn/tunnel.osg',
'data/models/tunnel_leftturn/random.png',
'data/models/tunnel_leftturn/rocks.jpg',
'data/models/tunnel_rightturn/tunnel.osg',
'data/models/tunnel_rightturn/random.png',
'data/models/tunnel_rightturn/rocks.jpg',
'data/models/tunnel_straight/random.png',
'data/models/tunnel_straight/random2.png',
'data/models/tunnel_straight/rocks.jpg',
'data/models/tunnel_straight/tunnel_straight_large_texture.osg',
'data/models/tunnel_straight/tunnel_straight_small_texture.osg',
'data/Images/brightday1_cubemap/negx.png',
'data/Images/brightday1_cubemap/negy.png',
'data/Images/brightday1_cubemap/negz.png',
'data/Images/brightday1_cubemap/posx.png',
'data/Images/brightday1_cubemap/posy.png',
'data/Images/brightday1_cubemap/posz.png',
'data/models/grating_tunnel/WT_grating_0.1000floormpc_0.1000wallmpc.osg',
'data/models/grating_tunnel/grating_16_cycles.png',
])
if sys.platform == 'win32':
prefix = 'fsoi_ng'
extension = '.dll'
elif sys.platform.startswith('linux'):
prefix = 'libfsoi_ng'
extension = '.so'
elif sys.platform.startswith('darwin'):
prefix = 'libfsoi_ng'
extension = '.dylib'
libfile = os.path.join('src','fsoi',prefix+extension)
if not os.path.exists(libfile):
raise RuntimeError('libfsoi_ng (or fsoi_ng.dll) does not exist -- aborting -- run scons in src/fsoi')
# copy .so or .dll from build directory into target directory
shutil.copy2(libfile,os.path.join('fsee',prefix+extension))
fsee_package_data.append( prefix+extension)
package_data = {'fsee':fsee_package_data}
package_data['fsee.eye_geometry']=['*.mat','*.m']
eager_files = [ 'fsee/'+f for f in fsee_package_data ]
if 1:
kwargs = dict(
zip_safe=False,
eager_resources = eager_files,
entry_points = {'console_scripts': [
'fsee_monitor = fsee.fsee_monitor:main',
'fsee_envmap2bugeye = fsee.envmap2bugeye:main',
'fsee_bench = fsee.fsee_bench.main',
'fsee_fsoi_runner = fsee.FlySimWrapFSOI:real_runner',
]
},
)
else:
kwargs = {}
class PlatformDependentDistribution(Distribution):
# Force platform-dependant build.
def has_ext_modules(self):
return True
setup(name="fsee",
description='model of fly visual system',
author="Andrew Straw",
author_email="strawman@astraw.com",
version='0.2', # keep in sync with fsee/__init__.py
install_requires=['PIL'],
packages = find_packages(),
package_data = package_data,
distclass = PlatformDependentDistribution,
**kwargs)