annotate scripts/wine-py2exe @ 584:60985ca71af5

Update repo url. Comment out CIA submission, since that's dead
author Neil Muller <drnlmuller@gmail.com>
date Tue, 17 Mar 2020 22:32:56 +0200
parents f0a29c9d57ee
children
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
453
4f3c55b09fda Fix version variable names.
Simon Cross <hodgestar@gmail.com>
parents: 433
diff changeset
6 MM_VERSION=`sed -nre 's/VERSION_STR = "(.*)"/\1/p' setup.py`
4f3c55b09fda Fix version variable names.
Simon Cross <hodgestar@gmail.com>
parents: 433
diff changeset
7 BUILD_FOLDER="mutable-mamba-${MM_VERSION}"
433
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 ""
453
4f3c55b09fda Fix version variable names.
Simon Cross <hodgestar@gmail.com>
parents: 433
diff changeset
20 echo " Mutable Mamba version: ${MM_VERSION}"
433
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
21 echo " Writing log to ${PY2EXE_LOG}."
549
f0a29c9d57ee Reminder to fix mamba.exe checksum and executable size after building.
Simon Cross <hodgestar@gmail.com>
parents: 453
diff changeset
22 echo ""
f0a29c9d57ee Reminder to fix mamba.exe checksum and executable size after building.
Simon Cross <hodgestar@gmail.com>
parents: 453
diff changeset
23 echo " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
f0a29c9d57ee Reminder to fix mamba.exe checksum and executable size after building.
Simon Cross <hodgestar@gmail.com>
parents: 453
diff changeset
24 echo " WARNING: After running please fix the mamba.exe"
f0a29c9d57ee Reminder to fix mamba.exe checksum and executable size after building.
Simon Cross <hodgestar@gmail.com>
parents: 453
diff changeset
25 echo " checksum and executable size using PETools!"
f0a29c9d57ee Reminder to fix mamba.exe checksum and executable size after building.
Simon Cross <hodgestar@gmail.com>
parents: 453
diff changeset
26 echo " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
433
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
27 echo ""
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
28
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
29 rm -rf "dist/${BUILD_FOLDER}"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
30 mkdir -p "dist/${BUILD_FOLDER}"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
31 rm -rf "dist/${ZIP_NAME}"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
32
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
33 wine python setup.py py2exe >${PY2EXE_LOG} 2>&1
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 #
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
36 # Copy dependencies py2exe missed
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
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
39 echo "=== Copying dependencies that py2exe missed ==="
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
40 echo ""
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
41
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
42 DEST="dist/${BUILD_FOLDER}"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
43
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
44 cp -v "${WINE_SYS32}/python26.dll" "${DEST}"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
45 # TODO: the line below copies in the Wine placeholder DLL (oddly this
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
46 # doesn't appear to break anything)
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
47 # Decide whether to keep this or not.
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
48 # cp -v "${WINE_SYS32}/msvcr80.dll" "${DEST}"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
49
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
50 echo "'data' -> '${DEST}/data'"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
51 hg archive -I "path:data/" "${DEST}"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
52
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
53 echo "'${WINE_PYTHON}/Lib/site-packages/pygame' -> '${DEST}'"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
54 rm -rf "${DEST}/pygame"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
55 cp -R "${WINE_PYTHON}/Lib/site-packages/pygame" "${DEST}"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
56 rm -rf "${DEST}/pygame/examples" "${DEST}/pygame/tests" "${DEST}/pygame/docs"
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 #
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
59 # create zip file
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
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
62 echo "=== Creating zip of patched py2exe dist folder ==="
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
63 echo ""
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
64 echo " Zip file: dist/${ZIP_NAME}"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
65 echo " Build folder: dist/${BUILD_FOLDER}"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
66 echo ""
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
67
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
68 cd dist
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
69 rm -f "$ZIP_NAME"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
70 zip -r -q "$ZIP_NAME" "$BUILD_FOLDER"
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
71 cd ..
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
72
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
73 echo "=== Done ==="
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
74 echo ""
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
75 echo -n " "; du -sh dist/${ZIP_NAME}
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
76 echo -n " "; du -sh dist/${BUILD_FOLDER}
e07b42656d22 Untested build scripts.
Simon Cross <hodgestar@gmail.com>
parents:
diff changeset
77 echo ""