view scripts/wine-py2exe @ 854:79b5c1be9a5e default tip

Remove pyntnclick, it's its own library, now
author Stefano Rivera <stefano@rivera.za.net>
date Sat, 21 Jun 2014 22:06:09 +0200
parents 0d5ff96527da
children
line wrap: on
line source

#!/bin/sh
# wine-py2exe
# Copyright Simon Cross, Neil Muller, 2009 (see COPYING File)
#
# Usage: wine-py2exe

GAME_NAME="suspended-sentence"
GAME_MOD="gamelib"

OFA_VERSION=`PYTHONPATH=. python -c "from ${GAME_MOD} import version; print version.VERSION_STR"`
GAME_TITLE=`PYTHONPATH=. python -c "from ${GAME_MOD} import version; print version.NAME"`
BUILD_FOLDER="${GAME_NAME}-${OFA_VERSION}"
ZIP_NAME="${BUILD_FOLDER}.zip"
PY2EXE_LOG="py2exe.log"

WINE_PYTHON=`winepath "C:/Python25"`
WINE_SYS32=`winepath "C:/windows/system32"`

#
# Run py2exe build under wine
#

echo "=== Running wine python setup.py ==="
echo ""
echo "  ${GAME_TITLE} version: ${OFA_VERSION}"
echo "  Writing log to ${PY2EXE_LOG}."
echo "  ---"
echo "  Please make sure you have patched your py2exe run.exe"
echo "  and run_w.exe with PETools (they need to have their"
echo "  executable size correctly set)."
echo ""

rm -rf "dist/${BUILD_FOLDER}"
mkdir -p "dist/${BUILD_FOLDER}"
rm -rf "dist/${ZIP_NAME}"

wine python setup.py py2exe >${PY2EXE_LOG} 2>&1

#
# Copy dependencies py2exe missed
#

echo "=== Copying dependencies that py2exe missed ==="
echo ""

DEST="dist/${BUILD_FOLDER}"

cp -v "${WINE_SYS32}/python25.dll" "${DEST}"
cp -v "${WINE_SYS32}/msvcr71.dll" "${DEST}"

#echo "'${WINE_PYTHON}/share/pgu/themes/default' -> '${DEST}/share/pgu/themes/'"
#mkdir -p "${DEST}/share/pgu/themes"
#cp -R "${WINE_PYTHON}/share/pgu/themes/default" "${DEST}/share/pgu/themes/"

echo "'data' -> '${DEST}/data'"
bzr export -q "${DEST}/data" "data"
#find "${DEST}/data" -name '*.svg' -delete

echo "'${WINE_PYTHON}/Lib/site-packages/pygame' -> '${DEST}'"
rm -rf "${DEST}/pygame"
cp -R "${WINE_PYTHON}/Lib/site-packages/pygame" "${DEST}"
rm -rf "${DEST}/pygame/examples" "${DEST}/pygame/tests" "${DEST}/pygame/docs"

echo "'docs/walkthrough.rst' -> '${DEST}'"
rm -f "${DEST}/walkthrough.rst"
cp "docs/walkthrough.rst" "${DEST}/walkthrough.rst"

echo ""

#
# create zip file
#

echo "=== Creating zip of patched py2exe dist folder ==="
echo ""
echo "  Zip file: dist/${ZIP_NAME}"
echo "  Build folder: dist/${BUILD_FOLDER}"
echo ""

cd dist
rm -f "$ZIP_NAME"
zip -r -q "$ZIP_NAME" "$BUILD_FOLDER"
cd ..

echo "=== Done ==="
echo ""
echo -n "  "; du -sh dist/${ZIP_NAME}
echo -n "  "; du -sh dist/${BUILD_FOLDER}
echo ""