3 # Run with as parameter a setup.py that works in the current directory
5 # It will run twice, the first time will crash
9 SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
11 if [ ! -d wine-py2exe ]; then
13 sudo apt-get install wine1.3 axel bsdiff
17 export WINEPREFIX=`pwd`
19 axel -a "http://www.python.org/ftp/python/2.7/python-2.7.msi"
20 axel -a "http://downloads.sourceforge.net/project/py2exe/py2exe/0.6.9/py2exe-0.6.9.win32-py2.7.exe"
21 #axel -a "http://winetricks.org/winetricks"
23 # http://appdb.winehq.org/objectManager.php?sClass=version&iId=21957
24 echo "Follow python setup on screen"
25 wine msiexec /i python-2.7.msi
27 echo "Follow py2exe setup on screen"
28 wine py2exe-0.6.9.win32-py2.7.exe
30 #echo "Follow Microsoft Visual C++ 2008 Redistributable Package setup on screen"
31 #bash winetricks vcrun2008
33 rm py2exe-0.6.9.win32-py2.7.exe
37 # http://bugs.winehq.org/show_bug.cgi?id=3591
39 mv drive_c/Python27/Lib/site-packages/py2exe/run.exe drive_c/Python27/Lib/site-packages/py2exe/run.exe.backup
40 bspatch drive_c/Python27/Lib/site-packages/py2exe/run.exe.backup drive_c/Python27/Lib/site-packages/py2exe/run.exe "$SCRIPT_DIR/SizeOfImage.patch"
41 mv drive_c/Python27/Lib/site-packages/py2exe/run_w.exe drive_c/Python27/Lib/site-packages/py2exe/run_w.exe.backup
42 bspatch drive_c/Python27/Lib/site-packages/py2exe/run_w.exe.backup drive_c/Python27/Lib/site-packages/py2exe/run_w.exe "$SCRIPT_DIR/SizeOfImage_w.patch"
48 export WINEPREFIX="$( cd wine-py2exe && pwd )"
52 wine "C:\\Python27\\python.exe" "$1" py2exe > "py2exe.log" 2>&1 || true
53 echo '# Copying python27.dll' >> "py2exe.log"
54 cp "$WINEPREFIX/drive_c/windows/system32/python27.dll" build/bdist.win32/winexe/bundle-2.7/
55 wine "C:\\Python27\\python.exe" "$1" py2exe >> "py2exe.log" 2>&1