]> Raphaƫl G. Git Repositories - youtubedl/blob - devscripts/wine-py2exe.sh
Update upstream source from tag 'upstream/2018.06.18'
[youtubedl] / devscripts / wine-py2exe.sh
1 #!/bin/bash
2
3 # Run with as parameter a setup.py that works in the current directory
4 # e.g. no os.chdir()
5 # It will run twice, the first time will crash
6
7 set -e
8
9 SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
10
11 if [ ! -d wine-py2exe ]; then
12
13 sudo apt-get install wine1.3 axel bsdiff
14
15 mkdir wine-py2exe
16 cd wine-py2exe
17 export WINEPREFIX=`pwd`
18
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"
22
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
26
27 echo "Follow py2exe setup on screen"
28 wine py2exe-0.6.9.win32-py2.7.exe
29
30 #echo "Follow Microsoft Visual C++ 2008 Redistributable Package setup on screen"
31 #bash winetricks vcrun2008
32
33 rm py2exe-0.6.9.win32-py2.7.exe
34 rm python-2.7.msi
35 #rm winetricks
36
37 # http://bugs.winehq.org/show_bug.cgi?id=3591
38
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"
43
44 cd -
45
46 else
47
48 export WINEPREFIX="$( cd wine-py2exe && pwd )"
49
50 fi
51
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
56