Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
executable file 101 lines (77 sloc) 2.06 KB
#! /bin/sh
# Copyright (c) 1994-2012 by Marc Feeley, All Rights Reserved.
herefromroot="prebuilt/windows"
rootfromhere="../.."
PACKAGE_SHORTNAME="@PACKAGE_SHORTNAME@"
PACKAGE_NAME="@PACKAGE_NAME@"
PACKAGE_VERSION="@PACKAGE_VERSION@"
PACKAGE_STRING="@PACKAGE_STRING@"
PACKAGE_BUGREPORT="@PACKAGE_BUGREPORT@"
PACKAGE_TARNAME="@PACKAGE_TARNAME@"
PACKAGE_SUBDIR="@PACKAGE_SUBDIR@"
MAKENSIS="/c/Program Files/NSIS/makensis.exe"
VARIANT="$1"
RUN_TESTS="$2"
SOURCE_DIR="$INSTALL_PREFIX"
DOS_SOURCE_DIR="$DOS_INSTALL_PREFIX"
VERSION="`echo $PACKAGE_VERSION | sed -e s/^v//g`"
EXE_FILE="$PACKAGE_TARNAME-windows-$VARIANT.exe"
ICON_FILE="gambc.ico"
UNICON_FILE="gambc.ico"
NSI_FILE="gambc.nsi"
instantiate_file() # input, output
{
sed -e "s|@SOURCE_DIR@|$SOURCE_DIR|g" -e "s|@DOS_SOURCE_DIR@|$DOS_SOURCE_DIR|g" -e "s|@VERSION@|$VERSION|g" -e "s|@EXE_FILE@|$EXE_FILE|g" -e "s|@ICON_FILE@|$ICON_FILE|g" -e "s|@UNICON_FILE@|$UNICON_FILE|g" -e "s|@NAME@|$PACKAGE_NAME|g" -e "s|@TARNAME@|$PACKAGE_TARNAME|g" -e "s|@VARIANT@|$VARIANT|g" "$1" > "$2"
}
cleanup()
{
rm -rf "$NSI_FILE" "$SOURCE_DIR/$PACKAGE_VERSION"
}
install_gambc()
{
cd "$rootfromhere"
make clean
make -j 2
make install
if [ "$RUN_TESTS" == "0" ] ; then
echo "************ TESTS SKIPPED ($VARIANT variant)"
else
TESTS_SUCCESS=0
make check > build-phase2-tests.out
cat build-phase2-tests.out
if fgrep "============ ALL TESTS SUCCESSFUL" build-phase2-tests.out > /dev/null; then
TESTS_SUCCESS=1
fi
rm -f build-phase2-tests.out
if [ "$TESTS_SUCCESS" == "1" ] ; then
echo "************ TESTS SUCCESSFUL ($VARIANT variant)"
else
echo "************ TESTS FAILED ($VARIANT variant)"
cleanup
exit 1
fi
fi
cd "$herefromroot"
}
uninstall_gambc()
{
"$SOURCE_DIR/$PACKAGE_VERSION/bin/uninstall-gambc"
}
create_nsi()
{
for file in "$NSI_FILE" ; do
instantiate_file "$file.in" "$file"
done
}
create_exe()
{
"$MAKENSIS" "$NSI_FILE"
}
cd "`dirname $0`"
cleanup
rm -f "$EXE_FILE"
install_gambc
create_nsi
create_exe
mv "$EXE_FILE" "$rootfromhere"
cleanup
Jump to Line
Something went wrong with that request. Please try again.