#!/bin/sh # # Yoink # Run this script to create a win32 installer. # This was blatantly yoinked and adapted from the Wormux Project. # # Paths SCRIPT="$PWD/yoink.nsi" BUILD_DIR="$PWD/build" ROOT_DIR="$PWD/.." # Programs MAKENSIS="@MAKENSIS@" STRIP="@STRIP@" UNIX2DOS="$ROOT_DIR/tools/unix2dos" # DLL dependencies DLLS="libogg-0 libpng14-14 libvorbis-0 libvorbisfile-3 lua51 OpenAL32 SDL zlib1" # Prepare rm -rf "$BUILD_DIR" mkdir -p "$BUILD_DIR" cp -f "$ROOT_DIR/src/yoink.exe" "$BUILD_DIR" #"${STRIP:-strip}" "$BUILD_DIR/yoink.exe" for dll in $DLLS do cp -f "@prefix@/bin/$dll.dll" "$BUILD_DIR" #"${STRIP:-strip}" "BUILD_DIR/$dll.dll" done cd "$ROOT_DIR" for asset in @DATA_FILES@ do cp -f --parents "data/$asset" "$BUILD_DIR" done cd "$ROOT_DIR" for doc in AUTHORS ChangeLog COPYING README TODO do "$UNIX2DOS" "$doc" "$BUILD_DIR/$doc.txt" done cd "$ROOT_DIR/doc" cp -rf licenses "$BUILD_DIR" cd "$BUILD_DIR/licenses" for license in $(ls) do mv "$license" "$license.txt" "$UNIX2DOS" "$license.txt" done # # Compile the installer and cleanup. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if ! "${MAKENSIS:-makensis}" "$SCRIPT" then echo "makensis failed, aborting..." exit 1 fi #rm -rf "$BUILD_DIR"