Overhaul packaging scripts and helpers:
- Shared helpers extracted to functions.sh for use by upstream packaging, Mod SDK, and downstream packaging (via the Makefile targets). - Assembly management separated from data and combined between engine and mods to prepare for pending .NET core requirements. - Streamline Makefile targets. - Clean up a lot of old technical debt.
This commit is contained in:
332
packaging/functions.sh
Executable file
332
packaging/functions.sh
Executable file
@@ -0,0 +1,332 @@
|
||||
#!/bin/sh
|
||||
# Helper functions for packaging and installing OpenRA
|
||||
|
||||
####
|
||||
# This file must stay /bin/sh and POSIX compliant for macOS and BSD portability.
|
||||
# Copy-paste the entire script into http://shellcheck.net to check.
|
||||
####
|
||||
|
||||
# Compile and publish (using Mono) the core engine and specified mod assemblies to the target directory
|
||||
# Arguments:
|
||||
# SRC_PATH: Path to the root OpenRA directory
|
||||
# DEST_PATH: Path to the root of the install destination (will be created if necessary)
|
||||
# TARGETPLATFORM: Platform type (win-x86, win-x64, osx-x64, linux-x64, unix-generic)
|
||||
# COPY_GENERIC_LAUNCHER: If set to True the OpenRA.exe will also be copied (True, False)
|
||||
# COPY_CNC_DLL: If set to True the OpenRA.Mods.Cnc.dll will also be copied (True, False)
|
||||
# COPY_D2K_DLL: If set to True the OpenRA.Mods.D2k.dll and OpenRA.Mods.Cnc.dll will also be copied (True, False)
|
||||
# Used by:
|
||||
# Makefile (install target for local installs and downstream packaging)
|
||||
# Linux AppImage packaging
|
||||
# macOS packaging
|
||||
# Windows packaging
|
||||
# Mod SDK Linux AppImage packaging
|
||||
# Mod SDK macOS packaging
|
||||
# Mod SDK Windows packaging
|
||||
install_assemblies_mono() {
|
||||
SRC_PATH="${1}"
|
||||
DEST_PATH="${2}"
|
||||
TARGETPLATFORM="${3}"
|
||||
COPY_GENERIC_LAUNCHER="${4}"
|
||||
COPY_CNC_DLL="${5}"
|
||||
COPY_D2K_DLL="${6}"
|
||||
|
||||
echo "Building assemblies"
|
||||
ORIG_PWD=$(pwd)
|
||||
cd "${SRC_PATH}" || exit 1
|
||||
msbuild -verbosity:m -nologo -t:Clean
|
||||
rm -rf "${SRC_PATH:?}/bin"
|
||||
msbuild -verbosity:m -nologo -t:Build -restore -p:Configuration=Release -p:TargetPlatform="${TARGETPLATFORM}"
|
||||
if [ "${TARGETPLATFORM}" = "unix-generic" ]; then
|
||||
./configure-system-libraries.sh
|
||||
fi
|
||||
|
||||
./fetch-geoip.sh
|
||||
cd "${ORIG_PWD}" || exit 1
|
||||
|
||||
echo "Installing engine to ${DEST_PATH}"
|
||||
install -d "${DEST_PATH}"
|
||||
|
||||
# Core engine
|
||||
install -m755 "${SRC_PATH}/bin/OpenRA.Server.exe" "${DEST_PATH}"
|
||||
install -m755 "${SRC_PATH}/bin/OpenRA.Utility.exe" "${DEST_PATH}"
|
||||
install -m644 "${SRC_PATH}/bin/OpenRA.Game.dll" "${DEST_PATH}"
|
||||
install -m644 "${SRC_PATH}/bin/OpenRA.Platforms.Default.dll" "${DEST_PATH}"
|
||||
if [ "${COPY_GENERIC_LAUNCHER}" = "True" ]; then
|
||||
install -m755 "${SRC_PATH}/bin/OpenRA.exe" "${DEST_PATH}"
|
||||
fi
|
||||
|
||||
# Mod dlls
|
||||
install -m644 "${SRC_PATH}/bin/OpenRA.Mods.Common.dll" "${DEST_PATH}"
|
||||
if [ "${COPY_CNC_DLL}" = "True" ]; then
|
||||
install -m644 "${SRC_PATH}/bin/OpenRA.Mods.Cnc.dll" "${DEST_PATH}"
|
||||
fi
|
||||
|
||||
if [ "${COPY_D2K_DLL}" = "True" ]; then
|
||||
install -m644 "${SRC_PATH}/bin/OpenRA.Mods.D2k.dll" "${DEST_PATH}"
|
||||
fi
|
||||
|
||||
# Managed Dependencies
|
||||
for LIB in ICSharpCode.SharpZipLib.dll FuzzyLogicLibrary.dll Open.Nat.dll BeaconLib.dll DiscordRPC.dll Newtonsoft.Json.dll SDL2-CS.dll OpenAL-CS.Core.dll Eluant.dll; do
|
||||
install -m644 "${SRC_PATH}/bin/${LIB}" "${DEST_PATH}"
|
||||
done
|
||||
|
||||
# Native dependencies
|
||||
if [ "${TARGETPLATFORM}" = "win-x86" ] || [ "${TARGETPLATFORM}" = "win-x64" ]; then
|
||||
echo "Installing dependencies for ${TARGETPLATFORM} to ${DEST_PATH}"
|
||||
for LIB in soft_oal.dll SDL2.dll freetype6.dll lua51.dll libEGL.dll libGLESv2.dll; do
|
||||
install -m644 "${SRC_PATH}/bin/${LIB}" "${DEST_PATH}"
|
||||
done
|
||||
else
|
||||
for LIB in OpenRA.Platforms.Default.dll.config SDL2-CS.dll.config OpenAL-CS.Core.dll.config Eluant.dll.config; do
|
||||
install -m644 "${SRC_PATH}/bin/${LIB}" "${DEST_PATH}"
|
||||
done
|
||||
fi
|
||||
|
||||
if [ "${TARGETPLATFORM}" = "linux-x64" ]; then
|
||||
echo "Installing dependencies for ${TARGETPLATFORM} to ${DEST_PATH}"
|
||||
for LIB in soft_oal.so SDL2.so freetype6.so lua51.so; do
|
||||
install -m755 "${SRC_PATH}/bin/${LIB}" "${DEST_PATH}"
|
||||
done
|
||||
fi
|
||||
|
||||
if [ "${TARGETPLATFORM}" = "osx-x64" ]; then
|
||||
echo "Installing dependencies for ${TARGETPLATFORM} to ${DEST_PATH}"
|
||||
for LIB in soft_oal.dylib SDL2.dylib freetype6.dylib lua51.dylib; do
|
||||
install -m755 "${SRC_PATH}/bin/${LIB}" "${DEST_PATH}"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
# Copy the core engine and specified mod data to the target directory
|
||||
# Arguments:
|
||||
# SRC_PATH: Path to the root OpenRA directory
|
||||
# DEST_PATH: Path to the root of the install destination (will be created if necessary)
|
||||
# MOD [MOD...]: One or more mod ids to copy (cnc, d2k, ra)
|
||||
# Used by:
|
||||
# Makefile (install target for local installs and downstream packaging)
|
||||
# Linux AppImage packaging
|
||||
# macOS packaging
|
||||
# Windows packaging
|
||||
# Mod SDK Linux AppImage packaging
|
||||
# Mod SDK macOS packaging
|
||||
# Mod SDK Windows packaging
|
||||
install_data() {
|
||||
SRC_PATH="${1}"
|
||||
DEST_PATH="${2}"
|
||||
shift 2
|
||||
|
||||
echo "Installing engine files to ${DEST_PATH}"
|
||||
for FILE in VERSION AUTHORS COPYING IP2LOCATION-LITE-DB1.IPV6.BIN.ZIP "global mix database.dat"; do
|
||||
install -m644 "${SRC_PATH}/${FILE}" "${DEST_PATH}"
|
||||
done
|
||||
|
||||
cp -r "${SRC_PATH}/glsl" "${DEST_PATH}"
|
||||
cp -r "${SRC_PATH}/lua" "${DEST_PATH}"
|
||||
|
||||
echo "Installing common mod files to ${DEST_PATH}"
|
||||
install -d "${DEST_PATH}/mods"
|
||||
cp -r "${SRC_PATH}/mods/common" "${DEST_PATH}/mods/"
|
||||
|
||||
while [ -n "${1}" ]; do
|
||||
MOD_ID="${1}"
|
||||
if [ "${MOD_ID}" = "ra" ] || [ "${MOD_ID}" = "cnc" ] || [ "${MOD_ID}" = "d2k" ]; then
|
||||
echo "Installing mod ${MOD_ID} to ${DEST_PATH}"
|
||||
cp -r "${SRC_PATH}/mods/${MOD_ID}" "${DEST_PATH}/mods/"
|
||||
cp -r "${SRC_PATH}/mods/modcontent" "${DEST_PATH}/mods/"
|
||||
fi
|
||||
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
# Compile and publish (using Mono) a windows launcher with the specified mod details to the target directory
|
||||
# Arguments:
|
||||
# SRC_PATH: Path to the root OpenRA directory
|
||||
# DEST_PATH: Path to the root of the install destination (will be created if necessary)
|
||||
# TARGETPLATFORM: Platform type (win-x86, win-x64)
|
||||
# MOD_ID: Mod id to launch (e.g. "ra")
|
||||
# LAUNCHER_NAME: Filename (without the .exe extension) for the launcher
|
||||
# MOD_NAME: Human-readable mod name to show in the crash dialog (e.g. "Red Alert")
|
||||
# ICON_PATH: Path to a windows .ico file
|
||||
# FAQ_URL: URL to load when the "View FAQ" button is pressed in the crash dialog (e.g. https://wiki.openra.net/FAQ)
|
||||
# Used by:
|
||||
# Windows packaging
|
||||
# Mod SDK Windows packaging
|
||||
install_windows_launcher()
|
||||
{
|
||||
SRC_PATH="${1}"
|
||||
DEST_PATH="${2}"
|
||||
TARGETPLATFORM="${3}"
|
||||
MOD_ID="${4}"
|
||||
LAUNCHER_NAME="${5}"
|
||||
MOD_NAME="${6}"
|
||||
ICON_PATH="${7}"
|
||||
FAQ_URL="${8}"
|
||||
|
||||
msbuild -verbosity:m -nologo -t:Clean "${SRC_PATH}/OpenRA.WindowsLauncher/OpenRA.WindowsLauncher.csproj"
|
||||
rm -rf "${SRC_PATH:?}/bin"
|
||||
msbuild -t:Build "${SRC_PATH}/OpenRA.WindowsLauncher/OpenRA.WindowsLauncher.csproj" -restore -p:Configuration=Release -p:TargetPlatform="${TARGETPLATFORM}" -p:LauncherName="${LAUNCHER_NAME}" -p:LauncherIcon="${ICON_PATH}" -p:ModID="${MOD_ID}" -p:DisplayName="${MOD_NAME}" -p:FaqUrl="${FAQ_URL}"
|
||||
install -m755 "${SRC_PATH}/bin/${LAUNCHER_NAME}.exe" "${DEST_PATH}"
|
||||
install -m644 "${SRC_PATH}/bin/${LAUNCHER_NAME}.exe.config" "${DEST_PATH}"
|
||||
|
||||
# Enable the full 4GB address space for the 32 bit game executable
|
||||
# The server and utility do not use enough memory to need this
|
||||
if [ "${TARGETPLATFORM}" = "win-x86" ]; then
|
||||
python3 "${SRC_PATH}/packaging/windows/MakeLAA.py" "${DEST_PATH}/${LAUNCHER_NAME}.exe"
|
||||
fi
|
||||
}
|
||||
|
||||
# Write a version string to the engine VERSION file
|
||||
# Arguments:
|
||||
# VERSION: OpenRA version string
|
||||
# DEST_PATH: Path to the root of the install destination
|
||||
# Used by:
|
||||
# Makefile (install target for local installs and downstream packaging)
|
||||
# Linux AppImage packaging
|
||||
# macOS packaging
|
||||
# Windows packaging
|
||||
# Mod SDK Linux AppImage packaging
|
||||
# Mod SDK macOS packaging
|
||||
# Mod SDK Windows packaging
|
||||
set_engine_version() {
|
||||
VERSION="${1}"
|
||||
DEST_PATH="${2}"
|
||||
echo "${VERSION}" > "${DEST_PATH}/VERSION"
|
||||
}
|
||||
|
||||
# Write a version string to a list of specified mod.yamls
|
||||
# Arguments:
|
||||
# VERSION: OpenRA version string
|
||||
# MOD_YAML_PATH [MOD_YAML_PATH...]: One or more mod.yaml files to update
|
||||
# Used by:
|
||||
# Makefile (install target for local installs and downstream packaging)
|
||||
# Linux AppImage packaging
|
||||
# macOS packaging
|
||||
# Windows packaging
|
||||
# Mod SDK Linux AppImage packaging
|
||||
# Mod SDK macOS packaging
|
||||
# Mod SDK Windows packaging
|
||||
set_mod_version() {
|
||||
VERSION="${1}"
|
||||
shift
|
||||
while [ -n "${1}" ]; do
|
||||
MOD_YAML_PATH="${1}"
|
||||
awk -v v="${VERSION}" '{sub("Version:.*$", "Version: " v); print $0}' "${MOD_YAML_PATH}" > "${MOD_YAML_PATH}.tmp"
|
||||
awk -v v="${VERSION}" '{sub("/[^/]*: User$", "/"v ": User"); print $0}' "${MOD_YAML_PATH}.tmp" > "${MOD_YAML_PATH}"
|
||||
rm "${MOD_YAML_PATH}.tmp"
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
# Copy launch wrappers, application icons, desktop, and MIME files to the target directory
|
||||
# Arguments:
|
||||
# SRC_PATH: Path to the root OpenRA directory
|
||||
# OPENRA_PATH: Path to the OpenRA installation (e.g. /usr/local/lib/openra)
|
||||
# BIN_PATH: Path to install wrapper scripts (e.g. /usr/local/bin)
|
||||
# SHARE_PATH: Parent path to the icons and applications directory (e.g. /usr/local/share)
|
||||
# VERSION: OpenRA version string
|
||||
# MOD [MOD...]: One or more mod ids to copy (cnc, d2k, ra)
|
||||
# Used by:
|
||||
# Makefile (install-linux-shortcuts target for local installs and downstream packaging)
|
||||
install_linux_shortcuts() {
|
||||
SRC_PATH="${1}"
|
||||
OPENRA_PATH="${2}"
|
||||
BIN_PATH="${3}"
|
||||
SHARE_PATH="${4}"
|
||||
VERSION="${5}"
|
||||
shift 5
|
||||
|
||||
while [ -n "${1}" ]; do
|
||||
MOD_ID="${1}"
|
||||
if [ "${MOD_ID}" = "ra" ] || [ "${MOD_ID}" = "cnc" ] || [ "${MOD_ID}" = "d2k" ]; then
|
||||
if [ "${MOD_ID}" = "cnc" ]; then
|
||||
MOD_NAME="Tiberian Dawn"
|
||||
fi
|
||||
|
||||
if [ "${MOD_ID}" = "d2k" ]; then
|
||||
MOD_NAME="Dune 2000"
|
||||
fi
|
||||
|
||||
if [ "${MOD_ID}" = "ra" ]; then
|
||||
MOD_NAME="Red Alert"
|
||||
fi
|
||||
|
||||
# bin wrappers
|
||||
install -d "${DEST_PATH}/bin"
|
||||
|
||||
sed 's/{DEBUG}/--debug/' "${SRC_PATH}/packaging/linux/openra.in" | sed "s|{GAME_INSTALL_DIR}|${OPENRA_PATH}|" | sed "s|{BIN_DIR}|${DEST_PATH}/bin)|" | sed "s/{MODID}/${MOD_ID}/g" | sed "s/{TAG}/${VERSION}/g" | sed "s/{MODNAME}/${MOD_NAME}/g" > "${SRC_PATH}/packaging/linux/openra-${MOD_ID}"
|
||||
sed 's/{DEBUG}/--debug/' "${SRC_PATH}/packaging/linux/openra-server.in" | sed "s|{GAME_INSTALL_DIR}|${OPENRA_PATH}|" | sed "s/{MODID}/${MOD_ID}/g" > "${SRC_PATH}/packaging/linux/openra-${MOD_ID}-server"
|
||||
install -m755 "${SRC_PATH}/packaging/linux/openra-${MOD_ID}" "${BIN_PATH}"
|
||||
install -m755 "${SRC_PATH}/packaging/linux/openra-${MOD_ID}-server" "${BIN_PATH}"
|
||||
rm "${SRC_PATH}/packaging/linux/openra-${MOD_ID}" "${SRC_PATH}/packaging/linux/openra-${MOD_ID}-server"
|
||||
|
||||
# desktop files
|
||||
install -d "${SHARE_PATH}/applications"
|
||||
sed "s/{MODID}/${MOD_ID}/g" "${SRC_PATH}/packaging/linux/openra.desktop.in" | sed "s/{MODNAME}/${MOD_NAME}/g" | sed "s/{TAG}/${VERSION}/g" > "${SRC_PATH}/packaging/linux/openra-${MOD_ID}.desktop"
|
||||
install -m644 "${SRC_PATH}/packaging/linux/openra-${MOD_ID}.desktop" "${SHARE_PATH}/applications"
|
||||
rm "${SRC_PATH}/packaging/linux/openra-${MOD_ID}.desktop"
|
||||
|
||||
# icons
|
||||
for SIZE in 16x16 32x32 48x48 64x64 128x128; do
|
||||
install -d "${SHARE_PATH}/icons/hicolor/${SIZE}/apps"
|
||||
install -m644 "${SRC_PATH}/packaging/artwork/${MOD_ID}_${SIZE}.png" "${SHARE_PATH}/icons/hicolor/${SIZE}/apps/openra-${MOD_ID}.png"
|
||||
done
|
||||
|
||||
if [ "${MOD_ID}" = "ra" ] || [ "${MOD_ID}" = "cnc" ]; then
|
||||
install -d "${SHARE_PATH}/icons/hicolor/scalable/apps"
|
||||
install -m644 "${SRC_PATH}/packaging/artwork/${MOD_ID}_scalable.svg" "${SHARE_PATH}/icons/hicolor/scalable/apps/openra-${MOD_ID}.svg"
|
||||
fi
|
||||
|
||||
# MIME info
|
||||
install -d "${SHARE_PATH}/mime/packages"
|
||||
sed "s/{MODID}/${MOD_ID}/g" "${SRC_PATH}/packaging/linux/openra-mimeinfo.xml.in" | sed "s/{TAG}/${VERSION}/g" > "${SRC_PATH}/packaging/linux/openra-${MOD_ID}.xml"
|
||||
install -m644 "${SRC_PATH}/packaging/linux/openra-${MOD_ID}.xml" "${SHARE_PATH}/mime/packages/openra-${MOD_ID}.xml"
|
||||
rm "${SRC_PATH}/packaging/linux/openra-${MOD_ID}.xml"
|
||||
fi
|
||||
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
# Copy AppStream metadata to the target directory
|
||||
# Arguments:
|
||||
# SRC_PATH: Path to the root OpenRA directory
|
||||
# SHARE_PATH: Parent path to the appdata directory (e.g. /usr/local/share)
|
||||
# MOD [MOD...]: One or more mod ids to copy (cnc, d2k, ra)
|
||||
# Used by:
|
||||
# Makefile (install-linux-appdata target for local installs and downstream packaging)
|
||||
install_linux_appdata() {
|
||||
SRC_PATH="${1}"
|
||||
SHARE_PATH="${2}"
|
||||
shift 2
|
||||
while [ -n "${1}" ]; do
|
||||
MOD_ID="${1}"
|
||||
SCREENSHOT_CNC=
|
||||
SCREENSHOT_D2K=
|
||||
SCREENSHOT_RA=
|
||||
if [ "${MOD_ID}" = "ra" ] || [ "${MOD_ID}" = "cnc" ] || [ "${MOD_ID}" = "d2k" ]; then
|
||||
if [ "${MOD_ID}" = "cnc" ]; then
|
||||
MOD_NAME="Tiberian Dawn"
|
||||
SCREENSHOT_CNC=" type=\"default\""
|
||||
fi
|
||||
|
||||
if [ "${MOD_ID}" = "d2k" ]; then
|
||||
MOD_NAME="Dune 2000"
|
||||
SCREENSHOT_D2K=" type=\"default\""
|
||||
fi
|
||||
|
||||
if [ "${MOD_ID}" = "ra" ]; then
|
||||
MOD_NAME="Red Alert"
|
||||
SCREENSHOT_RA=" type=\"default\""
|
||||
fi
|
||||
fi
|
||||
|
||||
install -d "${SHARE_PATH}/appdata"
|
||||
|
||||
sed "s/{MODID}/${MOD_ID}/g" "${SRC_PATH}/packaging/linux/openra.appdata.xml.in" | sed "s/{MOD_NAME}/${MOD_NAME}/g" | sed "s/{SCREENSHOT_RA}/${SCREENSHOT_RA}/g" | sed "s/{SCREENSHOT_CNC}/${SCREENSHOT_CNC}/g" | sed "s/{SCREENSHOT_D2K}/${SCREENSHOT_D2K}/g"> "${SRC_PATH}/packaging/linux/openra-${MOD_ID}.appdata.xml"
|
||||
install -m644 "${SRC_PATH}/packaging/linux/openra-${MOD_ID}.appdata.xml" "${SHARE_PATH}/appdata"
|
||||
rm "${SRC_PATH}/packaging/linux/openra-${MOD_ID}.appdata.xml"
|
||||
|
||||
shift
|
||||
done
|
||||
}
|
||||
@@ -15,6 +15,7 @@ fi
|
||||
|
||||
# Set the working dir to the location of this script
|
||||
cd "$(dirname "$0")" || exit 1
|
||||
. ../functions.sh
|
||||
|
||||
TAG="$1"
|
||||
OUTPUTDIR="$2"
|
||||
@@ -42,20 +43,6 @@ if [ ! -d "${OUTPUTDIR}" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Building core files"
|
||||
|
||||
pushd "${SRCDIR}" > /dev/null || exit 1
|
||||
|
||||
make clean
|
||||
|
||||
make core TARGETPLATFORM=linux-x64
|
||||
make version VERSION="${TAG}"
|
||||
make install-engine prefix="usr" DESTDIR="${BUILTDIR}/"
|
||||
make install-common-mod-files prefix="usr" DESTDIR="${BUILTDIR}/"
|
||||
make install-dependencies TARGETPLATFORM=linux-x64 prefix="usr" DESTDIR="${BUILTDIR}/"
|
||||
|
||||
popd > /dev/null || exit 1
|
||||
|
||||
# Add native libraries
|
||||
echo "Downloading dependencies"
|
||||
if command -v curl >/dev/null 2>&1; then
|
||||
@@ -66,29 +53,21 @@ else
|
||||
wget -cq https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage || exit 3
|
||||
fi
|
||||
|
||||
# travis-ci doesn't support mounting FUSE filesystems so extract and run the contents manually
|
||||
chmod a+x appimagetool-x86_64.AppImage
|
||||
./appimagetool-x86_64.AppImage --appimage-extract
|
||||
|
||||
echo "Building AppImage"
|
||||
mkdir libs
|
||||
pushd libs
|
||||
tar xf ../mono.tar.bz2
|
||||
mkdir "${BUILTDIR}"
|
||||
tar xf mono.tar.bz2 -C "${BUILTDIR}"
|
||||
chmod 0755 "${BUILTDIR}/usr/bin/mono"
|
||||
chmod 0644 "${BUILTDIR}/etc/mono/config"
|
||||
chmod 0644 "${BUILTDIR}/etc/mono/4.5/machine.config"
|
||||
chmod 0644 "${BUILTDIR}/usr/lib/mono/4.5/Facades/"*.dll
|
||||
chmod 0644 "${BUILTDIR}/usr/lib/mono/4.5/"*.dll "${BUILTDIR}/usr/lib/mono/4.5/"*.exe
|
||||
chmod 0755 "${BUILTDIR}/usr/lib/"*.so
|
||||
|
||||
install -d "${BUILTDIR}/usr/bin"
|
||||
install -d "${BUILTDIR}/etc/mono/4.5"
|
||||
install -d "${BUILTDIR}/usr/lib/mono/4.5/Facades"
|
||||
|
||||
install -Dm 0755 usr/bin/mono "${BUILTDIR}/usr/bin/"
|
||||
|
||||
install -Dm 0644 /etc/mono/config "${BUILTDIR}/etc/mono/"
|
||||
install -Dm 0644 /etc/mono/4.5/machine.config "${BUILTDIR}/etc/mono/4.5"
|
||||
|
||||
for f in $(ls usr/lib/mono/4.5/Facades/*.dll); do install -Dm 0644 "$f" "${BUILTDIR}/usr/lib/mono/4.5/Facades/"; done
|
||||
for f in $(ls usr/lib/mono/4.5/*.dll usr/lib/mono/4.5/*.exe); do install -Dm 0644 "$f" "${BUILTDIR}/usr/lib/mono/4.5/"; done
|
||||
for f in $(ls usr/lib/*.so); do install -Dm 0755 "$f" "${BUILTDIR}/usr/lib/"; done
|
||||
|
||||
popd
|
||||
|
||||
rm -rf libs mono.tar.bz2
|
||||
rm -rf mono.tar.bz2
|
||||
|
||||
build_appimage() {
|
||||
MOD_ID=${1}
|
||||
@@ -99,28 +78,30 @@ build_appimage() {
|
||||
|
||||
cp -r "${BUILTDIR}" "${APPDIR}"
|
||||
|
||||
# Add mod files
|
||||
pushd "${SRCDIR}" > /dev/null || exit 1
|
||||
cp -r "mods/${MOD_ID}" mods/modcontent "${APPDIR}/usr/lib/openra/mods"
|
||||
|
||||
# HACK: The D2k dll is not copied by install-common-mod-files so we must do this ourselves
|
||||
IS_D2K="False"
|
||||
if [ "${MOD_ID}" = "d2k" ]; then
|
||||
cp "bin/OpenRA.Mods.D2k.dll" "${APPDIR}/usr/lib/openra"
|
||||
IS_D2K="True"
|
||||
fi
|
||||
popd > /dev/null || exit 1
|
||||
|
||||
install_assemblies_mono "${SRCDIR}" "${APPDIR}/usr/lib/openra" "linux-x64" "True" "True" "${IS_D2K}"
|
||||
install_data "${SRCDIR}" "${APPDIR}/usr/lib/openra" "${MOD_ID}"
|
||||
set_engine_version "${TAG}" "${APPDIR}/usr/lib/openra"
|
||||
set_mod_version "${TAG}" "${APPDIR}/usr/lib/openra/mods/${MOD_ID}/mod.yaml" "${APPDIR}/usr/lib/openra/mods/modcontent/mod.yaml"
|
||||
|
||||
# Add launcher and icons
|
||||
sed "s/{MODID}/${MOD_ID}/g" AppRun.in | sed "s/{MODNAME}/${DISPLAY_NAME}/g" > AppRun.temp
|
||||
install -m 0755 AppRun.temp "${APPDIR}/AppRun"
|
||||
sed "s/{MODID}/${MOD_ID}/g" AppRun.in | sed "s/{MODNAME}/${DISPLAY_NAME}/g" > "${APPDIR}/AppRun"
|
||||
chmod 0755 "${APPDIR}/AppRun"
|
||||
|
||||
sed "s/{MODID}/${MOD_ID}/g" openra.desktop.in | sed "s/{MODNAME}/${DISPLAY_NAME}/g" | sed "s/{TAG}/${TAG}/g" | sed "s/{DISCORDAPPID}/${DISCORD_ID}/g" > temp.desktop
|
||||
echo "StartupWMClass=openra-${MOD_ID}-${TAG}" >> temp.desktop
|
||||
mkdir -p "${APPDIR}/usr/share/applications"
|
||||
# Note that the non-discord version of the desktop file is used by the Mod SDK and must be maintained in parallel with the discord version!
|
||||
sed "s/{MODID}/${MOD_ID}/g" openra.desktop.discord.in | sed "s/{MODNAME}/${DISPLAY_NAME}/g" | sed "s/{TAG}/${TAG}/g" | sed "s/{DISCORDAPPID}/${DISCORD_ID}/g" > "${APPDIR}/usr/share/applications/openra-${MOD_ID}.desktop"
|
||||
chmod 0755 "${APPDIR}/usr/share/applications/openra-${MOD_ID}.desktop"
|
||||
cp "${APPDIR}/usr/share/applications/openra-${MOD_ID}.desktop" "${APPDIR}/openra-${MOD_ID}.desktop"
|
||||
|
||||
install -Dm 0755 temp.desktop "${APPDIR}/usr/share/applications/openra-${MOD_ID}.desktop"
|
||||
install -m 0755 temp.desktop "${APPDIR}/openra-${MOD_ID}.desktop"
|
||||
|
||||
sed "s/{MODID}/${MOD_ID}/g" openra-mimeinfo.xml.in | sed "s/{TAG}/${TAG}/g" > temp.xml
|
||||
install -Dm 0755 temp.xml "${APPDIR}/usr/share/mime/packages/openra-${MOD_ID}.xml"
|
||||
mkdir -p "${APPDIR}/usr/share/mime/packages"
|
||||
# Note that the non-discord version of the mimeinfo file is used by the Mod SDK and must be maintained in parallel with the discord version!
|
||||
sed "s/{MODID}/${MOD_ID}/g" openra-mimeinfo.xml.discord.in | sed "s/{TAG}/${TAG}/g" | sed "s/{DISCORDAPPID}/${DISCORD_ID}/g" > "${APPDIR}/usr/share/mime/packages/openra-${MOD_ID}.xml"
|
||||
chmod 0755 "${APPDIR}/usr/share/mime/packages/openra-${MOD_ID}.xml"
|
||||
|
||||
if [ -f "${ARTWORK_DIR}/${MOD_ID}_scalable.svg" ]; then
|
||||
install -Dm644 "${ARTWORK_DIR}/${MOD_ID}_scalable.svg" "${APPDIR}/usr/share/icons/hicolor/scalable/apps/openra-${MOD_ID}.svg"
|
||||
@@ -133,24 +114,20 @@ build_appimage() {
|
||||
fi
|
||||
done
|
||||
|
||||
sed "s/{MODID}/${MOD_ID}/g" openra.appimage.in | sed "s/{TAG}/${TAG}/g" | sed "s/{MODNAME}/${DISPLAY_NAME}/g" > openra-mod.temp
|
||||
install -m 0755 openra-mod.temp "${APPDIR}/usr/bin/openra-${MOD_ID}"
|
||||
sed "s/{MODID}/${MOD_ID}/g" openra.appimage.in | sed "s/{TAG}/${TAG}/g" | sed "s/{MODNAME}/${DISPLAY_NAME}/g" > "${APPDIR}/usr/bin/openra-${MOD_ID}"
|
||||
chmod 0755 "${APPDIR}/usr/bin/openra-${MOD_ID}"
|
||||
|
||||
sed "s/{MODID}/${MOD_ID}/g" openra-server.appimage.in > openra-mod-server.temp
|
||||
install -m 0755 openra-mod-server.temp "${APPDIR}/usr/bin/openra-${MOD_ID}-server"
|
||||
sed "s/{MODID}/${MOD_ID}/g" openra-server.appimage.in > "${APPDIR}/usr/bin/openra-${MOD_ID}-server"
|
||||
chmod 0755 "${APPDIR}/usr/bin/openra-${MOD_ID}-server"
|
||||
|
||||
sed "s/{MODID}/${MOD_ID}/g" openra-utility.appimage.in > openra-mod-utility.temp
|
||||
install -m 0755 openra-mod-utility.temp "${APPDIR}/usr/bin/openra-${MOD_ID}-utility"
|
||||
sed "s/{MODID}/${MOD_ID}/g" openra-utility.appimage.in > "${APPDIR}/usr/bin/openra-${MOD_ID}-utility"
|
||||
chmod 0755 "${APPDIR}/usr/bin/openra-${MOD_ID}-utility"
|
||||
|
||||
install -m 0755 gtk-dialog.py "${APPDIR}/usr/bin/gtk-dialog.py"
|
||||
|
||||
install -m 0755 restore-environment.sh "${APPDIR}/usr/bin/restore-environment.sh"
|
||||
|
||||
# travis-ci doesn't support mounting FUSE filesystems so extract and run the contents manually
|
||||
./appimagetool-x86_64.AppImage --appimage-extract
|
||||
|
||||
# Embed update metadata if (and only if) compiled on travis
|
||||
if [ ! -z "${TRAVIS_REPO_SLUG}" ]; then
|
||||
if [ -n "${TRAVIS_REPO_SLUG}" ]; then
|
||||
ARCH=x86_64 ./squashfs-root/AppRun --no-appstream -u "zsync|https://master.openra.net/appimagecheck?mod=${MOD_ID}&channel=${UPDATE_CHANNEL}" "${APPDIR}" "${OUTPUTDIR}/${APPIMAGE}"
|
||||
zsyncmake -u "https://github.com/${TRAVIS_REPO_SLUG}/releases/download/${TAG}/${APPIMAGE}" -o "${OUTPUTDIR}/${APPIMAGE}.zsync" "${OUTPUTDIR}/${APPIMAGE}"
|
||||
else
|
||||
@@ -165,4 +142,4 @@ build_appimage "cnc" "Tiberian Dawn" "699223250181292033"
|
||||
build_appimage "d2k" "Dune 2000" "712711732770111550"
|
||||
|
||||
# Clean up
|
||||
rm -rf openra-mod.temp openra-mod-server.temp openra-mod-utility.temp temp.desktop temp.xml AppRun.temp appimagetool-x86_64.AppImage squashfs-root "${BUILTDIR}"
|
||||
rm -rf appimagetool-x86_64.AppImage squashfs-root "${BUILTDIR}"
|
||||
|
||||
14
packaging/linux/openra-mimeinfo.xml.discord.in
Normal file
14
packaging/linux/openra-mimeinfo.xml.discord.in
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0"?>
|
||||
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
|
||||
<mime-type type="x-scheme-handler/openra-{MODID}-{TAG}">
|
||||
<icon name="openra-{MODID}" />
|
||||
<generic-icon name="applications-games"/>
|
||||
<comment>Join OpenRA server</comment>
|
||||
<glob weight="60" pattern="openra-{MODID}-{TAG}://*"/>
|
||||
</mime-type>
|
||||
<mime-type type="x-scheme-handler/discord-{DISCORDAPPID}">
|
||||
<generic-icon name="applications-games"/>
|
||||
<comment>Launch OpenRA from Discord</comment>
|
||||
<glob weight="60" pattern="discord-{DISCORDAPPID}://*"/>
|
||||
</mime-type>
|
||||
</mime-info>
|
||||
@@ -2,4 +2,4 @@
|
||||
HERE="$(dirname "$(readlink -f "${0}")")"
|
||||
cd "${HERE}/../lib/openra" || exit 1
|
||||
|
||||
mono --debug OpenRA.Server.exe Game.Mod={MODID} "$@"
|
||||
mono --debug OpenRA.Server.exe Game.Mod="{MODID}" "$@"
|
||||
|
||||
12
packaging/linux/openra.desktop.discord.in
Normal file
12
packaging/linux/openra.desktop.discord.in
Normal file
@@ -0,0 +1,12 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Version=1.0
|
||||
Name=OpenRA - {MODNAME}
|
||||
GenericName=Real Time Strategy Game
|
||||
GenericName[de]=Echtzeit-Strategiespiel
|
||||
Icon=openra-{MODID}
|
||||
Exec=openra-{MODID} %U
|
||||
Terminal=false
|
||||
Categories=Game;StrategyGame;
|
||||
StartupWMClass=openra-{MODID}-{TAG}
|
||||
MimeType=x-scheme-handler/openra-{MODID}-{TAG};x-scheme-handler/discord-{DISCORDAPPID};
|
||||
@@ -4,9 +4,9 @@ Version=1.0
|
||||
Name=OpenRA - {MODNAME}
|
||||
GenericName=Real Time Strategy Game
|
||||
GenericName[de]=Echtzeit-Strategiespiel
|
||||
Comment=Reimagining of early Westwood Games
|
||||
Icon=openra-{MODID}
|
||||
Exec=openra-{MODID} %U
|
||||
Terminal=false
|
||||
Categories=Game;StrategyGame;
|
||||
MimeType=x-scheme-handler/openra-{MODID}-{TAG};x-scheme-handler/discord-{DISCORDAPPID};
|
||||
StartupWMClass=openra-{MODID}-{TAG}
|
||||
MimeType=x-scheme-handler/openra-{MODID}-{TAG};
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
<configuration>
|
||||
<dllmap os="osx" dll="lua51.dll" target="liblua.5.1.dylib" />
|
||||
</configuration>
|
||||
@@ -1,8 +1,9 @@
|
||||
#!/bin/bash
|
||||
# OpenRA packaging script for macOS
|
||||
#
|
||||
# The application bundles will be signed if the following environment variable is defined:
|
||||
# MACOS_DEVELOPER_IDENTITY: Certificate name, of the form `Developer\ ID\ Application:\ <name with escaped spaces>`
|
||||
# The application bundles will be signed if the following environment variables are defined:
|
||||
# MACOS_DEVELOPER_IDENTITY: The alphanumeric identifier listed in the certificate name ("Developer ID Application: <your name> (<identity>)")
|
||||
# or as Team ID in your Apple Developer account Membership Details.
|
||||
# If the identity is not already in the default keychain, specify the following environment variables to import it:
|
||||
# MACOS_DEVELOPER_CERTIFICATE_BASE64: base64 content of the exported .p12 developer ID certificate.
|
||||
# Generate using `base64 certificate.p12 | pbcopy`
|
||||
@@ -12,6 +13,7 @@
|
||||
# MACOS_DEVELOPER_USERNAME: Email address for the developer account
|
||||
# MACOS_DEVELOPER_PASSWORD: App-specific password for the developer account
|
||||
#
|
||||
set -e
|
||||
|
||||
MONO_TAG="osx-launcher-20200830"
|
||||
|
||||
@@ -20,13 +22,14 @@ if [ $# -ne "2" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$OSTYPE" != "darwin"* ]]; then
|
||||
if [[ "${OSTYPE}" != "darwin"* ]]; then
|
||||
echo >&2 "macOS packaging requires a macOS host"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Set the working dir to the location of this script
|
||||
cd "$(dirname "$0")" || exit 1
|
||||
cd "$(dirname "${0}")" || exit 1
|
||||
. ../functions.sh
|
||||
|
||||
# Import code signing certificate
|
||||
if [ -n "${MACOS_DEVELOPER_CERTIFICATE_BASE64}" ] && [ -n "${MACOS_DEVELOPER_CERTIFICATE_PASSWORD}" ] && [ -n "${MACOS_DEVELOPER_IDENTITY}" ]; then
|
||||
@@ -40,34 +43,39 @@ if [ -n "${MACOS_DEVELOPER_CERTIFICATE_BASE64}" ] && [ -n "${MACOS_DEVELOPER_CER
|
||||
rm -fr build.p12
|
||||
fi
|
||||
|
||||
TAG="$1"
|
||||
OUTPUTDIR="$2"
|
||||
TAG="${1}"
|
||||
OUTPUTDIR="${2}"
|
||||
SRCDIR="$(pwd)/../.."
|
||||
BUILTDIR="$(pwd)/build"
|
||||
ARTWORK_DIR="$(pwd)/../artwork/"
|
||||
|
||||
modify_plist() {
|
||||
sed "s|$1|$2|g" "$3" > "$3.tmp" && mv "$3.tmp" "$3"
|
||||
sed "s|${1}|${2}|g" "${3}" > "${3}.tmp" && mv "${3}.tmp" "${3}"
|
||||
}
|
||||
|
||||
# Copies the game files and sets metadata
|
||||
populate_bundle() {
|
||||
TEMPLATE_DIR="${BUILTDIR}/${1}"
|
||||
MOD_ID=${2}
|
||||
MOD_NAME=${3}
|
||||
DISCORD_APPID=${4}
|
||||
build_app() {
|
||||
TEMPLATE_DIR="${1}"
|
||||
LAUNCHER_DIR="${2}"
|
||||
MOD_ID="${3}"
|
||||
MOD_NAME="${4}"
|
||||
DISCORD_APPID="${5}"
|
||||
|
||||
cp -r "${BUILTDIR}/OpenRA.app" "${TEMPLATE_DIR}"
|
||||
LAUNCHER_CONTENTS_DIR="${LAUNCHER_DIR}/Contents"
|
||||
LAUNCHER_RESOURCES_DIR="${LAUNCHER_CONTENTS_DIR}/Resources"
|
||||
|
||||
# Add mod files
|
||||
pushd "${SRCDIR}" > /dev/null || exit 1
|
||||
cp -r "mods/${MOD_ID}" mods/modcontent "${TEMPLATE_DIR}/Contents/Resources/mods"
|
||||
cp -r "${TEMPLATE_DIR}" "${LAUNCHER_DIR}"
|
||||
|
||||
# HACK: The D2k dll is not copied by install-common-mod-files so we must do this ourselves
|
||||
IS_D2K="False"
|
||||
if [ "${MOD_ID}" = "d2k" ]; then
|
||||
cp "bin/OpenRA.Mods.D2k.dll" "${TEMPLATE_DIR}/Contents/Resources"
|
||||
IS_D2K="True"
|
||||
fi
|
||||
popd > /dev/null || exit 1
|
||||
|
||||
# Install engine and mod files
|
||||
install_assemblies_mono "${SRCDIR}" "${LAUNCHER_RESOURCES_DIR}" "osx-x64" "True" "True" "${IS_D2K}"
|
||||
install_data "${SRCDIR}" "${LAUNCHER_RESOURCES_DIR}" "${MOD_ID}"
|
||||
set_engine_version "${TAG}" "${LAUNCHER_RESOURCES_DIR}"
|
||||
set_mod_version "${TAG}" "${LAUNCHER_RESOURCES_DIR}/mods/${MOD_ID}/mod.yaml" "${LAUNCHER_RESOURCES_DIR}/mods/modcontent/mod.yaml"
|
||||
|
||||
# Assemble multi-resolution icon
|
||||
mkdir "${MOD_ID}.iconset"
|
||||
@@ -80,19 +88,19 @@ populate_bundle() {
|
||||
cp "${ARTWORK_DIR}/${MOD_ID}_256x256.png" "${MOD_ID}.iconset/icon_256x256.png"
|
||||
cp "${ARTWORK_DIR}/${MOD_ID}_512x512.png" "${MOD_ID}.iconset/icon_256x256@2x.png"
|
||||
cp "${ARTWORK_DIR}/${MOD_ID}_1024x1024.png" "${MOD_ID}.iconset/icon_512x512@2x.png"
|
||||
iconutil --convert icns "${MOD_ID}.iconset" -o "${TEMPLATE_DIR}/Contents/Resources/${MOD_ID}.icns"
|
||||
iconutil --convert icns "${MOD_ID}.iconset" -o "${LAUNCHER_RESOURCES_DIR}/${MOD_ID}.icns"
|
||||
rm -rf "${MOD_ID}.iconset"
|
||||
|
||||
# Copy macOS specific files
|
||||
modify_plist "{MOD_ID}" "${MOD_ID}" "${TEMPLATE_DIR}/Contents/Info.plist"
|
||||
modify_plist "{MOD_NAME}" "${MOD_NAME}" "${TEMPLATE_DIR}/Contents/Info.plist"
|
||||
modify_plist "{JOIN_SERVER_URL_SCHEME}" "openra-${MOD_ID}-${TAG}" "${TEMPLATE_DIR}/Contents/Info.plist"
|
||||
modify_plist "{DISCORD_URL_SCHEME}" "discord-${DISCORD_APPID}" "${TEMPLATE_DIR}/Contents/Info.plist"
|
||||
# Set launcher metadata
|
||||
modify_plist "{MOD_ID}" "${MOD_ID}" "${LAUNCHER_CONTENTS_DIR}/Info.plist"
|
||||
modify_plist "{MOD_NAME}" "${MOD_NAME}" "${LAUNCHER_CONTENTS_DIR}/Info.plist"
|
||||
modify_plist "{JOIN_SERVER_URL_SCHEME}" "openra-${MOD_ID}-${TAG}" "${LAUNCHER_CONTENTS_DIR}/Info.plist"
|
||||
modify_plist "{DISCORD_URL_SCHEME}" "discord-${DISCORD_APPID}" "${LAUNCHER_CONTENTS_DIR}/Info.plist"
|
||||
|
||||
# Sign binaries with developer certificate
|
||||
if [ -n "${MACOS_DEVELOPER_IDENTITY}" ]; then
|
||||
codesign -s "${MACOS_DEVELOPER_IDENTITY}" --timestamp --options runtime -f --entitlements entitlements.plist "${BUILTDIR}/${1}/Contents/Resources/"*.dylib
|
||||
codesign -s "${MACOS_DEVELOPER_IDENTITY}" --timestamp --options runtime -f --entitlements entitlements.plist --deep "${BUILTDIR}/${1}"
|
||||
codesign -s "${MACOS_DEVELOPER_IDENTITY}" --timestamp --options runtime -f --entitlements entitlements.plist "${LAUNCHER_RESOURCES_DIR}/"*.dylib
|
||||
codesign -s "${MACOS_DEVELOPER_IDENTITY}" --timestamp --options runtime -f --entitlements entitlements.plist --deep "${LAUNCHER_DIR}"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -101,47 +109,36 @@ build_platform() {
|
||||
DMG_PATH="${2}"
|
||||
echo "Building launchers (${PLATFORM})"
|
||||
|
||||
mkdir -p "${BUILTDIR}/OpenRA.app/Contents/Resources"
|
||||
mkdir -p "${BUILTDIR}/OpenRA.app/Contents/MacOS"
|
||||
echo "APPL????" > "${BUILTDIR}/OpenRA.app/Contents/PkgInfo"
|
||||
cp Eluant.dll.config "${BUILTDIR}/OpenRA.app/Contents/Resources"
|
||||
cp Info.plist.in "${BUILTDIR}/OpenRA.app/Contents/Info.plist"
|
||||
modify_plist "{DEV_VERSION}" "${TAG}" "${BUILTDIR}/OpenRA.app/Contents/Info.plist"
|
||||
modify_plist "{FAQ_URL}" "http://wiki.openra.net/FAQ" "${BUILTDIR}/OpenRA.app/Contents/Info.plist"
|
||||
# Prepare generic template for the mods to duplicate and customize
|
||||
TEMPLATE_DIR="${BUILTDIR}/template.app"
|
||||
mkdir -p "${TEMPLATE_DIR}/Contents/Resources"
|
||||
mkdir -p "${TEMPLATE_DIR}/Contents/MacOS"
|
||||
echo "APPL????" > "${TEMPLATE_DIR}/Contents/PkgInfo"
|
||||
cp Info.plist.in "${TEMPLATE_DIR}/Contents/Info.plist"
|
||||
modify_plist "{DEV_VERSION}" "${TAG}" "${TEMPLATE_DIR}/Contents/Info.plist"
|
||||
modify_plist "{FAQ_URL}" "http://wiki.openra.net/FAQ" "${TEMPLATE_DIR}/Contents/Info.plist"
|
||||
|
||||
if [ "${PLATFORM}" = "compat" ]; then
|
||||
modify_plist "{MINIMUM_SYSTEM_VERSION}" "10.9" "${BUILTDIR}/OpenRA.app/Contents/Info.plist"
|
||||
clang -m64 launcher-mono.m -o "${BUILTDIR}/OpenRA.app/Contents/MacOS/OpenRA" -framework AppKit -mmacosx-version-min=10.9
|
||||
modify_plist "{MINIMUM_SYSTEM_VERSION}" "10.9" "${TEMPLATE_DIR}/Contents/Info.plist"
|
||||
clang -m64 launcher-mono.m -o "${TEMPLATE_DIR}/Contents/MacOS/OpenRA" -framework AppKit -mmacosx-version-min=10.9
|
||||
else
|
||||
modify_plist "{MINIMUM_SYSTEM_VERSION}" "10.13" "${BUILTDIR}/OpenRA.app/Contents/Info.plist"
|
||||
clang -m64 launcher.m -o "${BUILTDIR}/OpenRA.app/Contents/MacOS/OpenRA" -framework AppKit -mmacosx-version-min=10.13
|
||||
modify_plist "{MINIMUM_SYSTEM_VERSION}" "10.13" "${TEMPLATE_DIR}/Contents/Info.plist"
|
||||
clang -m64 launcher.m -o "${TEMPLATE_DIR}/Contents/MacOS/OpenRA" -framework AppKit -mmacosx-version-min=10.13
|
||||
|
||||
curl -s -L -O https://github.com/OpenRA/OpenRALauncherOSX/releases/download/${MONO_TAG}/mono.zip || exit 3
|
||||
unzip -qq -d "${BUILTDIR}/mono" mono.zip
|
||||
mv "${BUILTDIR}/mono/mono" "${BUILTDIR}/OpenRA.app/Contents/MacOS/"
|
||||
mv "${BUILTDIR}/mono/etc" "${BUILTDIR}/OpenRA.app/Contents/Resources"
|
||||
mv "${BUILTDIR}/mono/lib" "${BUILTDIR}/OpenRA.app/Contents/Resources"
|
||||
mv "${BUILTDIR}/mono/mono" "${TEMPLATE_DIR}/Contents/MacOS/"
|
||||
mv "${BUILTDIR}/mono/etc" "${TEMPLATE_DIR}/Contents/Resources"
|
||||
mv "${BUILTDIR}/mono/lib" "${TEMPLATE_DIR}/Contents/Resources"
|
||||
rm mono.zip
|
||||
rmdir "${BUILTDIR}/mono"
|
||||
fi
|
||||
|
||||
echo "Building core files"
|
||||
build_app "${TEMPLATE_DIR}" "${BUILTDIR}/OpenRA - Red Alert.app" "ra" "Red Alert" "699222659766026240"
|
||||
build_app "${TEMPLATE_DIR}" "${BUILTDIR}/OpenRA - Tiberian Dawn.app" "cnc" "Tiberian Dawn" "699223250181292033"
|
||||
build_app "${TEMPLATE_DIR}" "${BUILTDIR}/OpenRA - Dune 2000.app" "d2k" "Dune 2000" "712711732770111550"
|
||||
|
||||
pushd "${SRCDIR}" > /dev/null || exit 1
|
||||
make clean
|
||||
make core TARGETPLATFORM=osx-x64
|
||||
make version VERSION="${TAG}"
|
||||
|
||||
make install-engine gameinstalldir="/Contents/Resources/" DESTDIR="${BUILTDIR}/OpenRA.app"
|
||||
make install-common-mod-files gameinstalldir="/Contents/Resources/" DESTDIR="${BUILTDIR}/OpenRA.app"
|
||||
make install-dependencies TARGETPLATFORM=osx-x64 gameinstalldir="/Contents/Resources/" DESTDIR="${BUILTDIR}/OpenRA.app"
|
||||
popd > /dev/null || exit 1
|
||||
|
||||
populate_bundle "OpenRA - Red Alert.app" "ra" "Red Alert" "699222659766026240"
|
||||
populate_bundle "OpenRA - Tiberian Dawn.app" "cnc" "Tiberian Dawn" "699223250181292033"
|
||||
populate_bundle "OpenRA - Dune 2000.app" "d2k" "Dune 2000" "712711732770111550"
|
||||
|
||||
rm -rf "${BUILTDIR}/OpenRA.app"
|
||||
rm -rf "${TEMPLATE_DIR}"
|
||||
|
||||
echo "Packaging disk image"
|
||||
hdiutil create "${DMG_PATH}" -format UDRW -volname "OpenRA" -fs HFS+ -srcfolder build
|
||||
@@ -197,7 +194,7 @@ build_platform() {
|
||||
notarize_package() {
|
||||
DMG_PATH="${1}"
|
||||
NOTARIZE_DMG_PATH="${DMG_PATH%.*}"-notarization.dmg
|
||||
echo "Submitting ${PACKAGE_NAME} for notarization"
|
||||
echo "Submitting ${DMG_PATH} for notarization"
|
||||
|
||||
# Reset xcode search path to fix xcrun not finding altool
|
||||
sudo xcode-select -r
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
!include "WordFunc.nsh"
|
||||
|
||||
Name "OpenRA"
|
||||
OutFile "OpenRA.Setup.exe"
|
||||
OutFile "${OUTFILE}"
|
||||
|
||||
ManifestDPIAware true
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
#!/bin/bash
|
||||
# OpenRA packaging script for Windows
|
||||
|
||||
set -e
|
||||
|
||||
command -v curl >/dev/null 2>&1 || { echo >&2 "Windows packaging requires curl."; exit 1; }
|
||||
command -v makensis >/dev/null 2>&1 || { echo >&2 "Windows packaging requires makensis."; exit 1; }
|
||||
@@ -12,6 +15,7 @@ fi
|
||||
|
||||
# Set the working dir to the location of this script
|
||||
cd "$(dirname "$0")" || exit 1
|
||||
. ../functions.sh
|
||||
|
||||
TAG="$1"
|
||||
OUTPUTDIR="$2"
|
||||
@@ -19,7 +23,7 @@ SRCDIR="$(pwd)/../.."
|
||||
BUILTDIR="$(pwd)/build"
|
||||
ARTWORK_DIR="$(pwd)/../artwork/"
|
||||
|
||||
FAQ_URL="http://wiki.openra.net/FAQ"
|
||||
FAQ_URL="https://wiki.openra.net/FAQ"
|
||||
|
||||
SUFFIX=" (dev)"
|
||||
if [[ ${TAG} == release* ]]; then
|
||||
@@ -35,19 +39,8 @@ function makelauncher()
|
||||
MOD_ID="${3}"
|
||||
PLATFORM="${4}"
|
||||
|
||||
# Create multi-resolution icon
|
||||
convert "${ARTWORK_DIR}/${MOD_ID}_16x16.png" "${ARTWORK_DIR}/${MOD_ID}_24x24.png" "${ARTWORK_DIR}/${MOD_ID}_32x32.png" "${ARTWORK_DIR}/${MOD_ID}_48x48.png" "${ARTWORK_DIR}/${MOD_ID}_256x256.png" "${BUILTDIR}/${MOD_ID}.ico"
|
||||
|
||||
# Create mod-specific launcher
|
||||
msbuild -t:Build "${SRCDIR}/OpenRA.WindowsLauncher/OpenRA.WindowsLauncher.csproj" -restore -p:Configuration=Release -p:TargetPlatform="win-${PLATFORM}" -p:LauncherName="${LAUNCHER_NAME}" -p:LauncherIcon="${BUILTDIR}/${MOD_ID}.ico" -p:ModID="${MOD_ID}" -p:DisplayName="${DISPLAY_NAME}" -p:FaqUrl="${FAQ_URL}"
|
||||
cp "${SRCDIR}/bin/${LAUNCHER_NAME}.exe" "${BUILTDIR}"
|
||||
cp "${SRCDIR}/bin/${LAUNCHER_NAME}.exe.config" "${BUILTDIR}"
|
||||
|
||||
# Enable the full 4GB address space for the 32 bit game executable
|
||||
# The server and utility do not use enough memory to need this
|
||||
if [ "${PLATFORM}" = "x86" ]; then
|
||||
python3 MakeLAA.py "${BUILTDIR}/${LAUNCHER_NAME}.exe"
|
||||
fi
|
||||
install_windows_launcher "${SRCDIR}" "${BUILTDIR}" "win-${PLATFORM}" "${MOD_ID}" "${LAUNCHER_NAME}" "${DISPLAY_NAME}" "${BUILTDIR}/${MOD_ID}.ico" "${FAQ_URL}"
|
||||
}
|
||||
|
||||
function build_platform()
|
||||
@@ -55,37 +48,24 @@ function build_platform()
|
||||
PLATFORM="${1}"
|
||||
|
||||
echo "Building core files (${PLATFORM})"
|
||||
if [ "${PLATFORM}" = "win-x86" ]; then
|
||||
if [ "${PLATFORM}" = "x86" ]; then
|
||||
USE_PROGRAMFILES32="-DUSE_PROGRAMFILES32=true"
|
||||
else
|
||||
USE_PROGRAMFILES32=""
|
||||
fi
|
||||
|
||||
pushd "${SRCDIR}" > /dev/null || exit 1
|
||||
make clean
|
||||
make core TARGETPLATFORM="win-${PLATFORM}"
|
||||
make version VERSION="${TAG}"
|
||||
make install-engine TARGETPLATFORM="win-${PLATFORM}" gameinstalldir="" DESTDIR="${BUILTDIR}"
|
||||
make install-common-mod-files gameinstalldir="" DESTDIR="${BUILTDIR}"
|
||||
make install-default-mods gameinstalldir="" DESTDIR="${BUILTDIR}"
|
||||
make install-dependencies TARGETPLATFORM="win-${PLATFORM}" gameinstalldir="" DESTDIR="${BUILTDIR}"
|
||||
popd > /dev/null || exit 1
|
||||
install_assemblies_mono "${SRCDIR}" "${BUILTDIR}" "win-${PLATFORM}" "False" "True" "True"
|
||||
install_data "${SRCDIR}" "${BUILTDIR}" "cnc" "d2k" "ra"
|
||||
set_engine_version "${TAG}" "${BUILTDIR}"
|
||||
set_mod_version "${TAG}" "${BUILTDIR}/mods/cnc/mod.yaml" "${BUILTDIR}/mods/d2k/mod.yaml" "${BUILTDIR}/mods/ra/mod.yaml" "${BUILTDIR}/mods/modcontent/mod.yaml"
|
||||
|
||||
echo "Compiling Windows launchers (${PLATFORM})"
|
||||
makelauncher "RedAlert" "Red Alert" "ra" ${PLATFORM}
|
||||
makelauncher "TiberianDawn" "Tiberian Dawn" "cnc" ${PLATFORM}
|
||||
makelauncher "Dune2000" "Dune 2000" "d2k" ${PLATFORM}
|
||||
|
||||
# Remove redundant generic launcher
|
||||
rm "${BUILTDIR}/OpenRA.exe"
|
||||
makelauncher "RedAlert" "Red Alert" "ra" "${PLATFORM}"
|
||||
makelauncher "TiberianDawn" "Tiberian Dawn" "cnc" "${PLATFORM}"
|
||||
makelauncher "Dune2000" "Dune 2000" "d2k" "${PLATFORM}"
|
||||
|
||||
echo "Building Windows setup.exe ($1)"
|
||||
makensis -V2 -DSRCDIR="${BUILTDIR}" -DTAG="${TAG}" -DSUFFIX="${SUFFIX}" ${USE_PROGRAMFILES32} OpenRA.nsi
|
||||
if [ $? -eq 0 ]; then
|
||||
mv OpenRA.Setup.exe "${OUTPUTDIR}/OpenRA-${TAG}-${PLATFORM}.exe"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
makensis -V2 -DSRCDIR="${BUILTDIR}" -DTAG="${TAG}" -DSUFFIX="${SUFFIX}" -DOUTFILE="${OUTPUTDIR}/OpenRA-${TAG}-${PLATFORM}.exe" ${USE_PROGRAMFILES32} OpenRA.nsi || exit 1
|
||||
|
||||
echo "Packaging zip archive ($1)"
|
||||
pushd "${BUILTDIR}" > /dev/null
|
||||
|
||||
Reference in New Issue
Block a user