annotate scripts/wine-py2exe @ 433:e07b42656d22

Untested build scripts.
author Simon Cross <hodgestar@gmail.com>
date Sat, 17 Sep 2011 19:31:31 +0200
parents
children 4f3c55b09fda
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
433
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
1 #!/bin/sh
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
2 # wine-py2exe
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
3 #
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
4 # Usage: wine-py2exe
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
5
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
6 NT_VERSION=`sed -nre 's/VERSION_STR = "(.*)"/\1/p' setup.py`
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
7 BUILD_FOLDER="mutable-mamba-${NT_VERSION}"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
8 ZIP_NAME="${BUILD_FOLDER}.zip"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
9 PY2EXE_LOG="py2exe.log"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
10
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
11 WINE_PYTHON=`winepath "C:/Python26"`
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
12 WINE_SYS32=`winepath "C:/windows/system32"`
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
13
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
14 #
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
15 # Run py2exe build under wine
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
16 #
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
17
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
18 echo "=== Running wine python setup.py ==="
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
19 echo ""
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
20 echo " Mutable Mamba version: ${NT_VERSION}"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
21 echo " Writing log to ${PY2EXE_LOG}."
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
22 echo " ---"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
23 echo " Please make sure you have patched your py2exe run.exe"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
24 echo " and run_w.exe with PETools (they need to have their"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
25 echo " executable size correctly set)."
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
26 echo ""
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
27
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
28 rm -rf "dist/${BUILD_FOLDER}"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
29 mkdir -p "dist/${BUILD_FOLDER}"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
30 rm -rf "dist/${ZIP_NAME}"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
31
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
32 wine python setup.py py2exe >${PY2EXE_LOG} 2>&1
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
33
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
34 #
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
35 # Copy dependencies py2exe missed
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
36 #
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
37
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
38 echo "=== Copying dependencies that py2exe missed ==="
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
39 echo ""
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
40
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
41 DEST="dist/${BUILD_FOLDER}"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
42
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
43 cp -v "${WINE_SYS32}/python26.dll" "${DEST}"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
44 # TODO: the line below copies in the Wine placeholder DLL (oddly this
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
45 # doesn't appear to break anything)
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
46 # Decide whether to keep this or not.
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
47 # cp -v "${WINE_SYS32}/msvcr80.dll" "${DEST}"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
48
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
49 echo "'data' -> '${DEST}/data'"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
50 hg archive -I "path:data/" "${DEST}"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
51
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
52 echo "'${WINE_PYTHON}/Lib/site-packages/pygame' -> '${DEST}'"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
53 rm -rf "${DEST}/pygame"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
54 cp -R "${WINE_PYTHON}/Lib/site-packages/pygame" "${DEST}"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
55 rm -rf "${DEST}/pygame/examples" "${DEST}/pygame/tests" "${DEST}/pygame/docs"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
56
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
57 #
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
58 # create zip file
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
59 #
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
60
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
61 echo "=== Creating zip of patched py2exe dist folder ==="
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
62 echo ""
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
63 echo " Zip file: dist/${ZIP_NAME}"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
64 echo " Build folder: dist/${BUILD_FOLDER}"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
65 echo ""
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
66
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
67 cd dist
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
68 rm -f "$ZIP_NAME"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
69 zip -r -q "$ZIP_NAME" "$BUILD_FOLDER"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
70 cd ..
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
71
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
72 echo "=== Done ==="
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
73 echo ""
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
74 echo -n " "; du -sh dist/${ZIP_NAME}
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
75 echo -n " "; du -sh dist/${BUILD_FOLDER}
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
76 echo ""