Mercurial > rinkhals
comparison wine-py2exe @ 304:67021d0920dc
Script for running py2exe on Fox Assault under Wine.
author | Simon Cross <hodgestar@gmail.com> |
---|---|
date | Sat, 05 Sep 2009 17:35:51 +0000 |
parents | |
children | 65f09c9fe8cb |
comparison
equal
deleted
inserted
replaced
303:e12d99215b74 | 304:67021d0920dc |
---|---|
1 #!/bin/sh | |
2 # Copyright 2008 Simon Cross <hodgestar@gmail.com> | |
3 # GPL - see COPYING for details | |
4 # | |
5 # Usage: wine-py2exe <dependencies folder> | |
6 | |
7 OFA_VERSION=`PYTHONPATH=. python -c "from gamelib import version; print version.VERSION_STR"` | |
8 BUILD_FOLDER="foxassault-${OFA_VERSION}" | |
9 ZIP_NAME="${BUILD_FOLDER}.zip" | |
10 TEMPLATE_FOLDER="$1" | |
11 PY2EXE_LOG="py2exe.log" | |
12 WINE_PYTHON=`winepath "C:/Python25"` | |
13 | |
14 if [ "x$TEMPLATE_FOLDER" = "x" ] ; then | |
15 echo "Please specify a template folder!" | |
16 exit 1 | |
17 fi | |
18 | |
19 # | |
20 # Run py2exe build under wine | |
21 # | |
22 | |
23 echo "=== Running wine python setup.py ===" | |
24 echo " Fox Assault version: ${OFA_VERSION}" | |
25 echo " Writing log to ${PY2EXE_LOG}." | |
26 echo " ---" | |
27 echo " Please make sure you have patched your py2exe run.exe" | |
28 echo " and run_w.exe with PETools (they need to have their" | |
29 echo " executable size correctly set)." | |
30 echo "" | |
31 | |
32 rm -rf "dist/${BUILD_FOLDER}" | |
33 rm -rf "dist/${ZIP_NAME}" | |
34 wine python setup.py py2exe >${PY2EXE_LOG} 2>&1 | |
35 | |
36 # | |
37 # Copy in GTK dependencies py2exe missed | |
38 # One should be able to obtain /etc, /lib | |
39 # and /share by installing GTK in a Windows machine | |
40 # and copying them into the template folder. | |
41 # Copy python dll that py2exe misses | |
42 # Copy sqlite dll that py2exe misses | |
43 # One should be able to obtain python25.dll and | |
44 # sqlite3.dll from a Windows Python 2.5 installation. | |
45 | |
46 echo "=== Copying dependencies that py2exe missed ===" | |
47 echo " Using template folder ${TEMPLATE_FOLDER}." | |
48 echo "" | |
49 | |
50 DEST="dist/${BUILD_FOLDER}" | |
51 | |
52 cp -v "${WINE_PYTHON}/Lib/site-packages/pygame"/*.dll "${DEST}" | |
53 cp -v "${TEMPLATE_FOLDER}/python25.dll" "${DEST}" | |
54 mkdir -p "${DEST}/share/pgu/themes" | |
55 echo "'${WINE_PYTHON}/share/pgu/themes/default' -> '${DEST}/share/pgu/themes/'" | |
56 cp -R "${WINE_PYTHON}/share/pgu/themes/default" "${DEST}/share/pgu/themes/" | |
57 echo "'data' -> '${DEST}/data'" | |
58 svn export -q "data" "${DEST}/data" | |
59 | |
60 echo "" | |
61 | |
62 # | |
63 # create zip file | |
64 # | |
65 | |
66 echo "=== Creating zip of patched py2exe dist folder ===" | |
67 echo " Zip file: dist/${ZIP_NAME}" | |
68 echo " Build folder: dist/${BUILD_FOLDER}" | |
69 echo "" | |
70 | |
71 cd dist | |
72 rm -f "$ZIP_NAME" | |
73 zip -r -q "$ZIP_NAME" "$BUILD_FOLDER" | |
74 rm -rf "~/.VirtualBox/shared/$BUILD_FOLDER" | |
75 cp -R "$BUILD_FOLDER" ~/.VirtualBox/shared/ | |
76 cd .. |