1 | #!/usr/bin/env python |
---|
2 | # |
---|
3 | # Puzzlebox - ThinkGear Emulator - Py2Exe Distutils |
---|
4 | # |
---|
5 | # Copyright Puzzlebox Productions, LLC (2010) |
---|
6 | # |
---|
7 | # This code is released under the GNU Pulic License (GPL) version 2 |
---|
8 | # For more information please refer to http://www.gnu.org/copyleft/gpl.html |
---|
9 | # |
---|
10 | # Last Update: 2010.09.16 |
---|
11 | # |
---|
12 | ##################################################################### |
---|
13 | |
---|
14 | from distutils.core import setup |
---|
15 | import os, sys |
---|
16 | import glob |
---|
17 | |
---|
18 | if (sys.platform == 'win32'): |
---|
19 | import py2exe |
---|
20 | import shutil |
---|
21 | import matplotlib |
---|
22 | |
---|
23 | ##################################################################### |
---|
24 | # Main |
---|
25 | ##################################################################### |
---|
26 | |
---|
27 | if __name__ != '__main__': |
---|
28 | |
---|
29 | sys.exit() |
---|
30 | |
---|
31 | if (sys.platform == 'win32'): |
---|
32 | |
---|
33 | # Remove the build folder, a bit slower but ensures that build contains the latest |
---|
34 | shutil.rmtree("build", ignore_errors=True) |
---|
35 | |
---|
36 | options={"py2exe": { \ |
---|
37 | "includes": [ \ |
---|
38 | "sip", #"PyQt4._qt", \ |
---|
39 | "numpy", "pylab", \ |
---|
40 | "matplotlib", \ |
---|
41 | "matplotlib.backends", \ |
---|
42 | "matplotlib.backends.backend_qt4agg", \ |
---|
43 | "matplotlib.figure", \ |
---|
44 | "matplotlib.numerix.fft", \ |
---|
45 | "matplotlib.numerix.linear_algebra", \ |
---|
46 | "matplotlib.numerix.random_array", \ |
---|
47 | "matplotlib.backends.backend_tkagg"], \ |
---|
48 | "excludes": [ \ |
---|
49 | "bluetooth", "tcl", \ |
---|
50 | '_gtkagg', '_tkagg', '_agg2', \ |
---|
51 | '_cairo', '_cocoaagg', \ |
---|
52 | '_fltkagg', '_gtk', '_gtkcairo'], \ |
---|
53 | "dll_excludes": [ \ |
---|
54 | 'tcl84.dll', 'tk84.dll' \ |
---|
55 | 'libgdk-win32-2.0-0.dll', |
---|
56 | 'libgobject-2.0-0.dll'], \ |
---|
57 | #"packages": ["pytz"], \ |
---|
58 | "compressed": 2, \ |
---|
59 | "optimize": 2, \ |
---|
60 | "bundle_files": 2, \ |
---|
61 | "dist_dir": "dist", \ |
---|
62 | "xref": False, \ |
---|
63 | "skip_archive": False, \ |
---|
64 | } |
---|
65 | } |
---|
66 | |
---|
67 | data_files=[("", \ |
---|
68 | ["puzzlebox_synapse_configuration.ini"]), |
---|
69 | ("images", \ |
---|
70 | ["images/puzzlebox.ico", \ |
---|
71 | "images/puzzlebox_logo.png"]), |
---|
72 | ] |
---|
73 | |
---|
74 | # Add the mpl mpl-data folder and rc file |
---|
75 | data_files += matplotlib.get_py2exe_datafiles() |
---|
76 | |
---|
77 | matplotlib.use('Qt4Agg') # overrule configuration |
---|
78 | |
---|
79 | |
---|
80 | |
---|
81 | else: |
---|
82 | options={} |
---|
83 | |
---|
84 | data_files=[("/etc/puzzlebox_synapse", \ |
---|
85 | ["puzzlebox_synapse_configuration.ini"]), |
---|
86 | ("/usr/share/puzzlebox_synapse/images", \ |
---|
87 | ["images/puzzlebox.ico", \ |
---|
88 | "images/puzzlebox_logo.png"]), |
---|
89 | ("/usr/share/applications", \ |
---|
90 | ["puzzlebox_synapse.desktop"]), |
---|
91 | ] |
---|
92 | |
---|
93 | |
---|
94 | setup( |
---|
95 | name='puzzlebox_synapse', |
---|
96 | version='0.4.0', |
---|
97 | description='Puzzlebox Synapse provides a GUI and socket-server interface to commercially available EEG headsets', |
---|
98 | author='Steve Castellotti', |
---|
99 | author_email='sc@puzzlebox.info', |
---|
100 | url='http://brainstorms.puzzlebox.info', |
---|
101 | py_modules=['Puzzlebox', \ |
---|
102 | 'Puzzlebox.Synapse', \ |
---|
103 | 'Puzzlebox.Synapse.Protocol', \ |
---|
104 | 'Puzzlebox.Synapse.Server', \ |
---|
105 | 'Puzzlebox.Synapse.Client', \ |
---|
106 | 'Puzzlebox.Synapse.Interface', \ |
---|
107 | 'Puzzlebox.Synapse.Interface_Design', \ |
---|
108 | 'Puzzlebox.Synapse.Interface_Plot', \ |
---|
109 | 'Puzzlebox.Synapse.Configuration', \ |
---|
110 | 'synapse-protocol', \ |
---|
111 | 'synapse-server', \ |
---|
112 | 'synapse-client', \ |
---|
113 | 'synapse-gui'], \ |
---|
114 | console=["synapse-client.py", \ |
---|
115 | "synapse-server.py", \ |
---|
116 | "synapse-protocol.py" |
---|
117 | ], |
---|
118 | options=options, \ |
---|
119 | zipfile = r'lib\library.zip', |
---|
120 | data_files=data_files, \ |
---|
121 | windows=[ \ |
---|
122 | { |
---|
123 | "script": "synapse-gui.py", |
---|
124 | "icon_resources": [(1, \ |
---|
125 | os.path.join("images", "puzzlebox.ico"))] |
---|
126 | }, |
---|
127 | ], |
---|
128 | classifiers=[ \ |
---|
129 | 'Development Status :: 4 - Beta', |
---|
130 | 'Intended Audience :: End Users/Desktop', |
---|
131 | 'Programming Language :: Python', |
---|
132 | 'Operating System :: OS Independent', |
---|
133 | 'License :: OSI Approved :: GNU General Public License (GPL)', |
---|
134 | 'Topic :: Scientific/Engineering :: Human Machine Interfaces', |
---|
135 | ], |
---|
136 | ) |
---|