mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-23 17:47:31 +00:00
Merge pull request #2569 from bauerj/pyinstaller3
Fix pyinstaller3 build
This commit is contained in:
commit
bd854e2f3c
4 changed files with 45 additions and 31 deletions
|
@ -5,9 +5,13 @@ ELECTRUM_GIT_URL=git://github.com/spesmilo/electrum.git
|
||||||
BRANCH=master
|
BRANCH=master
|
||||||
NAME_ROOT=electrum
|
NAME_ROOT=electrum
|
||||||
|
|
||||||
|
if [ "$#" -gt 0 ]; then
|
||||||
|
BRANCH="$1"
|
||||||
|
fi
|
||||||
|
|
||||||
# These settings probably don't need any change
|
# These settings probably don't need any change
|
||||||
export WINEPREFIX=/opt/wine64
|
export WINEPREFIX=/opt/wine64
|
||||||
|
export PYTHONHASHSEED=22
|
||||||
|
|
||||||
PYHOME=c:/python27
|
PYHOME=c:/python27
|
||||||
PYTHON="wine $PYHOME/python.exe -OO -B"
|
PYTHON="wine $PYHOME/python.exe -OO -B"
|
||||||
|
@ -35,7 +39,7 @@ fi
|
||||||
cd electrum-git
|
cd electrum-git
|
||||||
VERSION=`git describe --tags`
|
VERSION=`git describe --tags`
|
||||||
echo "Last commit: $VERSION"
|
echo "Last commit: $VERSION"
|
||||||
$PYTHON setup.py install
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
rm -rf $WINEPREFIX/drive_c/electrum
|
rm -rf $WINEPREFIX/drive_c/electrum
|
||||||
|
@ -48,18 +52,22 @@ cp -r ../../../packages $WINEPREFIX/drive_c/electrum/
|
||||||
# add locale dir
|
# add locale dir
|
||||||
cp -r ../../../lib/locale $WINEPREFIX/drive_c/electrum/lib/
|
cp -r ../../../lib/locale $WINEPREFIX/drive_c/electrum/lib/
|
||||||
|
|
||||||
|
|
||||||
# Build Qt resources
|
# Build Qt resources
|
||||||
wine $WINEPREFIX/drive_c/Python27/Lib/site-packages/PyQt4/pyrcc4.exe C:/electrum/icons.qrc -o C:/electrum/lib/icons_rc.py
|
wine $WINEPREFIX/drive_c/Python27/Lib/site-packages/PyQt4/pyrcc4.exe C:/electrum/icons.qrc -o C:/electrum/lib/icons_rc.py
|
||||||
wine $WINEPREFIX/drive_c/Python27/Lib/site-packages/PyQt4/pyrcc4.exe C:/electrum/icons.qrc -o C:/electrum/gui/qt/icons_rc.py
|
wine $WINEPREFIX/drive_c/Python27/Lib/site-packages/PyQt4/pyrcc4.exe C:/electrum/icons.qrc -o C:/electrum/gui/qt/icons_rc.py
|
||||||
|
|
||||||
|
|
||||||
|
pushd $WINEPREFIX/drive_c/electrum
|
||||||
|
$PYTHON setup.py install
|
||||||
|
popd
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
rm -rf dist/
|
rm -rf dist/
|
||||||
|
|
||||||
# build standalone version
|
# build standalone version
|
||||||
$PYTHON "C:/pyinstaller/pyinstaller.py" --noconfirm --ascii --name $NAME_ROOT-$VERSION.exe -w deterministic.spec
|
wine "C:/python27/scripts/pyinstaller.exe" --noconfirm --ascii --name $NAME_ROOT-$VERSION.exe -w deterministic.spec
|
||||||
|
|
||||||
exit
|
|
||||||
# build NSIS installer
|
# build NSIS installer
|
||||||
# $VERSION could be passed to the electrum.nsi script, but this would require some rewriting in the script iself.
|
# $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
|
wine "$WINEPREFIX/drive_c/Program Files (x86)/NSIS/makensis.exe" /DPRODUCT_VERSION=$VERSION electrum.nsi
|
||||||
|
@ -68,11 +76,13 @@ cd dist
|
||||||
mv electrum-setup.exe $NAME_ROOT-$VERSION-setup.exe
|
mv electrum-setup.exe $NAME_ROOT-$VERSION-setup.exe
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
|
rm build/ -r
|
||||||
|
|
||||||
# build portable version
|
# build portable version
|
||||||
cp portable.patch $WINEPREFIX/drive_c/electrum
|
cp portable.patch $WINEPREFIX/drive_c/electrum
|
||||||
pushd $WINEPREFIX/drive_c/electrum
|
pushd $WINEPREFIX/drive_c/electrum
|
||||||
patch < portable.patch
|
patch < portable.patch
|
||||||
popd
|
popd
|
||||||
$PYTHON "C:/pyinstaller/pyinstaller.py" --noconfirm --ascii --name $NAME_ROOT-$VERSION-portable.exe -w deterministic.spec
|
wine "C:/python27/scripts/pyinstaller.exe" --noconfirm --ascii --name $NAME_ROOT-$VERSION-portable.exe -w deterministic.spec
|
||||||
|
|
||||||
echo "Done."
|
echo "Done."
|
||||||
|
|
|
@ -47,10 +47,13 @@ a = Analysis([home+'electrum',
|
||||||
],
|
],
|
||||||
datas = [
|
datas = [
|
||||||
(home+'lib/currencies.json', 'electrum'),
|
(home+'lib/currencies.json', 'electrum'),
|
||||||
(home+'lib/wordlist/english.txt', 'electrum/wordlist')],
|
(home+'lib/wordlist/english.txt', 'electrum/wordlist'),
|
||||||
|
(home+'packages/requests/cacert.pem', 'requests/cacert.pem')
|
||||||
|
],
|
||||||
binaries= zbar_dlls,
|
binaries= zbar_dlls,
|
||||||
hookspath=[])
|
hookspath=[],
|
||||||
|
hiddenimports=["lib", "gui", "plugins", "electrum_gui.qt.icons_rc"]
|
||||||
|
)
|
||||||
|
|
||||||
# http://stackoverflow.com/questions/19055089/pyinstaller-onefile-warning-pyconfig-h-when-importing-scipy-or-scipy-signal
|
# http://stackoverflow.com/questions/19055089/pyinstaller-onefile-warning-pyconfig-h-when-importing-scipy-or-scipy-signal
|
||||||
for d in a.datas:
|
for d in a.datas:
|
||||||
|
@ -59,6 +62,7 @@ for d in a.datas:
|
||||||
break
|
break
|
||||||
|
|
||||||
pyz = PYZ(a.pure)
|
pyz = PYZ(a.pure)
|
||||||
|
|
||||||
exe = EXE(pyz,
|
exe = EXE(pyz,
|
||||||
a.scripts,
|
a.scripts,
|
||||||
a.binaries,
|
a.binaries,
|
||||||
|
@ -68,7 +72,7 @@ exe = EXE(pyz,
|
||||||
strip=None,
|
strip=None,
|
||||||
upx=False,
|
upx=False,
|
||||||
icon=home+'icons/electrum.ico',
|
icon=home+'icons/electrum.ico',
|
||||||
console=False)
|
console=True)
|
||||||
# The console True makes an annoying black box pop up, but it does make Electrum output command line commands, with this turned off no output will be given but commands can still be used
|
# The console True makes an annoying black box pop up, but it does make Electrum output command line commands, with this turned off no output will be given but commands can still be used
|
||||||
|
|
||||||
coll = COLLECT(exe,
|
coll = COLLECT(exe,
|
||||||
|
@ -79,5 +83,6 @@ coll = COLLECT(exe,
|
||||||
upx=True,
|
upx=True,
|
||||||
debug=False,
|
debug=False,
|
||||||
icon=home+'icons/electrum.ico',
|
icon=home+'icons/electrum.ico',
|
||||||
console=False,
|
console=True,
|
||||||
name=os.path.join('dist', 'electrum'))
|
name=os.path.join('dist', 'electrum'))
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,6 @@
|
||||||
PYTHON_URL=https://www.python.org/ftp/python/2.7.13/python-2.7.13.msi
|
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
|
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
|
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-3.2.zip
|
|
||||||
NSIS_URL=http://prdownloads.sourceforge.net/nsis/nsis-2.46-setup.exe?download
|
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
|
SETUPTOOLS_URL=https://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11.win32-py2.7.exe
|
||||||
|
|
||||||
|
@ -23,7 +21,8 @@ set -e
|
||||||
|
|
||||||
# Clean up Wine environment
|
# Clean up Wine environment
|
||||||
echo "Cleaning $WINEPREFIX"
|
echo "Cleaning $WINEPREFIX"
|
||||||
rm -rf $WINEPREFIX
|
rm -rf $WINEPREFIX/
|
||||||
|
mkdir $WINEPREFIX
|
||||||
echo "done"
|
echo "done"
|
||||||
|
|
||||||
wine 'wineboot'
|
wine 'wineboot'
|
||||||
|
@ -47,28 +46,28 @@ wine pywin32.exe
|
||||||
wget -O PyQt.exe "$PYQT4_URL"
|
wget -O PyQt.exe "$PYQT4_URL"
|
||||||
wine PyQt.exe
|
wine PyQt.exe
|
||||||
|
|
||||||
# Install pyinstaller
|
|
||||||
wget -O pyinstaller.zip "$PYINSTALLER_URL"
|
|
||||||
unzip pyinstaller.zip
|
|
||||||
#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-0.10-setup.exe
|
|
||||||
|
|
||||||
# install Cryptodome
|
|
||||||
$PYTHON -m pip install pycryptodomex
|
|
||||||
|
|
||||||
# Install setuptools
|
# Install setuptools
|
||||||
wget -O setuptools.exe "$SETUPTOOLS_URL"
|
wget -O setuptools.exe "$SETUPTOOLS_URL"
|
||||||
wine setuptools.exe
|
wine setuptools.exe
|
||||||
|
|
||||||
|
|
||||||
|
# Install pyinstaller
|
||||||
|
$PYTHON -m pip install pyinstaller==3.2.1
|
||||||
|
$PYTHON -m pip install 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
|
||||||
|
|
||||||
|
# install Cryptodome
|
||||||
|
$PYTHON -m pip install pycryptodomex
|
||||||
|
|
||||||
|
# Upgrade setuptools (so Electrum can be installed later)
|
||||||
|
$PYTHON -m pip install setuptools --upgrade
|
||||||
|
|
||||||
|
|
||||||
# Install NSIS installer
|
# Install NSIS installer
|
||||||
|
echo "Make sure to untick 'Start NSIS' and 'Show release notes'"
|
||||||
wget -q -O nsis.exe "$NSIS_URL"
|
wget -q -O nsis.exe "$NSIS_URL"
|
||||||
wine nsis.exe
|
wine nsis.exe
|
||||||
|
|
||||||
|
|
2
electrum
2
electrum
|
@ -90,7 +90,7 @@ if not is_android:
|
||||||
check_imports()
|
check_imports()
|
||||||
|
|
||||||
# load local module as electrum
|
# load local module as electrum
|
||||||
if is_bundle or is_local or is_android:
|
if is_local or is_android:
|
||||||
import imp
|
import imp
|
||||||
imp.load_module('electrum', *imp.find_module('lib'))
|
imp.load_module('electrum', *imp.find_module('lib'))
|
||||||
imp.load_module('electrum_gui', *imp.find_module('gui'))
|
imp.load_module('electrum_gui', *imp.find_module('gui'))
|
||||||
|
|
Loading…
Add table
Reference in a new issue