Compare commits

..

No commits in common. "bd854e2f3c53c43b5708e6e1cb7db800b28fc05b" and "6931ffada55087c481b9d098afa5d0fa8c1794ec" have entirely different histories.

5 changed files with 55 additions and 75 deletions

View File

@ -5,13 +5,9 @@ ELECTRUM_GIT_URL=git://github.com/spesmilo/electrum.git
BRANCH=master
NAME_ROOT=electrum
if [ "$#" -gt 0 ]; then
BRANCH="$1"
fi
# These settings probably don't need any change
export WINEPREFIX=/opt/wine64
export PYTHONHASHSEED=22
PYHOME=c:/python27
PYTHON="wine $PYHOME/python.exe -OO -B"
@ -52,22 +48,17 @@ cp -r ../../../packages $WINEPREFIX/drive_c/electrum/
# add locale dir
cp -r ../../../lib/locale $WINEPREFIX/drive_c/electrum/lib/
# 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/gui/qt/icons_rc.py
pushd $WINEPREFIX/drive_c/electrum
$PYTHON setup.py install
popd
cd ..
rm -rf dist/
# build standalone version
wine "C:/python27/scripts/pyinstaller.exe" --noconfirm --ascii --name $NAME_ROOT-$VERSION.exe -w deterministic.spec
$PYTHON "C:/pyinstaller/pyinstaller.py" --noconfirm --ascii --name $NAME_ROOT-$VERSION.exe -w deterministic.spec
# 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
@ -76,13 +67,11 @@ cd dist
mv electrum-setup.exe $NAME_ROOT-$VERSION-setup.exe
cd ..
rm build/ -r
# build portable version
cp portable.patch $WINEPREFIX/drive_c/electrum
pushd $WINEPREFIX/drive_c/electrum
patch < portable.patch
popd
wine "C:/python27/scripts/pyinstaller.exe" --noconfirm --ascii --name $NAME_ROOT-$VERSION-portable.exe -w deterministic.spec
$PYTHON "C:/pyinstaller/pyinstaller.py" --noconfirm --ascii --name $NAME_ROOT-$VERSION-portable.exe -w deterministic.spec
echo "Done."

View File

@ -11,19 +11,6 @@ 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',
@ -34,9 +21,6 @@ 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',
@ -45,15 +29,45 @@ a = Analysis([home+'electrum',
home+'plugins/ledger/qt.py',
home+'packages/requests/utils.py'
],
datas = [
(home+'lib/currencies.json', 'electrum'),
(home+'lib/wordlist/english.txt', 'electrum/wordlist'),
(home+'packages/requests/cacert.pem', 'requests/cacert.pem')
],
binaries= zbar_dlls,
hookspath=[],
hiddenimports=["lib", "gui", "plugins", "electrum_gui.qt.icons_rc"]
)
pathex=[home+'lib', home+'gui', home+'plugins', home+'packages'],
hiddenimports=['lib', 'gui'],
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:
@ -62,7 +76,6 @@ for d in a.datas:
break
pyz = PYZ(a.pure)
exe = EXE(pyz,
a.scripts,
a.binaries,
@ -72,7 +85,7 @@ exe = EXE(pyz,
strip=None,
upx=False,
icon=home+'icons/electrum.ico',
console=True)
console=False)
# 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,
@ -83,6 +96,5 @@ coll = COLLECT(exe,
upx=True,
debug=False,
icon=home+'icons/electrum.ico',
console=True,
console=False,
name=os.path.join('dist', 'electrum'))

View File

@ -4,6 +4,7 @@
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
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
@ -21,8 +22,7 @@ set -e
# Clean up Wine environment
echo "Cleaning $WINEPREFIX"
rm -rf $WINEPREFIX/
mkdir $WINEPREFIX
rm -rf $WINEPREFIX
echo "done"
wine 'wineboot'
@ -46,28 +46,23 @@ wine pywin32.exe
wget -O PyQt.exe "$PYQT4_URL"
wine PyQt.exe
# Install setuptools
wget -O setuptools.exe "$SETUPTOOLS_URL"
wine setuptools.exe
# Install pyinstaller
$PYTHON -m pip install pyinstaller==3.2.1
$PYTHON -m pip install win_inet_pton
wget -O pyinstaller.zip "$PYINSTALLER_URL"
unzip pyinstaller.zip
mv PyInstaller-2.1 $WINEPREFIX/drive_c/pyinstaller
# 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
#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 setuptools
wget -O setuptools.exe "$SETUPTOOLS_URL"
wine setuptools.exe
# Install NSIS installer
echo "Make sure to untick 'Start NSIS' and 'Show release notes'"
wget -q -O nsis.exe "$NSIS_URL"
wine nsis.exe

View File

@ -90,11 +90,10 @@ if not is_android:
check_imports()
# load local module as electrum
if is_local or is_android:
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

View File

@ -23,19 +23,4 @@
# 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',
]