From 11cf001d1a85a2978f6a21b19817a07685a260bb Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Thu, 10 Jun 2021 16:41:44 +0300 Subject: [PATCH] Support running plugins menu_qrcode and proxyconfig_stem on Windows by bundling needed metadata into exe. --- buildscripts/winbuild.sh | 9 +++++---- packages/pyinstaller/bitmessagemain.spec | 10 ++++++++-- setup.py | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/buildscripts/winbuild.sh b/buildscripts/winbuild.sh index 989e59bd..fbaabe8c 100755 --- a/buildscripts/winbuild.sh +++ b/buildscripts/winbuild.sh @@ -108,11 +108,12 @@ function install_pyinstaller() fi } -function install_msgpack() +function install_pip_depends() { cd "${BASE_DIR}" || exit 1 - echo "Installing msgpack" - wine python -m pip install msgpack-python + echo "Installing pip depends" + wine python -m pip install msgpack-python .[qrcode] .[tor] + python setup.py egg_info } function install_pyopencl() @@ -191,7 +192,7 @@ install_python install_pyqt install_openssl install_pyopencl -install_msgpack +install_pip_depends install_pyinstaller build_dll build_exe diff --git a/packages/pyinstaller/bitmessagemain.spec b/packages/pyinstaller/bitmessagemain.spec index 082cc6fd..d73e4ddf 100644 --- a/packages/pyinstaller/bitmessagemain.spec +++ b/packages/pyinstaller/bitmessagemain.spec @@ -4,6 +4,7 @@ import os import sys import time +from PyInstaller.utils.hooks import copy_metadata site_root = os.path.abspath(HOMEPATH) spec_root = os.path.abspath(SPECPATH) @@ -27,12 +28,17 @@ os.rename( a = Analysis( [os.path.join(srcPath, 'bitmessagemain.py')], + datas = [ + (os.path.join(spec_root[:-20], 'pybitmessage.egg-info') + '/*', + 'pybitmessage.egg-info') + ] + copy_metadata('msgpack-python') + copy_metadata('qrcode') + + copy_metadata('six') + copy_metadata('stem'), pathex=[outPath], hiddenimports=[ 'bitmessageqt.languagebox', 'pyopencl', 'numpy', 'win32com', - 'setuptools.msvc', '_cffi_backend' + 'setuptools.msvc', '_cffi_backend', + 'plugins.menu_qrcode', 'plugins.proxyconfig_stem' ], - hookspath=None, runtime_hooks=None, excludes=['bsddb', 'bz2', 'tcl', 'tk', 'Tkinter', 'tests'] ) diff --git a/setup.py b/setup.py index 5ebace50..77ec81c8 100644 --- a/setup.py +++ b/setup.py @@ -81,7 +81,7 @@ if __name__ == "__main__": try: import msgpack installRequires.append( - "msgpack-python" if msgpack.version[:2] == (0, 4) else "msgpack") + "msgpack-python" if msgpack.version[:2] < (0, 6) else "msgpack") except ImportError: try: import umsgpack