~devvmh/mnemosyne-proj/pbienst

« back to all changes in this revision

Viewing changes to mnemosyne/mnemosyne.spec

  • Committer: Devin Howard
  • Date: 2016-10-13 02:02:28 UTC
  • Revision ID: devin@callysto.com-20161013020228-zsizsbtr6v3ou9mq
Update macOS build for Python 3 and PyQt5

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 
10
10
my_fixes = True
11
11
 
12
 
if sys.platform == "win32":
13
 
             datas.append(("C:\\Program Files (x86)\\mplayer.exe", "."))
14
 
             
15
 
             # Note: PyQt5.7 does not yet seem to be supported by pyinstaller
16
 
             # Also need to use the dev version of pyinstaller
17
 
             #     pip install -e https://github.com/pyinstaller/pyinstaller/archive/develop.zip
18
 
             # There are some missing files that are not picked up on.
19
 
             
20
 
             if my_fixes:
21
 
                          pyqt_dir = "C:\\Program Files (x86)\\Python35-32\\Lib\\site-packages\\PyQt5\\"
22
 
                          datas.append((pyqt_dir + "QtWebEngineProcess.exe", "."))
23
 
                          datas.append((pyqt_dir + "QtWebEngineCore.pyd", "."))
24
 
                          datas.append((pyqt_dir + "resources\\*", "."))
25
 
             
26
 
             excludes = ['IPython', 'lib2to3']
27
 
    
28
 
a = Analysis(['mnemosyne\\pyqt_ui\\mnemosyne'],
29
 
             pathex=[os.getcwd()],
30
 
             binaries=[],
31
 
             datas=datas,
32
 
             hiddenimports=['mnemosyne.version', 
 
12
binaries = []
 
13
 
 
14
hiddenimports = [
 
15
             'mnemosyne.version', 
33
16
             'mnemosyne.libmnemosyne.card', 
34
17
             'mnemosyne.libmnemosyne.card_type', 
35
18
             'mnemosyne.libmnemosyne.card_type_converter', 
179
162
             'mnemosyne.pyqt_ui.tag_tree_wdgt',
180
163
             'mnemosyne.pyqt_ui.tip_after_starting_n_times', 
181
164
             'mnemosyne.pyqt_ui.tip_dlg',
 
165
             'mnemosyne.pyqt_ui.ui_main_wdgt',
182
166
             'mnemosyne.web_server.jquery_mb_html5_audio',
183
167
             'mnemosyne.web_server.review_wdgt',
184
168
             'mnemosyne.web_server.simple_html5_audio', 
185
169
             'mnemosyne.web_server.web_server', 
186
170
             'mnemosyne.web_server.web_server_renderer', 
187
 
             'mnemosyne.web_server.web_server_render_chain'],
 
171
             'mnemosyne.web_server.web_server_render_chain'
 
172
]
 
173
 
 
174
if sys.platform == "win32":
 
175
             datas.append(("C:\\Program Files (x86)\\mplayer.exe", "."))
 
176
             
 
177
             # Note: PyQt5.7 does not yet seem to be supported by pyinstaller
 
178
             # Also need to use the dev version of pyinstaller
 
179
             #     pip install -e https://github.com/pyinstaller/pyinstaller/archive/develop.zip
 
180
             # There are some missing files that are not picked up on.
 
181
             
 
182
             if my_fixes:
 
183
                          pyqt_dir = "C:\\Program Files (x86)\\Python35-32\\Lib\\site-packages\\PyQt5\\ "
 
184
                          datas.append((pyqt_dir + "QtWebEngineProcess.exe", "."))
 
185
                          datas.append((pyqt_dir + "QtWebEngineCore.pyd", "."))
 
186
                          datas.append((pyqt_dir + "resources\\*", "."))
 
187
             
 
188
             excludes = ['IPython', 'lib2to3']
 
189
 
 
190
if sys.platform == "darwin":
 
191
             hiddenimports.append('PyQt5.QtWebEngineCore')
 
192
             hiddenimports.append('PyQt5.QtWebEngineWidgets')
 
193
             binaries.append(('/usr/local/bin/mplayer', '.'))
 
194
 
 
195
a = Analysis([os.path.join('mnemosyne', 'pyqt_ui', 'mnemosyne')],
 
196
             pathex=[os.getcwd()],
 
197
             binaries=binaries,
 
198
             datas=datas,
 
199
             hiddenimports=hiddenimports,
188
200
             hookspath=[],
189
201
             runtime_hooks=[],
190
202
             excludes=excludes,
208
220
          strip=False,
209
221
          upx=True,
210
222
          console=False,
211
 
          icon='pixmaps\\mnemosyne.ico')
 
223
          icon=os.path.join('pixmaps', 'mnemosyne.ico'))
212
224
          
213
225
coll = COLLECT(exe,
214
226
               a.binaries,
217
229
               strip=False,
218
230
               upx=True,
219
231
               name='Mnemosyne')
220
 
               
 
232
 
 
233
if sys.platform == "darwin":
 
234
  app = BUNDLE(coll,
 
235
               name='Mnemosyne.app',
 
236
               icon=os.path.join('pixmaps', 'mnemosyne.icns'),
 
237
               bundle_identifier='org.qt-project.Qt.QtWebEngineCore')
 
238
 
221
239
if my_fixes and (sys.platform == "win32"):
222
240
             shutil.move("dist\\mnemosyne\\QtWebEngineCore.pyd", "dist\\mnemosyne\\PyQt5.QtWebEngineCore.pyd")