parent
442ad05dc9
commit
d97e1741e0
@ -101,36 +101,8 @@ def smoke_test(executable):
|
||||
|
||||
|
||||
def patch_mac_app():
|
||||
"""Patch .app to copy missing data and link some libs.
|
||||
|
||||
See https://github.com/pyinstaller/pyinstaller/issues/2276
|
||||
"""
|
||||
"""Patch .app to use our Info.plist."""
|
||||
app_path = os.path.join('dist', 'qutebrowser.app')
|
||||
qtwe_core_dir = os.path.join('.tox', 'pyinstaller', 'lib', 'python3.6',
|
||||
'site-packages', 'PyQt5', 'Qt', 'lib',
|
||||
'QtWebEngineCore.framework')
|
||||
# Copy QtWebEngineProcess.app
|
||||
proc_app = 'QtWebEngineProcess.app'
|
||||
shutil.copytree(os.path.join(qtwe_core_dir, 'Helpers', proc_app),
|
||||
os.path.join(app_path, 'Contents', 'MacOS', proc_app))
|
||||
# Copy resources
|
||||
for f in glob.glob(os.path.join(qtwe_core_dir, 'Resources', '*')):
|
||||
dest = os.path.join(app_path, 'Contents', 'Resources')
|
||||
if os.path.isdir(f):
|
||||
dir_dest = os.path.join(dest, os.path.basename(f))
|
||||
print("Copying directory {} to {}".format(f, dir_dest))
|
||||
shutil.copytree(f, dir_dest)
|
||||
else:
|
||||
print("Copying {} to {}".format(f, dest))
|
||||
shutil.copy(f, dest)
|
||||
# Link dependencies
|
||||
for lib in ['QtCore', 'QtWebEngineCore', 'QtQuick', 'QtQml', 'QtNetwork',
|
||||
'QtGui', 'QtWebChannel', 'QtPositioning']:
|
||||
dest = os.path.join(app_path, lib + '.framework', 'Versions', '5')
|
||||
os.makedirs(dest)
|
||||
os.symlink(os.path.join(os.pardir, os.pardir, os.pardir, 'Contents',
|
||||
'MacOS', lib),
|
||||
os.path.join(dest, lib))
|
||||
# Patch Info.plist - pyinstaller's options are too limiting
|
||||
plist_path = os.path.join(app_path, 'Contents', 'Info.plist')
|
||||
with open(plist_path, "rb") as f:
|
||||
|
Loading…
Reference in New Issue
Block a user