Adjust freeze.py to work under Linux
This commit is contained in:
parent
876dcad28f
commit
ce2ff26771
@ -22,6 +22,7 @@ Builds a standalone executable.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
import sys
|
||||||
import platform
|
import platform
|
||||||
|
|
||||||
from cx_Freeze import setup, Executable
|
from cx_Freeze import setup, Executable
|
||||||
@ -31,6 +32,8 @@ from scripts.setupdata import setupdata
|
|||||||
|
|
||||||
def get_egl_path():
|
def get_egl_path():
|
||||||
"""Get the path for PyQt5's libEGL.dll."""
|
"""Get the path for PyQt5's libEGL.dll."""
|
||||||
|
if not sys.platform.startswith('win'):
|
||||||
|
return None
|
||||||
bits = platform.architecture()[0]
|
bits = platform.architecture()[0]
|
||||||
if bits == '32bit':
|
if bits == '32bit':
|
||||||
return r'C:\Python33_x32\Lib\site-packages\PyQt5\libEGL.dll'
|
return r'C:\Python33_x32\Lib\site-packages\PyQt5\libEGL.dll'
|
||||||
@ -41,19 +44,24 @@ def get_egl_path():
|
|||||||
|
|
||||||
build_exe_options = {
|
build_exe_options = {
|
||||||
'include_files': [
|
'include_files': [
|
||||||
(get_egl_path(), 'libEGL.dll'),
|
|
||||||
('qutebrowser/html', 'html'),
|
('qutebrowser/html', 'html'),
|
||||||
],
|
],
|
||||||
'include_msvcr': True,
|
'include_msvcr': True,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
egl_path = get_egl_path()
|
||||||
|
if egl_path is not None:
|
||||||
|
build_exe_options['include_files'].append((egl_path, 'libEGL.dll'))
|
||||||
|
|
||||||
bdist_msi_options = {
|
bdist_msi_options = {
|
||||||
# random GUID generated by uuid.uuid4()
|
# random GUID generated by uuid.uuid4()
|
||||||
'upgrade_code': '{a7119e75-4eb7-466c-ae0d-3c0eccb45196}',
|
'upgrade_code': '{a7119e75-4eb7-466c-ae0d-3c0eccb45196}',
|
||||||
'add_to_path': False,
|
'add_to_path': False,
|
||||||
}
|
}
|
||||||
|
|
||||||
executable = Executable('qutebrowser/__main__.py', base='Win32GUI',
|
base = 'Win32GUI' if sys.platform.startswith('win') else None
|
||||||
|
|
||||||
|
executable = Executable('qutebrowser/__main__.py', base=base,
|
||||||
targetName='qutebrowser.exe',
|
targetName='qutebrowser.exe',
|
||||||
shortcutName='qutebrowser',
|
shortcutName='qutebrowser',
|
||||||
shortcutDir='ProgramMenuFolder')
|
shortcutDir='ProgramMenuFolder')
|
||||||
|
Loading…
Reference in New Issue
Block a user