annotate packaging/wine-py2exe @ 669:30ae339d7224

py2exe packaging
author Neil Muller <drnlmuller@gmail.com>
date Sun, 08 Sep 2013 17:47:25 +0200
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
669
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
1 #!/bin/sh
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
2 # wine-py2exe
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
3 #
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
4 # Usage: wine-py2exe
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
5
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
6 WS_VERSION=`sed -nre 's/VERSION_STR = "(.*)"/\1/p' setup.py`
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
7 BUILD_FOLDER="nagslang-${WS_VERSION}"
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
8 ZIP_NAME="${BUILD_FOLDER}.zip"
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
9 PY2EXE_LOG="py2exe.log"
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
10
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
11 WINE_PYTHON=`winepath "C:/Python27"`
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
12 WINE_SYS32=`winepath "C:/windows/system32"`
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
13
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
14 #
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
15 # Run py2exe build under wine
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
16 #
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
17
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
18 echo "=== Running wine python setup.py ==="
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
19 echo ""
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
20 echo " Werewolf Sonata version: ${WS_VERSION}"
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
21 echo " Writing log to ${PY2EXE_LOG}."
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
22 echo ""
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
23 echo " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
24 echo " WARNING: After running please fix the nagslang.exe"
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
25 echo " checksum and executable size using PETools!"
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
26 echo " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
27 echo ""
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
28
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
29 rm -rf "dist/${BUILD_FOLDER}"
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
30 mkdir -p "dist/${BUILD_FOLDER}"
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
31 rm -rf "dist/${ZIP_NAME}"
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
32
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
33 wine python setup.py py2exe >${PY2EXE_LOG} 2>&1
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
34
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
35 #
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
36 # Copy dependencies py2exe missed
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
37 #
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
38
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
39 echo "=== Copying dependencies that py2exe missed ==="
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
40 echo ""
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
41
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
42 DEST="dist/${BUILD_FOLDER}"
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
43
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
44 cp -v "${WINE_SYS32}/python27.dll" "${DEST}"
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
45
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
46 echo "'data' -> '${DEST}/data'"
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
47 hg archive -I "path:data/" "${DEST}"
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
48
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
49 echo "'${WINE_PYTHON}/Lib/site-packages/pygame' -> '${DEST}'"
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
50 rm -rf "${DEST}/pygame"
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
51 cp -R "${WINE_PYTHON}/Lib/site-packages/pygame" "${DEST}"
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
52 echo "'${WINE_PYTHON}/Lib/site-packages/pymunk' -> '${DEST}'"
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
53 rm -rf "${DEST}/pymunk"
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
54 cp -R "${WINE_PYTHON}/Lib/site-packages/pymunk" "${DEST}"
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
55 # Needed so we'll find it when running
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
56 cp -R "${WINE_PYTHON}/Lib/site-packages/pymunk/chipmunk.dll" "${DEST}"
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
57 rm -rf "${DEST}/pygame/examples" "${DEST}/pygame/tests" "${DEST}/pygame/docs"
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
58
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
59 #
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
60 # create zip file
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
61 #
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
62
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
63 echo "=== Creating zip of patched py2exe dist folder ==="
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
64 echo ""
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
65 echo " Zip file: dist/${ZIP_NAME}"
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
66 echo " Build folder: dist/${BUILD_FOLDER}"
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
67 echo ""
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
68
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
69 cd dist
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
70 rm -f "$ZIP_NAME"
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
71 zip -r -q "$ZIP_NAME" "$BUILD_FOLDER"
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
72 cd ..
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
73
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
74 echo "=== Done ==="
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
75 echo ""
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
76 echo -n " "; du -sh dist/${ZIP_NAME}
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
77 echo -n " "; du -sh dist/${BUILD_FOLDER}
30ae339d7224 py2exe packaging
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
78 echo ""