forked from jwdj/EasyABC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
118 lines (107 loc) · 5.3 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
#!/usr/bin/python2.7
# setup.py
from distutils.core import setup
import sys
import glob
import os.path
if sys.version_info.major > 2:
basestring = str
version = '1.3.7.4'
description = "EasyABC"
long_description = "Nils Liberg's EasyABC 1.3.7 (Seymour Shlien)"
url = 'http://www.nilsliberg.se/ksp/easyabc/'
author = 'Nils Liberg'
options = {}
executables = []
include_files = [os.path.join('locale', 'sv', 'LC_MESSAGES', 'easyabc.po'),
os.path.join('locale', 'sv', 'LC_MESSAGES', 'easyabc.mo'),
os.path.join('locale', 'da', 'LC_MESSAGES', 'easyabc.po'),
os.path.join('locale', 'da', 'LC_MESSAGES', 'easyabc.mo'),
os.path.join('locale', 'fr', 'LC_MESSAGES', 'easyabc.po'),
os.path.join('locale', 'fr', 'LC_MESSAGES', 'easyabc.mo'),
os.path.join('locale', 'nl', 'LC_MESSAGES', 'easyabc.po'),
os.path.join('locale', 'nl', 'LC_MESSAGES', 'easyabc.mo'),
os.path.join('locale', 'ja', 'LC_MESSAGES', 'easyabc.po'),
os.path.join('locale', 'ja', 'LC_MESSAGES', 'easyabc.mo'),
os.path.join('locale', 'it', 'LC_MESSAGES', 'easyabc.po'),
os.path.join('locale', 'it', 'LC_MESSAGES', 'easyabc.mo')] + \
glob.glob(os.path.join('img', '*.*')) + glob.glob(os.path.join('sound', '*.*'))
if sys.platform == "darwin":
import py2app
# import bdist_mpkg
buildstyle = 'app'
options["py2app"] = {"argv_emulation" : True,
'iconfile' : "img/EasyABC.icns",
# 'optimize' : 1, #2
'compressed' : 0,
# 'excludes': ['Tkinter','tcl','tk','_ssl', 'email'],
'excludes': ['Tkinter','tcl','tk','_ssl', 'email', 'pygame', 'pygame.pypm'],
# 'includes': ['mechanize', 'urllib', 'socket', 'pygame.pypm' ],
'includes': ['mechanize', 'urllib', 'socket' ],
}
data_files = [('.', ['reference.txt', 'gpl-license.txt']),
('bin', ['bin/abc2midi', 'bin/abcm2ps', 'bin/abc2abc', 'bin/nwc2xml']),
('img', glob.glob(os.path.join('img', '*.*'))),
('sound', glob.glob(os.path.join('sound', '*.*'))),
('locale', []),
('locale/sv', []), ('locale/sv/LC_MESSAGES', glob.glob(os.path.join('locale/sv/LC_MESSAGES/*'))),
('locale/da', []), ('locale/da/LC_MESSAGES', glob.glob(os.path.join('locale/da/LC_MESSAGES/*'))),
('locale/fr', []), ('locale/fr/LC_MESSAGES', glob.glob(os.path.join('locale/fr/LC_MESSAGES/*'))),
('locale/nl', []), ('locale/nl/LC_MESSAGES', glob.glob(os.path.join('locale/nl/LC_MESSAGES/*'))),
('locale/ja', []), ('locale/ja/LC_MESSAGES', glob.glob(os.path.join('locale/ja/LC_MESSAGES/*'))),
('locale/it', []), ('locale/it/LC_MESSAGES', glob.glob(os.path.join('locale/it/LC_MESSAGES/*'))),
]
setup(name="EasyABC",
version=version,
description=description,
long_description=long_description,
url=url,
author=author,
options=options,
data_files=data_files,
#executables=executables,
**{buildstyle : [{'script' : 'easy_abc.py',
'icon_resources' : [(0, 'img\\logo.ico')]}
]}
)
else:
from cx_Freeze import setup, Executable
base = "Win32GUI"
icon = 'img\\logo.ico'
include_files = include_files + \
['bin\\abc2midi.exe',
'bin\\abcm2ps.exe',
'bin\\midi2abc.exe',
'bin\\abc2abc.exe',
'bin\\nwc2xml.exe',
'bin\\zlibwapi.dll',
'reference.txt',
'gpl-license.txt',
'easy_abc.exe.manifest',
'Microsoft.VC90.CRT\\Microsoft.VC90.CRT.manifest',
'Microsoft.VC90.CRT\\msvcm90.dll',
'Microsoft.VC90.CRT\\msvcp90.dll',
'Microsoft.VC90.CRT\\msvcr90.dll',]
# 1.3.7.1 [JWDJ] to maintain the folder structure make a tuple with same source and target path
include_files = [x for x in include_files if not isinstance(x, basestring)] + [(x, x) for x in include_files if isinstance(x, basestring)] # maintain folder structure
options["build_exe"] = {'excludes': ['Tkinter','tcl','tk','_ssl', 'email'], #, 'numpy.linalg.lapack_lite', 'numpy.random.mtrand.pyd', 'numpy.fft.fftpack_lite.pyd'],
'includes': ['mechanize', 'urllib', 'socket', 'win32api', 'win32process'],
'optimize': 1,
'include_files': include_files }
executables = [Executable(
script="easy_abc.py",
base=base,
icon=icon,
copyDependentFiles = True,
appendScriptToExe = False,
appendScriptToLibrary = False,
)]
setup(name="EasyABC",
version=version,
description=description,
long_description=long_description,
url=url,
author=author,
options=options,
executables=executables,
)