Merge pull request #13215 from pchote/packaging-simplification
Overhaul packaging scripts
This commit is contained in:
@@ -110,7 +110,6 @@ Section "Game" GAME
|
||||
File "${SRCDIR}\README.html"
|
||||
File "${SRCDIR}\CHANGELOG.html"
|
||||
File "${SRCDIR}\CONTRIBUTING.html"
|
||||
File "${SRCDIR}\DOCUMENTATION.html"
|
||||
File "${SRCDIR}\OpenRA.ico"
|
||||
File "${SRCDIR}\RedAlert.ico"
|
||||
File "${SRCDIR}\TiberianDawn.ico"
|
||||
@@ -220,7 +219,6 @@ Function ${UN}Clean
|
||||
Delete $INSTDIR\README.html
|
||||
Delete $INSTDIR\CHANGELOG.html
|
||||
Delete $INSTDIR\CONTRIBUTING.html
|
||||
Delete $INSTDIR\DOCUMENTATION.html
|
||||
Delete $INSTDIR\OpenRA.ico
|
||||
Delete $INSTDIR\RedAlert.ico
|
||||
Delete $INSTDIR\TiberianDawn.ico
|
||||
|
||||
@@ -1,17 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
command -v curl >/dev/null 2>&1 || { echo >&2 "Windows packaging requires curl."; exit 1; }
|
||||
command -v markdown >/dev/null 2>&1 || { echo >&2 "Windows packaging requires markdown."; exit 1; }
|
||||
command -v makensis >/dev/null 2>&1 || { echo >&2 "Windows packaging requires makensis."; exit 1; }
|
||||
|
||||
if [ $# -ne "2" ]; then
|
||||
echo "Usage: `basename $0` tag outputdir"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Set the working dir to the location of this script
|
||||
cd $(dirname $0)
|
||||
|
||||
TAG="$1"
|
||||
BUILTDIR="$2"
|
||||
SRCDIR="$3"
|
||||
OUTPUTDIR="$4"
|
||||
OUTPUTDIR="$2"
|
||||
SRCDIR="$(pwd)/../.."
|
||||
BUILTDIR="$(pwd)/build"
|
||||
|
||||
LAUNCHER_LIBS="-r:System.dll -r:System.Drawing.dll -r:System.Windows.Forms.dll -r:${BUILTDIR}/OpenRA.Game.exe"
|
||||
FAQ_URL="http://wiki.openra.net/FAQ"
|
||||
|
||||
SUFFIX=" (dev)"
|
||||
if [[ $TAG == release* ]]; then
|
||||
if [[ ${TAG} == release* ]]; then
|
||||
SUFFIX=""
|
||||
elif [[ $TAG == playtest* ]]; then
|
||||
elif [[ ${TAG} == playtest* ]]; then
|
||||
SUFFIX=" (playtest)"
|
||||
fi
|
||||
|
||||
@@ -20,29 +32,41 @@ function makelauncher()
|
||||
sed "s|DISPLAY_NAME|$2|" WindowsLauncher.cs.in | sed "s|MOD_ID|$3|" | sed "s|FAQ_URL|${FAQ_URL}|" > WindowsLauncher.cs
|
||||
mcs -sdk:4.5 WindowsLauncher.cs -warn:4 -codepage:utf8 -warnaserror -out:"$1" -t:winexe ${LAUNCHER_LIBS} -win32icon:"$4"
|
||||
rm WindowsLauncher.cs
|
||||
mono ${SRCDIR}/fixheader.exe $1 > /dev/null
|
||||
mono "${SRCDIR}/fixheader.exe" $1 > /dev/null
|
||||
}
|
||||
|
||||
echo "Building core files"
|
||||
|
||||
pushd ${SRCDIR} > /dev/null
|
||||
make windows-dependencies
|
||||
make core SDK="-sdk:4.5"
|
||||
make version VERSION="${TAG}"
|
||||
make install-core gameinstalldir="" DESTDIR="${BUILTDIR}"
|
||||
popd > /dev/null
|
||||
|
||||
echo "Compiling Windows launchers"
|
||||
makelauncher ${BUILTDIR}/RedAlert.exe "Red Alert" "ra" RedAlert.ico
|
||||
makelauncher ${BUILTDIR}/TiberianDawn.exe "Tiberian Dawn" "cnc" TiberianDawn.ico
|
||||
makelauncher ${BUILTDIR}/Dune2000.exe "Dune 2000" "d2k" Dune2000.ico
|
||||
makelauncher "${BUILTDIR}/RedAlert.exe" "Red Alert" "ra" RedAlert.ico
|
||||
makelauncher "${BUILTDIR}/TiberianDawn.exe" "Tiberian Dawn" "cnc" TiberianDawn.ico
|
||||
makelauncher "${BUILTDIR}/Dune2000.exe" "Dune 2000" "d2k" Dune2000.ico
|
||||
|
||||
# Windows specific icons
|
||||
cp OpenRA.ico RedAlert.ico TiberianDawn.ico Dune2000.ico ${BUILTDIR}
|
||||
# Windows specific files
|
||||
cp OpenRA.ico RedAlert.ico TiberianDawn.ico Dune2000.ico "${BUILTDIR}"
|
||||
cp "${SRCDIR}/OpenRA.Game.exe.config" "${BUILTDIR}"
|
||||
|
||||
if [ -x /usr/bin/makensis ]; then
|
||||
echo "Building Windows setup.exe"
|
||||
makensis -V2 -DSRCDIR="$BUILTDIR" -DDEPSDIR="${SRCDIR}/thirdparty/download/windows" -DTAG="${TAG}" -DSUFFIX="${SUFFIX}" OpenRA.nsi
|
||||
if [ $? -eq 0 ]; then
|
||||
mv OpenRA.Setup.exe "$OUTPUTDIR"/OpenRA-$TAG.exe
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
curl -s -L -O https://raw.githubusercontent.com/wiki/OpenRA/OpenRA/Changelog.md
|
||||
markdown Changelog.md > "${BUILTDIR}/CHANGELOG.html"
|
||||
rm Changelog.md
|
||||
|
||||
markdown "${SRCDIR}/README.md" > "${BUILTDIR}/README.html"
|
||||
markdown "${SRCDIR}/CONTRIBUTING.md" > "${BUILTDIR}/CONTRIBUTING.html"
|
||||
|
||||
echo "Building Windows setup.exe"
|
||||
makensis -V2 -DSRCDIR="${BUILTDIR}" -DDEPSDIR="${SRCDIR}/thirdparty/download/windows" -DTAG="${TAG}" -DSUFFIX="${SUFFIX}" OpenRA.nsi
|
||||
if [ $? -eq 0 ]; then
|
||||
mv OpenRA.Setup.exe "${OUTPUTDIR}/OpenRA-$TAG.exe"
|
||||
else
|
||||
echo "Skipping Windows setup.exe build due to missing NSIS"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Cleanup
|
||||
rm ${BUILTDIR}/OpenRA.ico ${BUILTDIR}/RedAlert.ico ${BUILTDIR}/TiberianDawn.ico ${BUILTDIR}/Dune2000.ico
|
||||
rm ${BUILTDIR}/RedAlert.exe ${BUILTDIR}/TiberianDawn.exe ${BUILTDIR}/Dune2000.exe
|
||||
rm -rf "${BUILTDIR}"
|
||||
|
||||
Reference in New Issue
Block a user