annotate scripts/wine-py2exe @ 228:3955d126ca26

merge
author Rizmari Versfeld <rizziepit@gmail.com>
date Sat, 12 May 2012 23:09:33 +0200
parents a82cab951ce2
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
166
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
1 #!/bin/sh
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
2 # wine-py2exe
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
3 #
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
4 # Usage: wine-py2exe
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
5
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
6 MM_VERSION=`sed -nre 's/VERSION_STR = "(.*)"/\1/p' setup.py`
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
7 BUILD_FOLDER="sypikslang-${MM_VERSION}"
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
8 ZIP_NAME="${BUILD_FOLDER}.zip"
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
9 PY2EXE_LOG="py2exe.log"
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
10
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
11 WINE_PYTHON=`winepath "C:/Python26"`
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
12 WINE_SYS32=`winepath "C:/windows/system32"`
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
13
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
14 #
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
15 # Run py2exe build under wine
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
16 #
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
17
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
18 echo "=== Running wine python setup.py ==="
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
19 echo ""
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
20 echo " Sypikslang version: ${MM_VERSION}"
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
21 echo " Writing log to ${PY2EXE_LOG}."
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
22 echo ""
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
23 echo " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
24 echo " WARNING: After running please fix the sypikslang.exe"
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
25 echo " checksum and executable size using PETools!"
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
26 echo " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
27 echo ""
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
28
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
29 rm -rf "dist/${BUILD_FOLDER}"
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
30 mkdir -p "dist/${BUILD_FOLDER}"
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
31 rm -rf "dist/${ZIP_NAME}"
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
32
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
33 wine python setup.py py2exe >${PY2EXE_LOG} 2>&1
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
34
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
35 #
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
36 # Copy dependencies py2exe missed
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
37 #
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
38
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
39 echo "=== Copying dependencies that py2exe missed ==="
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
40 echo ""
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
41
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
42 DEST="dist/${BUILD_FOLDER}"
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
43
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
44 if [ -f "${WINE_SYS32}/python26.dll" ]; then
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
45 cp -v "${WINE_SYS32}/python26.dll" "${DEST}"
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
46 else
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
47 # Try the python installation
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
48 cp -v "${WINE_PYTHON}//python26.dll" "${DEST}"
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
49 fi
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
50 # TODO: the line below copies in the Wine placeholder DLL (oddly this
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
51 # doesn't appear to break anything)
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
52 # Decide whether to keep this or not.
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
53 # cp -v "${WINE_SYS32}/msvcr80.dll" "${DEST}"
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
54
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
55 echo "'data' -> '${DEST}/data'"
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
56 hg archive -I "path:data/" "${DEST}"
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
57
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
58 echo "'${WINE_PYTHON}/Lib/site-packages/pygame' -> '${DEST}'"
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
59 rm -rf "${DEST}/pygame"
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
60 cp -R "${WINE_PYTHON}/Lib/site-packages/pygame" "${DEST}"
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
61 rm -rf "${DEST}/pygame/examples" "${DEST}/pygame/tests" "${DEST}/pygame/docs"
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
62
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
63 #
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
64 # create zip file
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
65 #
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
66
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
67 echo "=== Creating zip of patched py2exe dist folder ==="
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
68 echo ""
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
69 echo " Zip file: dist/${ZIP_NAME}"
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
70 echo " Build folder: dist/${BUILD_FOLDER}"
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
71 echo ""
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
72
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
73 cd dist
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
74 rm -f "$ZIP_NAME"
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
75 zip -r -q "$ZIP_NAME" "$BUILD_FOLDER"
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
76 cd ..
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
77
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
78 echo "=== Done ==="
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
79 echo ""
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
80 echo -n " "; du -sh dist/${ZIP_NAME}
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
81 echo -n " "; du -sh dist/${BUILD_FOLDER}
a82cab951ce2 windows packaging stuff
Neil Muller <drnlmuller@gmail.com>
parents:
diff changeset
82 echo ""