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
/
Copy pathsetup-all.mac.cx_freeze.py
85 lines (73 loc) · 2.27 KB
/
setup-all.mac.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
76
77
78
79
80
81
82
83
84
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('bdist_mac')
# sys.argv.append('--qt-menu-nib=/opt/local/libexec/qt5/plugins/')
try:
shutil.rmtree(os.path.join(base_dir, 'build'))
except:
pass
try:
shutil.rmtree(os.path.join(base_dir, 'dist'))
except:
pass
includes = [
'lxml._elementpath',
'modules.default_css',
'PyQt5.QtCore',
'PyQt5.QtGui',
'PyQt5.QtWidgets',
'httplib2.socks',
]
excludes = [
'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, 'spaces.xsl'), 'spaces.xsl'),
(os.path.join(base_dir, 'default_cover.jpg'), 'default_cover.jpg'),
(os.path.join(base_dir, 'kindlegen'), 'kindlegen'),
(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(base_dir, 'client_secret.json'), 'client_secret.json'),
(os.path.join(base_dir, 'cacerts.txt'), 'cacerts.txt'),
]
plist = os.path.join(base_dir, 'ui/Info.plist')
setup(
name = "fb2mobi-gui",
version = version.VERSION,
options={
'build_exe': {
# 'silent': 1,
#'build_exe': 'dist',
'zip_exclude_packages': '',
'zip_include_packages': '*',
'include_files': data_files,
'includes': includes,
'excludes': excludes,
},
'bdist_mac': {
'iconfile': 'ui/fb2mobi.icns',
'custom_info_plist': plist,
'bundle_name': 'fb2mobi',
'qt_menu_nib': '/opt/local/libexec/qt5/plugins/'
}
},
executables = [
Executable('fb2mobi-gui.py'),
Executable('fb2mobi.py'),
Executable('synccovers.py')
]
)
if os.path.isdir(os.path.join(base_dir, 'build/fb2mobi.app')):
if not os.path.isdir(os.path.join(base_dir, 'build/CLI')):
shutil.copytree(os.path.join(base_dir, 'mac_CLI'), os.path.join(base_dir, 'build/CLI'))