Mercurial > mamba
annotate scripts/wine-py2exe @ 598:0a2cc2ee16c2
Fix loading of help file. It needs to be loaded as a string since we join lines using a string.
author | Simon Cross <hodgestar@gmail.com> |
---|---|
date | Sat, 14 Jan 2023 19:04:47 +0100 |
parents | f0a29c9d57ee |
children |
rev | line source |
---|---|
433 | 1 #!/bin/sh |
2 # wine-py2exe | |
3 # | |
4 # Usage: wine-py2exe | |
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 | 8 ZIP_NAME="${BUILD_FOLDER}.zip" |
9 PY2EXE_LOG="py2exe.log" | |
10 | |
11 WINE_PYTHON=`winepath "C:/Python26"` | |
12 WINE_SYS32=`winepath "C:/windows/system32"` | |
13 | |
14 # | |
15 # Run py2exe build under wine | |
16 # | |
17 | |
18 echo "=== Running wine python setup.py ===" | |
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 | 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 | 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}/python26.dll" "${DEST}" | |
45 # TODO: the line below copies in the Wine placeholder DLL (oddly this | |
46 # doesn't appear to break anything) | |
47 # Decide whether to keep this or not. | |
48 # cp -v "${WINE_SYS32}/msvcr80.dll" "${DEST}" | |
49 | |
50 echo "'data' -> '${DEST}/data'" | |
51 hg archive -I "path:data/" "${DEST}" | |
52 | |
53 echo "'${WINE_PYTHON}/Lib/site-packages/pygame' -> '${DEST}'" | |
54 rm -rf "${DEST}/pygame" | |
55 cp -R "${WINE_PYTHON}/Lib/site-packages/pygame" "${DEST}" | |
56 rm -rf "${DEST}/pygame/examples" "${DEST}/pygame/tests" "${DEST}/pygame/docs" | |
57 | |
58 # | |
59 # create zip file | |
60 # | |
61 | |
62 echo "=== Creating zip of patched py2exe dist folder ===" | |
63 echo "" | |
64 echo " Zip file: dist/${ZIP_NAME}" | |
65 echo " Build folder: dist/${BUILD_FOLDER}" | |
66 echo "" | |
67 | |
68 cd dist | |
69 rm -f "$ZIP_NAME" | |
70 zip -r -q "$ZIP_NAME" "$BUILD_FOLDER" | |
71 cd .. | |
72 | |
73 echo "=== Done ===" | |
74 echo "" | |
75 echo -n " "; du -sh dist/${ZIP_NAME} | |
76 echo -n " "; du -sh dist/${BUILD_FOLDER} | |
77 echo "" |