784e0fa85733d1ddd72af9cb6dd2d1843f35674f
[chaz/yoink] / win32 / mkpackage.sh.in
1 #!/bin/sh
2
3 #
4 # Yoink
5 # Run this script to create a win32 installer.
6 # This was blatantly yoinked and adapted from the Wormux Project.
7 #
8
9 # Paths
10 SCRIPT="$PWD/yoink.nsi"
11 BUILD_DIR="$PWD/build"
12 ROOT_DIR="$PWD/.."
13
14 # Programs
15 MAKENSIS="@MAKENSIS@"
16 STRIP="@STRIP@"
17 UNIX2DOS="$ROOT_DIR/tools/unix2dos"
18
19 # DLL dependencies
20 DLLS="libogg-0 libpng-3 libvorbis-0 libvorbisfile-3 lua51 OpenAL32 SDL zlib1"
21
22 # Prepare
23 rm -rf "$BUILD_DIR"
24 mkdir -p "$BUILD_DIR"
25
26 cp -f "$ROOT_DIR/src/yoink.exe" "$BUILD_DIR"
27 #"${STRIP:-strip}" "$BUILD_DIR/yoink.exe"
28
29 for dll in $DLLS
30 do
31 cp -f "@prefix@/bin/$dll.dll" "$BUILD_DIR"
32 #"${STRIP:-strip}" "BUILD_DIR/$dll.dll"
33 done
34
35 cd "$ROOT_DIR"
36 for asset in @DATA_FILES@
37 do
38 cp -f --parents "data/$asset" "$BUILD_DIR"
39 done
40
41 cd "$ROOT_DIR"
42 for doc in AUTHORS ChangeLog COPYING README TODO
43 do
44 "$UNIX2DOS" "$doc" "$BUILD_DIR/$doc.txt"
45 done
46
47 cd "$ROOT_DIR/doc"
48 cp -rf licenses "$BUILD_DIR"
49
50 cd "$BUILD_DIR/licenses"
51 for license in $(ls)
52 do
53 mv "$license" "$license.txt"
54 "$UNIX2DOS" "$license.txt"
55 done
56
57
58 #
59 # Compile the installer and cleanup.
60 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
61
62 if ! "${MAKENSIS:-makensis}" "$SCRIPT"
63 then
64 echo "makensis failed, aborting..."
65 exit 1
66 fi
67
68 #rm -rf "$BUILD_DIR"
69
This page took 0.030619 seconds and 3 git commands to generate.