aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippo Valsorda - Campagna <filosottile.wiki@gmail.com>2012-04-07 20:07:42 +0200
committerFilippo Valsorda - Campagna <filosottile.wiki@gmail.com>2012-04-07 20:07:42 +0200
commitc6306eb7984a928368cc17de0b3f3c2d4ee0b9c3 (patch)
tree117a36bab1bf7fdda46f2b5ee89288b8966871df
parentbcfde70d7382463cf1cab61165641c1f16b8c6d8 (diff)
wine-py2exe.sh to create the exe under linux (!!)
-rw-r--r--.gitignore2
-rw-r--r--build_exe.py4
-rw-r--r--devscripts/SizeOfImage.patchbin0 -> 147 bytes
-rw-r--r--devscripts/SizeOfImage_w.patchbin0 -> 148 bytes
-rw-r--r--devscripts/wine-py2exe.sh61
-rwxr-xr-x[-rw-r--r--]youtube-dl.exebin5488249 -> 5488269 bytes
6 files changed, 66 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 95401e0a7..e51512d4f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
*.pyc
*.pyo
*~
+wine-py2exe/
+py2exe.log
diff --git a/build_exe.py b/build_exe.py
index 338c10f66..9fa8186cb 100644
--- a/build_exe.py
+++ b/build_exe.py
@@ -2,11 +2,13 @@ from distutils.core import setup
import py2exe
import sys, os
+"""This will create an exe that needs Microsoft Visual C++ 2008 Redistributable Package"""
+
# If run without args, build executables
if len(sys.argv) == 1:
sys.argv.append("py2exe")
-os.chdir(os.path.dirname(sys.argv[0]))
+# os.chdir(os.path.dirname(os.path.abspath(sys.argv[0]))) # conflict with wine-py2exe.sh
sys.path.append('./youtube_dl')
options = {
diff --git a/devscripts/SizeOfImage.patch b/devscripts/SizeOfImage.patch
new file mode 100644
index 000000000..d5845af46
--- /dev/null
+++ b/devscripts/SizeOfImage.patch
Binary files differ
diff --git a/devscripts/SizeOfImage_w.patch b/devscripts/SizeOfImage_w.patch
new file mode 100644
index 000000000..c1a338ff3
--- /dev/null
+++ b/devscripts/SizeOfImage_w.patch
Binary files differ
diff --git a/devscripts/wine-py2exe.sh b/devscripts/wine-py2exe.sh
new file mode 100644
index 000000000..319ffcbc8
--- /dev/null
+++ b/devscripts/wine-py2exe.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+
+# Run with as parameter a setup.py that works in the current directory
+# e.g. no os.chdir()
+# It will run twice, the first time will crash
+
+set -e
+
+SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
+
+if [ ! -d wine-py2exe ]; then
+
+ sudo apt-get install wine1.3 axel bsdiff
+
+ mkdir wine-py2exe
+ cd wine-py2exe
+ export WINEPREFIX=`pwd`
+
+ axel -a "http://www.python.org/ftp/python/2.7/python-2.7.msi"
+ axel -a "http://downloads.sourceforge.net/project/py2exe/py2exe/0.6.9/py2exe-0.6.9.win32-py2.7.exe"
+ axel -a "http://pypi.python.org/packages/2.7/l/lxml/lxml-2.3.win32-py2.7.exe"
+ #axel -a "http://winetricks.org/winetricks"
+
+ # http://appdb.winehq.org/objectManager.php?sClass=version&iId=21957
+ echo "Follow python setup on screen"
+ wine msiexec /i python-2.7.msi
+
+ echo "Follow py2exe setup on screen"
+ wine py2exe-0.6.9.win32-py2.7.exe
+
+ echo "Follow lxml setup on screen"
+ wine lxml-2.3.win32-py2.7.exe
+
+ #echo "Follow Microsoft Visual C++ 2008 Redistributable Package setup on screen"
+ #bash winetricks vcrun2008
+
+ rm lxml-2.3.win32-py2.7.exe
+ rm py2exe-0.6.9.win32-py2.7.exe
+ rm python-2.7.msi
+ #rm winetricks
+
+ # http://bugs.winehq.org/show_bug.cgi?id=3591
+
+ mv drive_c/Python27/Lib/site-packages/py2exe/run.exe drive_c/Python27/Lib/site-packages/py2exe/run.exe.backup
+ bspatch drive_c/Python27/Lib/site-packages/py2exe/run.exe.backup drive_c/Python27/Lib/site-packages/py2exe/run.exe "$SCRIPT_DIR/SizeOfImage.patch"
+ mv drive_c/Python27/Lib/site-packages/py2exe/run_w.exe drive_c/Python27/Lib/site-packages/py2exe/run_w.exe.backup
+ 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"
+
+ cd -
+
+else
+
+ export WINEPREFIX="$( cd wine-py2exe && pwd )"
+
+fi
+
+wine "C:\\Python27\\python.exe" "$1" py2exe > "py2exe.log" 2>&1 || true
+echo '# Copying python27.dll' >> "py2exe.log"
+cp "$WINEPREFIX/drive_c/windows/system32/python27.dll" build/bdist.win32/winexe/bundle-2.7/
+wine "C:\\Python27\\python.exe" "$1" py2exe >> "py2exe.log" 2>&1
+
diff --git a/youtube-dl.exe b/youtube-dl.exe
index 29e221993..ec793ecee 100644..100755
--- a/youtube-dl.exe
+++ b/youtube-dl.exe
Binary files differ