comparison scripts/wine-py2exe @ 186:f15c4f7c24e6

Windows builder (works under Wine).
author Simon Cross <simon@simonx>
date Wed, 25 Aug 2010 16:24:55 +0200
parents
children f98e1b326250
comparison
equal deleted inserted replaced
185:ce12e56ed434 186:f15c4f7c24e6
1 #!/bin/sh
2 # wine-py2exe
3 # Copyright Simon Cross, Neil Muller, 2009 (see COPYING File)
4 #
5 # Usage: wine-py2exe
6
7 OFA_VERSION=`PYTHONPATH=. python -c "from gamelib import version; print version.VERSION_STR"`
8 BUILD_FOLDER="suspended-sentence-${OFA_VERSION}"
9 ZIP_NAME="${BUILD_FOLDER}.zip"
10 PY2EXE_LOG="py2exe.log"
11
12 WINE_PYTHON=`winepath "C:/Python25"`
13 WINE_SYS32=`winepath "C:/windows/system32"`
14
15 #
16 # Run py2exe build under wine
17 #
18
19 echo "=== Running wine python setup.py ==="
20 echo ""
21 echo " Suspended Sentence version: ${OFA_VERSION}"
22 echo " Writing log to ${PY2EXE_LOG}."
23 echo " ---"
24 echo " Please make sure you have patched your py2exe run.exe"
25 echo " and run_w.exe with PETools (they need to have their"
26 echo " executable size correctly set)."
27 echo ""
28
29 rm -rf "dist/${BUILD_FOLDER}"
30 mkdir -p "dist/${BUILD_FOLDER}"
31 rm -rf "dist/${ZIP_NAME}"
32
33 wine python setup.py py2exe >${PY2EXE_LOG} 2>&1
34
35 #
36 # Copy dependencies py2exe missed
37 #
38
39 echo "=== Copying dependencies that py2exe missed ==="
40 echo ""
41
42 DEST="dist/${BUILD_FOLDER}"
43
44 cp -v "${WINE_SYS32}/python25.dll" "${DEST}"
45 cp -v "${WINE_SYS32}/msvcr71.dll" "${DEST}"
46
47 #echo "'${WINE_PYTHON}/share/pgu/themes/default' -> '${DEST}/share/pgu/themes/'"
48 #mkdir -p "${DEST}/share/pgu/themes"
49 #cp -R "${WINE_PYTHON}/share/pgu/themes/default" "${DEST}/share/pgu/themes/"
50
51 echo "'Resources' -> '${DEST}/Resources'"
52 bzr export -q "${DEST}/Resources" "Resources"
53 #find "${DEST}/data" -name '*.svg' -delete
54
55 echo "'${WINE_PYTHON}/Lib/site-packages/pygame' -> '${DEST}'"
56 rm -rf "${DEST}/pygame"
57 cp -R "${WINE_PYTHON}/Lib/site-packages/pygame" "${DEST}"
58 rm -rf "${DEST}/pygame/examples" "${DEST}/pygame/tests" "${DEST}/pygame/docs"
59
60 echo ""
61
62 #
63 # create zip file
64 #
65
66 echo "=== Creating zip of patched py2exe dist folder ==="
67 echo ""
68 echo " Zip file: dist/${ZIP_NAME}"
69 echo " Build folder: dist/${BUILD_FOLDER}"
70 echo ""
71
72 cd dist
73 rm -f "$ZIP_NAME"
74 zip -r -q "$ZIP_NAME" "$BUILD_FOLDER"
75 cd ..
76
77 echo "=== Done ==="
78 echo ""
79 echo -n " "; du -sh dist/${ZIP_NAME}
80 echo -n " "; du -sh dist/${BUILD_FOLDER}
81 echo ""