-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-win.py
137 lines (121 loc) · 5.14 KB
/
setup-win.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
"""
This is a set up script for py2exe
USAGE: python setup-win py2exe
"""
from distutils.core import setup
import matplotlib as mpl
import py2exe
import os
# Remove the build folder, a bit slower but ensures that build contains the latest
import shutil
shutil.rmtree("build", ignore_errors=True)
shutil.rmtree("dist", ignore_errors=True)
INCLUDES = [
"sip",
"serial",
"scipy.special._ufuncs_cxx",
]
EXCLUDES = ['_tkagg',
'_ps',
'_fltkagg',
'Tkinter',
'Tkconstants',
'_cairo',
'_gtk',
'gtkcairo',
'pydoc',
'sqlite3',
'bsddb',
'curses',
'tcl',
'_wxagg',
'_gtagg',
'_cocoaagg',
'_wx']
# current version of Artisan
import artisanlib
VERSION = artisanlib.__version__
LICENSE = 'GNU General Public License (GPL)'
cwd = os.getcwd()
DATAFILES = mpl.get_py2exe_datafiles()
DATAFILES = DATAFILES + \
[('plugins\imageformats', [
'c:\Python27\Lib\site-packages\PyQt4\plugins\imageformats\qsvg4.dll',
'c:\Python27\Lib\site-packages\PyQt4\plugins\imageformats\qgif4.dll',
'c:\Python27\Lib\site-packages\PyQt4\plugins\imageformats\qtiff4.dll',
'c:\Python27\Lib\site-packages\PyQt4\plugins\imageformats\qjpeg4.dll',
]),
('plugins\iconengines', [
'c:\Python27\Lib\site-packages\PyQt4\plugins\iconengines\qsvgicon4.dll',
]),
]
setup(
name ="Artisan",
version=VERSION,
author='YOUcouldbeTOO',
author_email='[email protected]',
license=LICENSE,
windows=[{"script" : cwd + "\\artisan.py",
"icon_resources": [(0, cwd + "\\artisan.ico")]
}],
data_files = DATAFILES,
zipfile = "lib\library.zip",
options={"py2exe" :{
"packages": ['matplotlib','pytz'],
"compressed": False, # faster
"unbuffered": True,
'optimize': 2,
"bundle_files": 2, # default bundle_files: 3 breaks WebLCDs on Windows
"dll_excludes":[
'MSVCP90.dll','tcl84.dll','tk84.dll','libgdk-win32-2.0-0.dll',
'libgdk_pixbuf-2.0-0.dll','libgobject-2.0-0.dll',
'MSVCR90.dll','MSVCN90.dll','mwsock.dll','powrprof.dll'],
"includes" : INCLUDES,
"excludes" : EXCLUDES}
}
)
os.system(r'copy README.txt dist')
os.system(r'copy LICENSE.txt dist')
os.system(r'copy qt-win.conf dist\\qt.conf')
os.system(r'mkdir dist\\Wheels')
os.system(r'mkdir dist\\Wheels\\Cupping')
os.system(r'mkdir dist\\Wheels\\Other')
os.system(r'mkdir dist\\Wheels\\Roasting')
os.system(r'copy Wheels\\Cupping\\* dist\\Wheels\\Cupping')
os.system(r'copy Wheels\\Other\\* dist\\Wheels\\Other')
os.system(r'copy Wheels\\Roasting\\* dist\\Wheels\\Roasting')
os.system(r'mkdir dist\\translations')
os.system(r'copy translations\\*.qm dist\\translations')
os.system(r'copy c:\\Qt\\4.8.6\\translations\\qt_de.qm dist\\translations')
os.system(r'copy c:\\Qt\\4.8.6\\translations\\qt_es.qm dist\\translations')
os.system(r'copy c:\\Qt\\4.8.6\\translations\\qt_fr.qm dist\\translations')
os.system(r'copy c:\\Qt\\4.8.6\\translations\\qt_sv.qm dist\\translations')
os.system(r'copy c:\\Qt\\4.8.6\\translations\\qt_zh_CN.qm dist\\translations')
os.system(r'copy c:\\Qt\\4.8.6\\translations\\qt_zh_TW.qm dist\\translations')
os.system(r'copy c:\\Qt\\4.8.6\\translations\\qt_ko.qm dist\\translations')
os.system(r'copy c:\\Qt\\4.8.6\\translations\\qt_pt.qm dist\\translations')
os.system(r'copy c:\\Qt\\4.8.6\\translations\\qt_ru.qm dist\\translations')
os.system(r'copy c:\\Qt\\4.8.6\\translations\\qt_ar.qm dist\\translations')
os.system(r'copy c:\\Qt\\4.8.6\\translations\\qt_ja.qm dist\\translations')
os.system(r'copy c:\\Qt\\4.8.6\\translations\\qt_hu.qm dist\\translations')
os.system(r'copy c:\\Qt\\4.8.6\\translations\\qt_pl.qm dist\\translations')
os.system(r'rmdir /q /s dist\\mpl-data\\sample_data')
# YOCTO HACK BEGIN: manually copy over the dlls
os.system(r'mkdir dist\\lib')
os.system(r'copy c:\\Python27\\Lib\\site-packages\\yoctopuce\\cdll\\yapi.dll dist\\lib')
os.system(r'copy c:\\Python27\\Lib\\site-packages\\yoctopuce\\cdll\\yapi64.dll dist\\lib')
# YOCTO HACK END
os.system(r'copy artisan.png dist')
os.system(r'copy artisanAlarms.ico dist')
os.system(r'copy artisanProfile.ico dist')
os.system(r'copy artisanPalettes.ico dist')
os.system(r'copy artisanWheel.ico dist')
os.system(r'copy includes\\Humor-Sans.ttf dist')
os.system(r'copy includes\\alarmclock.eot dist')
os.system(r'copy includes\\alarmclock.svg dist')
os.system(r'copy includes\\alarmclock.ttf dist')
os.system(r'copy includes\\alarmclock.woff dist')
os.system(r'copy includes\\artisan.tpl dist')
os.system(r'copy includes\\bigtext.js dist')
os.system(r'copy includes\\jquery-1.11.1.min.js dist')
os.system(r'copy ..\\vcredist_x86.exe dist')