source: wine-py2exe

Last change on this file was 342:0d42622dbe12, checked in by Simon Cross <hodgestar@…>, 11 years ago

Re-create build folder after nuking it.

  • Property exe set to *
File size: 2.0 KB
Line 
1#!/bin/sh
2# Copyright 2009 Simon Cross <hodgestar@gmail.com>
3# GPL - see COPYING for details
4#
5# Usage: wine-py2exe
6
7OFA_VERSION=`PYTHONPATH=. python -c "from gamelib import version; print version.VERSION_STR"`
8BUILD_FOLDER="foxassault-${OFA_VERSION}"
9ZIP_NAME="${BUILD_FOLDER}.zip"
10PY2EXE_LOG="py2exe.log"
11
12WINE_PYTHON=`winepath "C:/Python25"`
13WINE_SYS32=`winepath "C:/windows/system32"`
14
15#
16# Run py2exe build under wine
17#
18
19echo "=== Running wine python setup.py ==="
20echo ""
21echo "  Fox Assault version: ${OFA_VERSION}"
22echo "  Writing log to ${PY2EXE_LOG}."
23echo "  ---"
24echo "  Please make sure you have patched your py2exe run.exe"
25echo "  and run_w.exe with PETools (they need to have their"
26echo "  executable size correctly set)."
27echo ""
28
29rm -rf "dist/${BUILD_FOLDER}"
30mkdir -p "dist/${BUILD_FOLDER}"
31rm -rf "dist/${ZIP_NAME}"
32
33wine python setup.py py2exe >${PY2EXE_LOG} 2>&1
34
35#
36# Copy dependencies py2exe missed
37#
38
39echo "=== Copying dependencies that py2exe missed ==="
40echo ""
41
42DEST="dist/${BUILD_FOLDER}"
43
44cp -v "${WINE_SYS32}/python25.dll" "${DEST}"
45cp -v "${WINE_SYS32}/msvcr71.dll" "${DEST}"
46
47echo "'${WINE_PYTHON}/share/pgu/themes/default' -> '${DEST}/share/pgu/themes/'"
48mkdir -p "${DEST}/share/pgu/themes"
49cp -R "${WINE_PYTHON}/share/pgu/themes/default" "${DEST}/share/pgu/themes/"
50
51echo "'data' -> '${DEST}/data'"
52svn export -q "data" "${DEST}/data"
53find "${DEST}/data" -name '*.svg' -delete
54
55echo "'${WINE_PYTHON}/Lib/site-packages/pygame' -> '${DEST}'"
56rm -rf "${DEST}/pygame"
57cp -R "${WINE_PYTHON}/Lib/site-packages/pygame" "${DEST}"
58rm -rf "${DEST}/pygame/examples" "${DEST}/pygame/tests" "${DEST}/pygame/docs"
59
60echo ""
61
62#
63# create zip file
64#
65
66echo "=== Creating zip of patched py2exe dist folder ==="
67echo ""
68echo "  Zip file: dist/${ZIP_NAME}"
69echo "  Build folder: dist/${BUILD_FOLDER}"
70echo ""
71
72cd dist
73rm -f "$ZIP_NAME"
74zip -r -q "$ZIP_NAME" "$BUILD_FOLDER"
75cd ..
76
77echo "=== Done ==="
78echo ""
79echo -n "  "; du -sh dist/${ZIP_NAME}
80echo -n "  "; du -sh dist/${BUILD_FOLDER}
81echo ""
Note: See TracBrowser for help on using the repository browser.