3 # call "./build-wine.sh" to build everything from scratch
4 # call "./build-wine.sh update" to skip building full environment (it re-download only Electrum)
6 # You probably need to update only this link
7 ELECTRUM_URL=https://github.com/downloads/spesmilo/electrum/Electrum-1.5.6.tar.gz
8 NAME_ROOT=electrum-1.5.6
10 # Please update these links carefully, some versions won't work under Wine
11 PYTHON_URL=http://www.python.org/ftp/python/2.6.6/python-2.6.6.msi
12 PYQT4_URL=http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.9.5/PyQt-Py2.6-x86-gpl-4.9.5-1.exe
13 PYWIN32_URL=http://sourceforge.net/projects/pywin32/files/pywin32/Build%20218/pywin32-218.win32-py2.6.exe/download
14 PYINSTALLER_URL=https://github.com/downloads/pyinstaller/pyinstaller/pyinstaller-2.0.zip
15 NSIS_URL=http://prdownloads.sourceforge.net/nsis/nsis-2.46-setup.exe?download
16 #ZBAR_URL=http://sourceforge.net/projects/zbar/files/zbar/0.10/zbar-0.10-setup.exe/download
18 # These settings probably don't need change
19 export WINEPREFIX=~/.wine-electrum
21 PYTHON="wine $PYHOME/python.exe -OO -B"
27 if [ "x$1" != "xupdate" ]; then
29 # Clean Wine environment
30 echo "Cleaning $WINEPREFIX"
42 wget -O python.msi "$PYTHON_URL"
43 msiexec /q /i python.msi
46 wget -O pywin32.exe "$PYWIN32_URL"
50 wget -O PyQt.exe "$PYQT4_URL"
53 #cp -r /electrum-wine/pyinstaller $WINEPREFIX/drive_c/
55 wget -O pyinstaller.zip "$PYINSTALLER_URL"
57 mv pyinstaller-2.0 $WINEPREFIX/drive_c/pyinstaller
59 # Patch pyinstaller's DummyZlib
60 patch $WINEPREFIX/drive_c/pyinstaller/PyInstaller/loader/archive.py < ../archive.patch
63 #wget -q -O zbar.exe "http://sourceforge.net/projects/zbar/files/zbar/0.10/zbar-0.10-setup.exe/download"
66 # Install dependencies
67 wget -q -O - "http://python-distribute.org/distribute_setup.py" | $PYTHON
68 wine "$PYHOME\\Scripts\\easy_install.exe" ecdsa slowaes #zbar
70 # Install NSIS installer
71 wget -q -O nsis.exe "http://prdownloads.sourceforge.net/nsis/nsis-2.46-setup.exe?download"
75 #wget -O upx.zip "http://upx.sourceforge.net/download/upx308w.zip"
84 # Download and unpack Electrum
85 wget -O electrum.tgz "$ELECTRUM_URL"
87 mv Electrum-* electrum
88 rm -rf $WINEPREFIX/drive_c/electrum
89 mv electrum $WINEPREFIX/drive_c
91 # Copy ZBar libraries to electrum
92 #cp "$WINEPREFIX/drive_c/Program Files (x86)/ZBar/bin/"*.dll "$WINEPREFIX/drive_c/electrum/"
96 rm -rf dist/$NAME_ROOT
97 rm -f dist/$NAME_ROOT.zip
98 rm -f dist/$NAME_ROOT.exe
99 rm -f dist/$NAME_ROOT-setup.exe
101 # For building standalone compressed EXE, run:
102 $PYTHON "C:/pyinstaller/pyinstaller.py" --noconfirm --ascii -w --onefile "C:/electrum/electrum"
104 # For building uncompressed directory of dependencies, run:
105 $PYTHON "C:/pyinstaller/pyinstaller.py" --noconfirm --ascii -w deterministic.spec
107 # For building NSIS installer, run:
108 wine "$WINEPREFIX/drive_c/Program Files (x86)/NSIS/makensis.exe" electrum.nsis
109 #wine $WINEPREFIX/drive_c/Program\ Files\ \(x86\)/NSIS/makensis.exe electrum.nsis
112 mv electrum.exe $NAME_ROOT.exe
113 mv electrum $NAME_ROOT
114 mv electrum-setup.exe $NAME_ROOT-setup.exe
115 zip -r $NAME_ROOT.zip $NAME_ROOT