5 # Run this script to create a win32 package.
7 # You should typically only run this through the "portable" and "installer"
8 # makes targets in the package root directory. The build system will take
9 # care to pass the correct arguments.
14 echo "Usage: $0 [-h] [-i makensis] [-s strip] -d assets -V version -p prefix"
15 echo " Creates a portable win32 package or installer."
17 echo " -V Specify the version of the program to be packaged"
18 echo " -d Specify the game assets to be included."
19 echo " -h Show this help an exit."
20 echo " -i To make an installer, specify the makensis program."
21 echo " -p Specify the path to your toolchain installation."
22 echo " -s To strip the binaries, specify the strip program."
25 while getopts ":V:hd:i:p:s:" opt
48 echo "Invalid option: -$OPTARG" >&2
55 if test "x$ASSETS" = x
|| test "x$VERSION" = x
|| test "x$PREFIX" = x
70 DIRECTORY
="yoink-$VERSION"
71 ARCHIVE
="$BUILD/$DIRECTORY"
73 MAN2HTML
="lua $ROOT/doc/man2html.lua"
74 UNIX2DOS
="$ROOT/arch/win32/unix2dos.sh"
76 DLLS
="libogg-0 libpng14 libvorbis-0 libvorbisfile-3 lua51 OpenAL32 SDL zlib1"
79 if test ! -f "src/version.c"
81 echo "Run the script from the repository root directory."
87 "The temp directory $BUILD could not be created."
93 cp -f "$ROOT/src/yoink.exe" "$ARCHIVE" || die
"copying yoink.exe"
94 test "x$STRIP" != x
&& "$STRIP" "$ARCHIVE/yoink.exe"
98 cp -f "$PREFIX/bin/$dll.dll" "$ARCHIVE" || die
"copying $dll"
99 test "x$STRIP" != x
&& "$STRIP" "$ARCHIVE/$dll.dll"
104 cp -f --parents "data/$asset" "$ARCHIVE"
107 for doc
in AUTHORS ChangeLog COPYING README TODO
109 "$UNIX2DOS" "$doc" "$ARCHIVE/$doc.txt" || die
"unix2dos $doc"
112 $MAN2HTML -o "$ARCHIVE/Manual.html"
113 $UNIX2DOS "$ARCHIVE/Manual.html"
115 cp -rf "$ROOT/doc/licenses" "$ARCHIVE" || die
"copying doc/licenses"
116 cd "$ARCHIVE/licenses"
119 (mv "$license" "$license.txt" && "$UNIX2DOS" "$license.txt") \
120 || die
"moving and unix2dos $license"
125 if test "x$MAKENSIS" = x
127 # build portable archive
128 echo "No valid makensis executable passed;"
129 echo "making portable package instead..."
130 NAME
="$DIRECTORY.zip"
132 zip -r "$NAME" "$DIRECTORY" || die
"zipping portable archive"
135 echo "Done! Package saved to $NAME."
138 NAME
="yoinksetup-$VERSION.exe"
140 cp "$ROOT/arch/win32/yoink.nsi" .
141 "$MAKENSIS" -DROOTPATH="$ROOT" -DINSTALLFILES="$ARCHIVE" \
142 -DVERSION="$VERSION" -DOUTFILE="$NAME" yoink.nsi \
143 || die
"running '$MAKENSIS'"
146 echo "Done! Installer saved to $NAME."