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