comparison scripts/wine-py2exe @ 570:f6a0fbf918fd

Packaging scripts
author Stefano Rivera <stefano@rivera.za.net>
date Sun, 10 Apr 2011 02:36:06 +0200
parents
children 62666b542afe
comparison
equal deleted inserted replaced
569:8f7bd983e394 570:f6a0fbf918fd
1 #!/bin/sh
2 # wine-py2exe
3 # Copyright Simon Cross, Neil Muller, 2009 (see COPYING File)
4 #
5 # Usage: wine-py2exe
6
7 NT_VERSION=`sed -nre 's/VERSION_STR = "(.*)"/\1/p' setup.py`
8 BUILD_FOLDER="nine-tails-${NT_VERSION}"
9 ZIP_NAME="${BUILD_FOLDER}.zip"
10 PY2EXE_LOG="py2exe.log"
11
12 WINE_PYTHON=`winepath "C:/Python25"`
13 WINE_SYS32=`winepath "C:/windows/system32"`
14
15 #
16 # Run py2exe build under wine
17 #
18
19 echo "=== Running wine python setup.py ==="
20 echo ""
21 echo " Nine Tails version: ${NT_VERSION}"
22 echo " Writing log to ${PY2EXE_LOG}."
23 echo " ---"
24 echo " Please make sure you have patched your py2exe run.exe"
25 echo " and run_w.exe with PETools (they need to have their"
26 echo " executable size correctly set)."
27 echo ""
28
29 rm -rf "dist/${BUILD_FOLDER}"
30 mkdir -p "dist/${BUILD_FOLDER}"
31 rm -rf "dist/${ZIP_NAME}"
32
33 wine python setup.py py2exe >${PY2EXE_LOG} 2>&1
34
35 #
36 # Copy dependencies py2exe missed
37 #
38
39 echo "=== Copying dependencies that py2exe missed ==="
40 echo ""
41
42 DEST="dist/${BUILD_FOLDER}"
43
44 cp -v "${WINE_SYS32}/python25.dll" "${DEST}"
45 cp -v "${WINE_SYS32}/msvcr71.dll" "${DEST}"
46
47 #echo "'${WINE_PYTHON}/share/pgu/themes/default' -> '${DEST}/share/pgu/themes/'"
48 #mkdir -p "${DEST}/share/pgu/themes"
49 #cp -R "${WINE_PYTHON}/share/pgu/themes/default" "${DEST}/share/pgu/themes/"
50
51 echo "'Resources' -> '${DEST}/Resources'"
52 bzr export -q "${DEST}/Resources" "Resources"
53 #find "${DEST}/data" -name '*.svg' -delete
54
55 echo "'${WINE_PYTHON}/Lib/site-packages/pygame' -> '${DEST}'"
56 rm -rf "${DEST}/pygame"
57 cp -R "${WINE_PYTHON}/Lib/site-packages/pygame" "${DEST}"
58 rm -rf "${DEST}/pygame/examples" "${DEST}/pygame/tests" "${DEST}/pygame/docs"
59
60 echo "'docs/walkthrough.rst' -> '${DEST}/Resources'"
61 rm -f "${DEST}/walkthrough.rst"
62 cp "docs/walkthrough.rst" "${DEST}/walkthrough.rst"
63
64 echo ""
65
66 #
67 # create zip file
68 #
69
70 echo "=== Creating zip of patched py2exe dist folder ==="
71 echo ""
72 echo " Zip file: dist/${ZIP_NAME}"
73 echo " Build folder: dist/${BUILD_FOLDER}"
74 echo ""
75
76 cd dist
77 rm -f "$ZIP_NAME"
78 zip -r -q "$ZIP_NAME" "$BUILD_FOLDER"
79 cd ..
80
81 echo "=== Done ==="
82 echo ""
83 echo -n " "; du -sh dist/${ZIP_NAME}
84 echo -n " "; du -sh dist/${BUILD_FOLDER}
85 echo ""