forked from Dioptas/Dioptas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDioptas.spec
190 lines (164 loc) · 5.48 KB
/
Dioptas.spec
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# -*- coding: utf-8 -*-
# Dioptas - GUI program for fast processing of 2D X-ray diffraction data
# Principal author: Clemens Prescher (clemens.prescher@gmail.com)
# Copyright (C) 2014-2019 GSECARS, University of Chicago, USA
# Copyright (C) 2015-2018 Institute for Geology and Mineralogy, University of Cologne, Germany
# Copyright (C) 2019-2020 DESY, Hamburg, Germany
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
block_cipher = None
import sys
import os
folder = os.getcwd()
from distutils.sysconfig import get_python_lib
from sys import platform as _platform
site_packages_path = get_python_lib()
import pyFAI
import matplotlib
import lib2to3
pyFAI_path = os.path.dirname(pyFAI.__file__)
matplotlib_path = os.path.dirname(matplotlib.__file__)
lib2to3_path = os.path.dirname(lib2to3.__file__)
extra_datas = [
("dioptas/resources", "dioptas/resources"),
(os.path.join(pyFAI_path, "resources"), "pyFAI/resources"),
(os.path.join(pyFAI_path, "utils"), "pyFAI/utils"),
(os.path.join(lib2to3_path, 'Grammar.txt'), 'lib2to3/'),
(os.path.join(lib2to3_path, 'PatternGrammar.txt'), 'lib2to3/'),
]
binaries = []
fabio_hiddenimports = [
"fabio.edfimage",
"fabio.adscimage",
"fabio.tifimage",
"fabio.marccdimage",
"fabio.mar345image",
"fabio.fit2dmaskimage",
"fabio.brukerimage",
"fabio.bruker100image",
"fabio.pnmimage",
"fabio.GEimage",
"fabio.OXDimage",
"fabio.dm3image",
"fabio.HiPiCimage",
"fabio.pilatusimage",
"fabio.fit2dspreadsheetimage",
"fabio.kcdimage",
"fabio.cbfimage",
"fabio.xsdimage",
"fabio.binaryimage",
"fabio.pixiimage",
"fabio.raxisimage",
"fabio.numpyimage",
"fabio.eigerimage",
"fabio.hdf5image",
"fabio.fit2dimage",
"fabio.speimage",
"fabio.jpegimage",
"fabio.jpeg2kimage",
"fabio.mpaimage",
"fabio.mrcimage"
]
a = Analysis(['Dioptas.py'],
pathex=[folder],
binaries=binaries,
datas=extra_datas,
hiddenimports=['scipy.special._ufuncs_cxx', 'scipy._lib.messagestream', 'skimage._shared.geometry',
'h5py.defs', 'h5py.utils', 'h5py.h5ac', 'h5py', 'h5py._proxy', 'pywt._extensions._cwt',
'pkg_resources.py2_warn'] +
fabio_hiddenimports,
hookspath=[],
runtime_hooks=[],
excludes=['PyQt4', 'PySide'],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher)
# remove packages which are not needed by Dioptas
# a.binaries = [x for x in a.binaries if not x[0].startswith("matplotlib")]
a.binaries = [x for x in a.binaries if not x[0].startswith("zmq")]
a.binaries = [x for x in a.binaries if not x[0].startswith("IPython")]
a.binaries = [x for x in a.binaries if not x[0].startswith("docutils")]
a.binaries = [x for x in a.binaries if not x[0].startswith("pytz")]
a.binaries = [x for x in a.binaries if not x[0].startswith("wx")]
a.binaries = [x for x in a.binaries if not x[0].startswith("libQtWebKit")]
a.binaries = [x for x in a.binaries if not x[0].startswith("libQtDesigner")]
a.binaries = [x for x in a.binaries if not x[0].startswith("PySide")]
a.binaries = [x for x in a.binaries if not x[0].startswith("libtk")]
exclude_datas = [
"IPython",
# "matplotlib",
# "mpl-data", #needs to be included
# "_MEI",
# "docutils",
# "pytz",
# "lib",
"include",
"sphinx",
# ".py",
"tests",
"skimage",
"alabaster",
"boto",
"jsonschema",
"babel",
"idlelib",
"requests",
"qt4_plugins",
"qt5_plugins"
]
for exclude_data in exclude_datas:
a.datas = [x for x in a.datas if exclude_data not in x[0]]
platform = ''
if _platform == "linux" or _platform == "linux2":
platform = "Linux"
name = "Dioptas"
elif _platform == "win32" or _platform == "cygwin":
platform = "Win"
name = "Dioptas.exe"
elif _platform == "darwin":
platform = "Mac"
name = "run_dioptas"
# checking whether the platform is 64 or 32 bit
if sys.maxsize > 2 ** 32:
platform += "64"
else:
platform += "32"
# getting the current version of Dioptas
try:
with open(os.path.join('dioptas', '__version__'), 'r') as fp:
__version__ = fp.readline()
except FileNotFoundError:
from dioptas import __version__
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name=name,
debug=False,
strip=False,
upx=True,
console=True,
icon="dioptas/resources/icons/icon.ico")
coll = COLLECT(exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
name='Dioptas_{}_{}'.format(platform, __version__))
if _platform == "darwin":
app = BUNDLE(coll,
name='Dioptas_{}.app'.format(__version__),
icon='dioptas/resources/icons/icon.icns')