Support running plugins menu_qrcode and proxyconfig_stem on Windows

by bundling needed metadata into exe.
This commit is contained in:
Dmitri Bogomolov 2021-06-10 16:41:44 +03:00
parent a757c26d09
commit 11cf001d1a
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13
3 changed files with 14 additions and 7 deletions

View File

@ -108,11 +108,12 @@ function install_pyinstaller()
fi fi
} }
function install_msgpack() function install_pip_depends()
{ {
cd "${BASE_DIR}" || exit 1 cd "${BASE_DIR}" || exit 1
echo "Installing msgpack" echo "Installing pip depends"
wine python -m pip install msgpack-python wine python -m pip install msgpack-python .[qrcode] .[tor]
python setup.py egg_info
} }
function install_pyopencl() function install_pyopencl()
@ -191,7 +192,7 @@ install_python
install_pyqt install_pyqt
install_openssl install_openssl
install_pyopencl install_pyopencl
install_msgpack install_pip_depends
install_pyinstaller install_pyinstaller
build_dll build_dll
build_exe build_exe

View File

@ -4,6 +4,7 @@ import os
import sys import sys
import time import time
from PyInstaller.utils.hooks import copy_metadata
site_root = os.path.abspath(HOMEPATH) site_root = os.path.abspath(HOMEPATH)
spec_root = os.path.abspath(SPECPATH) spec_root = os.path.abspath(SPECPATH)
@ -27,12 +28,17 @@ os.rename(
a = Analysis( a = Analysis(
[os.path.join(srcPath, 'bitmessagemain.py')], [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], pathex=[outPath],
hiddenimports=[ hiddenimports=[
'bitmessageqt.languagebox', 'pyopencl', 'numpy', 'win32com', 'bitmessageqt.languagebox', 'pyopencl', 'numpy', 'win32com',
'setuptools.msvc', '_cffi_backend' 'setuptools.msvc', '_cffi_backend',
'plugins.menu_qrcode', 'plugins.proxyconfig_stem'
], ],
hookspath=None,
runtime_hooks=None, runtime_hooks=None,
excludes=['bsddb', 'bz2', 'tcl', 'tk', 'Tkinter', 'tests'] excludes=['bsddb', 'bz2', 'tcl', 'tk', 'Tkinter', 'tests']
) )

View File

@ -81,7 +81,7 @@ if __name__ == "__main__":
try: try:
import msgpack import msgpack
installRequires.append( installRequires.append(
"msgpack-python" if msgpack.version[:2] == (0, 4) else "msgpack") "msgpack-python" if msgpack.version[:2] < (0, 6) else "msgpack")
except ImportError: except ImportError:
try: try:
import umsgpack import umsgpack