source: packaging/wine-py2exe@ 669:30ae339d7224

Last change on this file since 669:30ae339d7224 was 669:30ae339d7224, checked in by Neil Muller <drnlmuller@…>, 8 years ago

py2exe packaging

  • Property exe set to *
File size: 1.9 KB
Line 
1#!/bin/sh
2# wine-py2exe
3#
4# Usage: wine-py2exe
5
6WS_VERSION=`sed -nre 's/VERSION_STR = "(.*)"/\1/p' setup.py`
7BUILD_FOLDER="nagslang-${WS_VERSION}"
8ZIP_NAME="${BUILD_FOLDER}.zip"
9PY2EXE_LOG="py2exe.log"
10
11WINE_PYTHON=`winepath "C:/Python27"`
12WINE_SYS32=`winepath "C:/windows/system32"`
13
14#
15# Run py2exe build under wine
16#
17
18echo "=== Running wine python setup.py ==="
19echo ""
20echo " Werewolf Sonata version: ${WS_VERSION}"
21echo " Writing log to ${PY2EXE_LOG}."
22echo ""
23echo " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
24echo " WARNING: After running please fix the nagslang.exe"
25echo " checksum and executable size using PETools!"
26echo " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
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}/python27.dll" "${DEST}"
45
46echo "'data' -> '${DEST}/data'"
47hg archive -I "path:data/" "${DEST}"
48
49echo "'${WINE_PYTHON}/Lib/site-packages/pygame' -> '${DEST}'"
50rm -rf "${DEST}/pygame"
51cp -R "${WINE_PYTHON}/Lib/site-packages/pygame" "${DEST}"
52echo "'${WINE_PYTHON}/Lib/site-packages/pymunk' -> '${DEST}'"
53rm -rf "${DEST}/pymunk"
54cp -R "${WINE_PYTHON}/Lib/site-packages/pymunk" "${DEST}"
55# Needed so we'll find it when running
56cp -R "${WINE_PYTHON}/Lib/site-packages/pymunk/chipmunk.dll" "${DEST}"
57rm -rf "${DEST}/pygame/examples" "${DEST}/pygame/tests" "${DEST}/pygame/docs"
58
59#
60# create zip file
61#
62
63echo "=== Creating zip of patched py2exe dist folder ==="
64echo ""
65echo " Zip file: dist/${ZIP_NAME}"
66echo " Build folder: dist/${BUILD_FOLDER}"
67echo ""
68
69cd dist
70rm -f "$ZIP_NAME"
71zip -r -q "$ZIP_NAME" "$BUILD_FOLDER"
72cd ..
73
74echo "=== Done ==="
75echo ""
76echo -n " "; du -sh dist/${ZIP_NAME}
77echo -n " "; du -sh dist/${BUILD_FOLDER}
78echo ""
Note: See TracBrowser for help on using the repository browser.