2016-03-26 19:54:19 +01:00
|
|
|
# -*- mode: python -*-
|
|
|
|
|
2016-03-26 21:48:21 +01:00
|
|
|
import sys
|
|
|
|
import os
|
|
|
|
|
|
|
|
sys.path.insert(0, os.getcwd())
|
|
|
|
from scripts import setupcommon
|
|
|
|
|
2016-03-26 19:54:19 +01:00
|
|
|
block_cipher = None
|
|
|
|
|
|
|
|
|
2016-03-26 20:27:23 +01:00
|
|
|
def get_data_files():
|
|
|
|
data_files = [
|
|
|
|
('../qutebrowser/html', 'html'),
|
|
|
|
('../qutebrowser/img', 'img'),
|
|
|
|
('../qutebrowser/javascript', 'javascript'),
|
|
|
|
('../qutebrowser/html/doc', 'html/doc'),
|
2018-04-08 20:46:43 +02:00
|
|
|
('../qutebrowser/git-commit-id', '.'),
|
2017-09-16 16:12:00 +02:00
|
|
|
('../qutebrowser/config/configdata.yml', 'config'),
|
2016-03-26 20:27:23 +01:00
|
|
|
]
|
|
|
|
|
2017-05-17 11:42:58 +02:00
|
|
|
# if os.path.exists(os.path.join('qutebrowser', '3rdparty', 'pdfjs')):
|
|
|
|
# data_files.append(('../qutebrowser/3rdparty/pdfjs', '3rdparty/pdfjs'))
|
|
|
|
# else:
|
|
|
|
# print("Warning: excluding pdfjs as it's not present!")
|
2016-03-26 20:27:23 +01:00
|
|
|
|
|
|
|
return data_files
|
|
|
|
|
|
|
|
|
2016-03-26 21:48:21 +01:00
|
|
|
setupcommon.write_git_file()
|
|
|
|
|
|
|
|
|
2017-09-26 07:31:45 +02:00
|
|
|
if os.name == 'nt':
|
2016-03-26 21:55:47 +01:00
|
|
|
icon = 'icons/qutebrowser.ico'
|
2017-09-26 07:31:45 +02:00
|
|
|
elif sys.platform == 'darwin':
|
2016-03-26 21:55:47 +01:00
|
|
|
icon = 'icons/qutebrowser.icns'
|
|
|
|
else:
|
|
|
|
icon = None
|
|
|
|
|
|
|
|
|
2016-05-28 23:18:29 +02:00
|
|
|
a = Analysis(['../qutebrowser/__main__.py'],
|
2016-03-26 19:54:19 +01:00
|
|
|
pathex=['misc'],
|
|
|
|
binaries=None,
|
2016-03-26 20:27:23 +01:00
|
|
|
datas=get_data_files(),
|
2017-07-04 21:03:34 +02:00
|
|
|
hiddenimports=['PyQt5.QtOpenGL', 'PyQt5._QOpenGLFunctions_2_0'],
|
2016-03-26 19:54:19 +01:00
|
|
|
hookspath=[],
|
|
|
|
runtime_hooks=[],
|
2017-05-24 21:53:53 +02:00
|
|
|
excludes=['tkinter'],
|
2016-03-26 19:54:19 +01:00
|
|
|
win_no_prefer_redirects=False,
|
|
|
|
win_private_assemblies=False,
|
|
|
|
cipher=block_cipher)
|
|
|
|
pyz = PYZ(a.pure, a.zipped_data,
|
|
|
|
cipher=block_cipher)
|
|
|
|
exe = EXE(pyz,
|
|
|
|
a.scripts,
|
|
|
|
exclude_binaries=True,
|
|
|
|
name='qutebrowser',
|
2016-03-26 21:55:47 +01:00
|
|
|
icon=icon,
|
2016-03-26 19:54:19 +01:00
|
|
|
debug=False,
|
|
|
|
strip=False,
|
2018-03-25 18:43:59 +02:00
|
|
|
upx=False,
|
2016-03-26 19:54:19 +01:00
|
|
|
console=False )
|
|
|
|
coll = COLLECT(exe,
|
|
|
|
a.binaries,
|
|
|
|
a.zipfiles,
|
|
|
|
a.datas,
|
|
|
|
strip=False,
|
2018-03-25 18:43:59 +02:00
|
|
|
upx=False,
|
2016-03-26 19:54:19 +01:00
|
|
|
name='qutebrowser')
|
2016-03-30 23:28:44 +02:00
|
|
|
|
|
|
|
app = BUNDLE(coll,
|
|
|
|
name='qutebrowser.app',
|
|
|
|
icon=icon,
|
2016-10-24 22:21:34 +02:00
|
|
|
# https://github.com/pyinstaller/pyinstaller/blob/b78bfe530cdc2904f65ce098bdf2de08c9037abb/PyInstaller/hooks/hook-PyQt5.QtWebEngineWidgets.py#L24
|
2016-10-24 19:17:39 +02:00
|
|
|
bundle_identifier='org.qt-project.Qt.QtWebEngineCore')
|