From 5b1d7a45d7f34faf0ab50f0ab4c850da693c7aee Mon Sep 17 00:00:00 2001 From: d10sfan <4337981+d10sfan@users.noreply.github.com> Date: Sun, 5 Nov 2023 21:30:00 -0600 Subject: [PATCH] Add Eternity Engine (#1012) --- engines/eternity/LICENSE | 17 +++++ engines/eternity/assets/master.csc | 1 + engines/eternity/assets/run-eternity.sh | 15 ++++ engines/eternity/build.sh | 32 ++++++++ engines/eternity/env.sh | 6 ++ engines/eternity/vcpkg.json | 7 ++ metadata/packagessniper_v2.json | 97 ++++++++++++++++++++++++- 7 files changed, 174 insertions(+), 1 deletion(-) create mode 100644 engines/eternity/LICENSE create mode 100644 engines/eternity/assets/master.csc create mode 100755 engines/eternity/assets/run-eternity.sh create mode 100755 engines/eternity/build.sh create mode 100755 engines/eternity/env.sh create mode 100644 engines/eternity/vcpkg.json diff --git a/engines/eternity/LICENSE b/engines/eternity/LICENSE new file mode 100644 index 000000000..77167d906 --- /dev/null +++ b/engines/eternity/LICENSE @@ -0,0 +1,17 @@ +Copyright (c) 2019 Patryk Obara + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. diff --git a/engines/eternity/assets/master.csc b/engines/eternity/assets/master.csc new file mode 100644 index 000000000..68ceebd6d --- /dev/null +++ b/engines/eternity/assets/master.csc @@ -0,0 +1 @@ +master_levels_dir "../masterbase/master/wads/" diff --git a/engines/eternity/assets/run-eternity.sh b/engines/eternity/assets/run-eternity.sh new file mode 100755 index 000000000..89ca3e27a --- /dev/null +++ b/engines/eternity/assets/run-eternity.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +if [[ -z "${SDL_SOUNDFONTS}" ]]; then + echo "Setting default soundfont" + export SDL_SOUNDFONTS="fluid-soundfont-3.1/FluidR3_GM.sf2" +fi + + +cd eternity + +# workaround for libopengl +mkdir lib +cp /overrides/lib/x86_64-linux-gnu/libXext.so.6 lib/libOpenGL.so.0 + +LD_LIBRARY_PATH="lib:$LD_LIBRARY_PATH" ./eternity "$@" diff --git a/engines/eternity/build.sh b/engines/eternity/build.sh new file mode 100755 index 000000000..b7dc614c9 --- /dev/null +++ b/engines/eternity/build.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +export pfx="$PWD/local" +mkdir -p "$pfx" + +export LDFLAGS=-L"$VCPKG_INSTALLED_PATH/lib" +export LIBRARY_PATH="$VCPKG_INSTALLED_PATH/lib;$pfx/lib" + +# From https://gitlab.com/luxtorpeda/packages/gzdoom - See LICENSE file for more information +# CLONE PHASE +git clone https://github.com/team-eternity/eternity.git source +pushd source +git checkout d699a7d +git submodule update --init +popd + +# BUILD PHASE +pushd "source" +mkdir -p build +cd build +cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_PREFIX_PATH="$pfx;$VCPKG_INSTALLED_PATH" \ + .. +make -j "$(nproc)" +make install DESTDIR="$pfx" +popd + +# COPY PHASE +cp -rfv "$pfx/usr/local/bin"/* "$diststart/common/dist/" +cp -rfv "$pfx/usr/local/share/eternity/base" "$diststart/common/dist/" +cp -rfv assets/* "$diststart/common/dist/" diff --git a/engines/eternity/env.sh b/engines/eternity/env.sh new file mode 100755 index 000000000..9bdd78e1c --- /dev/null +++ b/engines/eternity/env.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +export STEAM_APP_ID_LIST="2300 2280" +export LICENSE_PATH="./source/COPYING" +export ADDITIONAL_LICENSES="./LICENSE" +export COMMON_PACKAGE="1" diff --git a/engines/eternity/vcpkg.json b/engines/eternity/vcpkg.json new file mode 100644 index 000000000..69f911d2d --- /dev/null +++ b/engines/eternity/vcpkg.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", + "dependencies": [ + { "name": "fluidsynth", "features": ["pulseaudio"] }, + { "name": "sdl2-mixer", "features": ["fluidsynth"] } + ] +} diff --git a/metadata/packagessniper_v2.json b/metadata/packagessniper_v2.json index f639de57b..824415c2b 100644 --- a/metadata/packagessniper_v2.json +++ b/metadata/packagessniper_v2.json @@ -563,6 +563,29 @@ "download_name": "fluid-soundfont" } ] + }, + { + "name": "Eternity Engine", + "engine_name": "Eternity Engine", + "command": "./eternity/run-eternity.sh", + "command_args": [ + "-iwad", + "../base/DOOM.WAD" + ], + "download": [ + "eternity", + "fluid-soundfont" + ], + "download_config": [ + { + "extract_location": "./eternity", + "download_name": "eternity" + }, + { + "extract_location": "./eternity", + "download_name": "fluid-soundfont" + } + ] }, { "name": "Odamex", @@ -1700,6 +1723,68 @@ } ] }, + { + "name": "Eternity Engine", + "commands": [ + { + "cmd": "./eternity/run-eternity.sh", + "args": [ + "-iwad", + "../base/DOOM2.WAD" + ], + "command_name": ".*rerelease" + }, + { + "cmd": "./eternity/run-eternity.sh", + "args": [ + "-iwad", + "../base/DOOM2.WAD" + ], + "command_name": ".*doom2" + }, + { + "cmd": "./eternity/run-eternity.sh", + "args": [ + "-iwad", + "../finaldoombase/TNT.WAD" + ], + "command_name": ".*tnt" + }, + { + "cmd": "./eternity/run-eternity.sh", + "args": [ + "-iwad", + "../finaldoombase/PLUTONIA.WAD" + ], + "command_name": ".*plutonia" + }, + { + "cmd": "./eternity/run-eternity.sh", + "args": [ + "-iwad", + "../masterbase/doom2/DOOM2.WAD", + "-vanilla", + "-exec", + "master.csc" + ], + "command_name": ".*master" + } + ], + "download": [ + "eternity", + "fluid-soundfont" + ], + "download_config": [ + { + "extract_location": "./eternity", + "download_name": "eternity" + }, + { + "extract_location": "./eternity", + "download_name": "fluid-soundfont" + } + ] + }, { "name": "Odamex", "commands": [ @@ -8096,6 +8181,16 @@ "controllerSupportedManualGame": true, "engine_name": "Chocolate Doom" }, + { + "engine_link": "https://github.com/team-eternity/eternity", + "version": "d699a7d", + "author": "d10sfan", + "author_link": "https://github.com/d10sfan", + "license": "GPLv3", + "license_link": "https://github.com/team-eternity/eternity/blob/master/COPYING", + "controllerSupportedManualGame": true, + "engine_name": "Eternity Engine" + }, { "engine_link": "https://github.com/fabiangreffrath/crispy-doom", "version": "6.0", @@ -9791,4 +9886,4 @@ "value": "Supports steam achivements." } ] -} \ No newline at end of file +}