Update wine build script
[electrum-nvc.git] / contrib / build-wine / prepare-wine.sh
1 #!/bin/bash
2
3 # Please update these links carefully, some versions won't work under Wine
4 PYTHON_URL=http://www.python.org/ftp/python/2.6.6/python-2.6.6.msi
5 PYQT4_URL=http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.9.5/PyQt-Py2.6-x86-gpl-4.9.5-1.exe
6 PYWIN32_URL=http://sourceforge.net/projects/pywin32/files/pywin32/Build%20218/pywin32-218.win32-py2.6.exe/download
7 PYINSTALLER_URL=http://downloads.sourceforge.net/project/pyinstaller/2.0/pyinstaller-2.0.zip
8 NSIS_URL=http://prdownloads.sourceforge.net/nsis/nsis-2.46-setup.exe?download
9 #ZBAR_URL=http://sourceforge.net/projects/zbar/files/zbar/0.10/zbar-0.10-setup.exe/download
10
11 # These settings probably don't need change
12 export WINEPREFIX=/opt/wine-electrum
13 PYHOME=c:/python26
14 PYTHON="wine $PYHOME/python.exe -OO -B"
15
16 # Let's begin!
17 cd `dirname $0`
18 set -e
19
20 # Clean up Wine environment
21 echo "Cleaning $WINEPREFIX"
22 rm -rf $WINEPREFIX/*
23 echo "done"
24
25 echo "Cleaning tmp"
26 rm -rf tmp
27 mkdir -p tmp
28 echo "done"
29
30 cd tmp
31
32 # Install Python
33 wget -O python.msi "$PYTHON_URL"
34 msiexec /q /i python.msi
35
36 # Install PyWin32
37 wget -O pywin32.exe "$PYWIN32_URL"
38 wine pywin32.exe
39
40 # Install PyQt4
41 wget -O PyQt.exe "$PYQT4_URL"
42 wine PyQt.exe
43
44 #cp -r /electrum-wine/pyinstaller $WINEPREFIX/drive_c/
45 # Install pyinstaller
46 wget -O pyinstaller.zip "$PYINSTALLER_URL"
47 unzip pyinstaller.zip
48 mv pyinstaller-2.0 $WINEPREFIX/drive_c/pyinstaller
49
50 # Patch pyinstaller's DummyZlib
51 patch $WINEPREFIX/drive_c/pyinstaller/PyInstaller/loader/archive.py < ../archive.patch
52
53 # Install ZBar
54 #wget -q -O zbar.exe "http://sourceforge.net/projects/zbar/files/zbar/0.10/zbar-0.10-setup.exe/download"
55 #wine zbar.exe
56
57 # Install dependencies
58 wget -q -O - "http://python-distribute.org/distribute_setup.py" | $PYTHON
59 wine "$PYHOME\\Scripts\\easy_install.exe" ecdsa slowaes #zbar
60
61 # Install NSIS installer
62 wget -q -O nsis.exe "http://prdownloads.sourceforge.net/nsis/nsis-2.46-setup.exe?download"
63 wine nsis.exe
64
65 # Install UPX
66 wget -O upx.zip "http://upx.sourceforge.net/download/upx308w.zip"
67 unzip -o upx.zip
68 cp upx*/upx.exe .