This repository has been archived by the owner on Mar 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
setup-all.win32.cx_freeze.py
75 lines (66 loc) · 2.16 KB
/
setup-all.win32.cx_freeze.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
from cx_Freeze import setup, Executable
import sys
import os
import shutil
import version
import site
base_dir = os.path.abspath(os.path.dirname(sys.argv[0]))
sys.argv.append('build_exe')
os.environ['TCL_LIBRARY'] = os.path.join(base_dir, 'tcl', 'tcl8.6')
os.environ['TK_LIBRARY'] = os.path.join(base_dir, 'tcl', 'tk8.6')
try:
shutil.rmtree(os.path.join(base_dir, 'build'))
except:
pass
try:
shutil.rmtree(os.path.join(base_dir, 'dist'))
except:
pass
includes = [
'atexit',
'modules.default_css',
'httplib2.socks',
]
excludes = [
'olefile',
'distutils',
'pywin',
'tkconstants',
'tkinter',
'tcl',
]
data_files = [
(os.path.join(base_dir, 'modules', 'dictionaries'), 'dictionaries'),
(os.path.join(base_dir, 'profiles'), 'profiles'),
(os.path.join(base_dir, 'fb2mobi.config'), 'fb2mobi.config'),
(os.path.join(base_dir, 'fb2epub.config'), 'fb2epub.config'),
(os.path.join(base_dir, 'spaces.xsl'), 'spaces.xsl'),
(os.path.join(base_dir, 'default_cover.jpg'), 'default_cover.jpg'),
(os.path.join(base_dir, 'kindlegen.exe'), 'kindlegen.exe'),
(os.path.join(base_dir, 'ui/locale/qtbase_ru.qm'), 'ui/locale/qtbase_ru.qm'),
(os.path.join(base_dir, 'ui/locale/fb2mobi_ru.qm'), 'ui/locale/fb2mobi_ru.qm'),
(os.path.join(site.getsitepackages()[1], 'PyQt5/Qt/plugins/styles/qwindowsvistastyle.dll'), "styles/qwindowsvistastyle.dll"),
(os.path.join(base_dir, 'client_secret.json'), 'client_secret.json'),
(os.path.join(base_dir, 'cacerts.txt'), 'cacerts.txt'),
]
setup(
name = "fb2mobi",
version = version.VERSION,
options={
'build_exe': {
'zip_exclude_packages': '',
'zip_include_packages': '*',
'include_files': data_files,
'packages': 'json,lxml,PIL,slugify,unidecode',
'includes': includes,
'excludes': excludes,
'replace_paths': [('*','library.zip/')],
}
},
executables = [
Executable('fb2mobi.py'),
Executable('fb2mobi.py',targetName='fb2epub.exe'),
Executable('synccovers.py'),
Executable('fb2mobi-gui.py', base='Win32GUI', icon='ui/fb2mobi.ico'),
]
)