mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-23 17:47:31 +00:00
changes for pyinstaller3
This commit is contained in:
parent
6931ffada5
commit
8f60d5ec90
5 changed files with 47 additions and 41 deletions
|
@ -35,7 +35,7 @@ fi
|
|||
cd electrum-git
|
||||
VERSION=`git describe --tags`
|
||||
echo "Last commit: $VERSION"
|
||||
|
||||
$PYTHON setup.py install
|
||||
cd ..
|
||||
|
||||
rm -rf $WINEPREFIX/drive_c/electrum
|
||||
|
@ -59,6 +59,7 @@ rm -rf dist/
|
|||
# build standalone version
|
||||
$PYTHON "C:/pyinstaller/pyinstaller.py" --noconfirm --ascii --name $NAME_ROOT-$VERSION.exe -w deterministic.spec
|
||||
|
||||
exit
|
||||
# build NSIS installer
|
||||
# $VERSION could be passed to the electrum.nsi script, but this would require some rewriting in the script iself.
|
||||
wine "$WINEPREFIX/drive_c/Program Files (x86)/NSIS/makensis.exe" /DPRODUCT_VERSION=$VERSION electrum.nsi
|
||||
|
|
|
@ -11,6 +11,19 @@ else:
|
|||
|
||||
home = 'C:\\electrum\\'
|
||||
|
||||
dlls = ['libiconv-2.dll',
|
||||
'libjpeg-7.dll',
|
||||
'libMagickCore-2.dll',
|
||||
'libMagickWand-2.dll',
|
||||
'libpng12-0.dll',
|
||||
'libtiff-3.dll',
|
||||
'libxml2-2.dll',
|
||||
'libzbar-0.dll',
|
||||
'zlib1.dll']
|
||||
|
||||
zbar_dlls = [('C:\\Program Files (x86)\\Zbar\\bin\\'+x, x) for x in dlls]
|
||||
|
||||
|
||||
# We don't put these files in to actually include them in the script but to make the Analysis method scan them for imports
|
||||
a = Analysis([home+'electrum',
|
||||
home+'gui/qt/main_window.py',
|
||||
|
@ -21,6 +34,9 @@ a = Analysis([home+'electrum',
|
|||
home+'lib/bitcoin.py',
|
||||
home+'lib/dnssec.py',
|
||||
home+'lib/commands.py',
|
||||
home+'lib/daemon.py',
|
||||
home+'lib/plugins.py',
|
||||
home+'lib/qrscanner.py',
|
||||
home+'plugins/cosigner_pool/qt.py',
|
||||
home+'plugins/email_requests/qt.py',
|
||||
home+'plugins/trezor/client.py',
|
||||
|
@ -29,45 +45,12 @@ a = Analysis([home+'electrum',
|
|||
home+'plugins/ledger/qt.py',
|
||||
home+'packages/requests/utils.py'
|
||||
],
|
||||
pathex=[home+'lib', home+'gui', home+'plugins', home+'packages'],
|
||||
hiddenimports=['lib', 'gui'],
|
||||
datas = [
|
||||
(home+'lib/currencies.json', 'electrum'),
|
||||
(home+'lib/wordlist/english.txt', 'electrum/wordlist')],
|
||||
binaries= zbar_dlls,
|
||||
hookspath=[])
|
||||
|
||||
##### include folder in distribution #######
|
||||
def extra_datas(mydir):
|
||||
def rec_glob(p, files):
|
||||
import os
|
||||
import glob
|
||||
for d in glob.glob(p):
|
||||
if os.path.isfile(d):
|
||||
files.append(d)
|
||||
rec_glob("%s/*" % d, files)
|
||||
files = []
|
||||
rec_glob("%s/*" % mydir, files)
|
||||
extra_datas = []
|
||||
for f in files:
|
||||
d = f.split('\\')
|
||||
t = ''
|
||||
for a in d[2:]:
|
||||
if len(t)==0:
|
||||
t = a
|
||||
else:
|
||||
t = t+'\\'+a
|
||||
extra_datas.append((t, f, 'DATA'))
|
||||
|
||||
return extra_datas
|
||||
###########################################
|
||||
|
||||
# append dirs
|
||||
|
||||
# cacert.pem
|
||||
a.datas += [ ('requests/cacert.pem', home+'packages/requests/cacert.pem', 'DATA') ]
|
||||
|
||||
# Py folders that are needed because of the magic import finding
|
||||
a.datas += extra_datas(home+'gui')
|
||||
a.datas += extra_datas(home+'lib')
|
||||
a.datas += extra_datas(home+'plugins')
|
||||
a.datas += extra_datas(home+'packages')
|
||||
|
||||
# http://stackoverflow.com/questions/19055089/pyinstaller-onefile-warning-pyconfig-h-when-importing-scipy-or-scipy-signal
|
||||
for d in a.datas:
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
PYTHON_URL=https://www.python.org/ftp/python/2.7.13/python-2.7.13.msi
|
||||
PYQT4_URL=http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.11.1/PyQt4-4.11.1-gpl-Py2.7-Qt4.8.6-x32.exe
|
||||
PYWIN32_URL=http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/pywin32-219.win32-py2.7.exe/download
|
||||
PYINSTALLER_URL=https://pypi.python.org/packages/source/P/PyInstaller/PyInstaller-2.1.zip
|
||||
#PYINSTALLER_URL=https://pypi.python.org/packages/source/P/PyInstaller/PyInstaller-2.1.zip
|
||||
PYINSTALLER_URL=https://pypi.python.org/packages/source/P/PyInstaller/PyInstaller-3.2.zip
|
||||
NSIS_URL=http://prdownloads.sourceforge.net/nsis/nsis-2.46-setup.exe?download
|
||||
SETUPTOOLS_URL=https://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11.win32-py2.7.exe
|
||||
|
||||
|
@ -49,11 +50,16 @@ wine PyQt.exe
|
|||
# Install pyinstaller
|
||||
wget -O pyinstaller.zip "$PYINSTALLER_URL"
|
||||
unzip pyinstaller.zip
|
||||
mv PyInstaller-2.1 $WINEPREFIX/drive_c/pyinstaller
|
||||
#mv PyInstaller-2.1 $WINEPREFIX/drive_c/pyinstaller
|
||||
mv PyInstaller-3.2.1 $WINEPREFIX/drive_c/pyinstaller
|
||||
#note: run setup.py too!
|
||||
wine c:/python27/python.exe -OO -B setup.py install
|
||||
|
||||
also needed: https://pypi.python.org/pypi/win_inet_pton
|
||||
|
||||
# Install ZBar
|
||||
#wget -q -O zbar.exe "http://sourceforge.net/projects/zbar/files/zbar/0.10/zbar-0.10-setup.exe/download"
|
||||
#wine zbar.exe
|
||||
#wine zbar-0.10-setup.exe
|
||||
|
||||
# install Cryptodome
|
||||
$PYTHON -m pip install pycryptodomex
|
||||
|
|
1
electrum
1
electrum
|
@ -94,6 +94,7 @@ if is_bundle or is_local or is_android:
|
|||
import imp
|
||||
imp.load_module('electrum', *imp.find_module('lib'))
|
||||
imp.load_module('electrum_gui', *imp.find_module('gui'))
|
||||
imp.load_module('electrum_plugins', *imp.find_module('plugins'))
|
||||
|
||||
from electrum import bitcoin, network
|
||||
from electrum import SimpleConfig, Network
|
||||
|
|
|
@ -23,4 +23,19 @@
|
|||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
import audio_modem
|
||||
|
||||
names = [
|
||||
'audio_modem',
|
||||
'cosigner_pool',
|
||||
'digitalbitbox',
|
||||
'email_requests',
|
||||
'greenaddress_instant',
|
||||
'hw_wallet',
|
||||
'keepkey',
|
||||
'labels',
|
||||
'ledger',
|
||||
'trezor',
|
||||
'trustedcoin',
|
||||
'virtualkeyboard',
|
||||
]
|
||||
|
|
Loading…
Add table
Reference in a new issue