aboutsummaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2021-10-09 17:20:15 -0400
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2021-10-13 00:52:40 +0700
commit538fc0eeb2c0a81d01ca433c94736dc8f1a04087 (patch)
tree56087cb933502eeac05597ea19f6755b0a54faad /games
parentf32fbf57374c73daa33900f17f97fdfee2120c36 (diff)
games/gzdoom-legacy: Fix -current build.
Signed-off-by: B. Watson <yalhcru@gmail.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'games')
-rw-r--r--games/gzdoom-legacy/README2
-rw-r--r--games/gzdoom-legacy/README_versions.txt3
-rw-r--r--games/gzdoom-legacy/compilefix.1.8.09.diff143
-rw-r--r--games/gzdoom-legacy/compilefix.1.9.1.diff12
-rw-r--r--games/gzdoom-legacy/compilefix.2.4.0.diff23
-rw-r--r--games/gzdoom-legacy/gzdoom-legacy.SlackBuild9
-rw-r--r--games/gzdoom-legacy/slack-desc2
7 files changed, 185 insertions, 9 deletions
diff --git a/games/gzdoom-legacy/README b/games/gzdoom-legacy/README
index f3f8386df7609..1c3496f600b96 100644
--- a/games/gzdoom-legacy/README
+++ b/games/gzdoom-legacy/README
@@ -1,3 +1,5 @@
+gzdoom-legacy (OpenGL port of DOOM, older version)
+
Enhanced OpenGL port of the official DOOM source code that also supports
Heretic, Hexen, and Strife.
diff --git a/games/gzdoom-legacy/README_versions.txt b/games/gzdoom-legacy/README_versions.txt
index bd7e56e233d2c..3676c68eb9350 100644
--- a/games/gzdoom-legacy/README_versions.txt
+++ b/games/gzdoom-legacy/README_versions.txt
@@ -18,9 +18,6 @@ VERSION="1.8.09"
DOWNLOAD="https://slackware.uk/~urchlay/src/g1.8.09.tar.gz"
MD5SUM="ddc1dd8aef254312031184be6dec21e6"
-Note that SDL2 is not required for 1.8.09 (you can remove it from REQUIRES
-in the .info file, if you like).
-
For 1.9.1:
VERSION="1.9.1"
diff --git a/games/gzdoom-legacy/compilefix.1.8.09.diff b/games/gzdoom-legacy/compilefix.1.8.09.diff
new file mode 100644
index 0000000000000..ac9d89d3633be
--- /dev/null
+++ b/games/gzdoom-legacy/compilefix.1.8.09.diff
@@ -0,0 +1,143 @@
+diff -Naur gzdoom-g1.8.09/game-music-emu/CMakeLists.txt gzdoom-g1.8.09.patched/game-music-emu/CMakeLists.txt
+--- gzdoom-g1.8.09/game-music-emu/CMakeLists.txt 2014-12-21 09:18:40.000000000 -0500
++++ gzdoom-g1.8.09.patched/game-music-emu/CMakeLists.txt 2021-10-09 16:57:46.630159506 -0400
+@@ -84,7 +84,7 @@
+ if (__LIBGME_TEST_VISIBILITY)
+ # get the gcc version
+ exec_program(${CMAKE_CXX_COMPILER} ARGS --version OUTPUT_VARIABLE _gcc_version_info)
+- string (REGEX MATCH "[3-9]\\.[0-9]\\.[0-9]" _gcc_version "${_gcc_version_info}")
++ string (REGEX MATCH "[1-9][0-9]*\\.[0-9]\\.[0-9]" _gcc_version "${_gcc_version_info}")
+
+ # gcc <4.1 had poor support for symbol visibility
+ if ((${_gcc_version} VERSION_GREATER "4.1") OR (${_gcc_version} VERSION_EQUAL "4.1"))
+diff -Naur gzdoom-g1.8.09/src/b_func.cpp gzdoom-g1.8.09.patched/src/b_func.cpp
+--- gzdoom-g1.8.09/src/b_func.cpp 2014-12-21 09:18:40.000000000 -0500
++++ gzdoom-g1.8.09.patched/src/b_func.cpp 2021-10-09 16:57:46.631159506 -0400
+@@ -123,7 +123,7 @@
+ if (vangle == 0)
+ return false; //Looker seems to be blind.
+
+- return (angle_t)abs (R_PointToAngle2 (player->mo->x, player->mo->y, to->x, to->y) - player->mo->angle) <= vangle/2;
++ return (angle_t)fabs (R_PointToAngle2 (player->mo->x, player->mo->y, to->x, to->y) - player->mo->angle) <= vangle/2;
+ }
+
+ //-------------------------------------
+@@ -210,7 +210,7 @@
+ {
+ angle = an;
+ //have to be somewhat precise. to avoid suicide.
+- if (abs (angle - player->mo->angle) < 12*ANGLE_1)
++ if (fabs (angle - player->mo->angle) < 12*ANGLE_1)
+ {
+ t_rocket = 9;
+ no_fire = false;
+@@ -252,7 +252,7 @@
+ angle -= m;
+ }
+
+- if (abs (angle - player->mo->angle) < 4*ANGLE_1)
++ if (fabs (angle - player->mo->angle) < 4*ANGLE_1)
+ {
+ increase = !increase;
+ }
+diff -Naur gzdoom-g1.8.09/src/g_hexen/a_dragon.cpp gzdoom-g1.8.09.patched/src/g_hexen/a_dragon.cpp
+--- gzdoom-g1.8.09/src/g_hexen/a_dragon.cpp 2014-12-21 09:18:40.000000000 -0500
++++ gzdoom-g1.8.09.patched/src/g_hexen/a_dragon.cpp 2021-10-09 17:06:47.628110327 -0400
+@@ -79,7 +79,7 @@
+ { // attack the destination mobj if it's attackable
+ AActor *oldTarget;
+
+- if (abs(actor->angle-R_PointToAngle2(actor->x, actor->y,
++ if (fabs(actor->angle-R_PointToAngle2(actor->x, actor->y,
+ target->x, target->y)) < ANGLE_45/2)
+ {
+ oldTarget = actor->target;
+@@ -121,9 +121,9 @@
+ }
+ angleToSpot = R_PointToAngle2(actor->x, actor->y,
+ mo->x, mo->y);
+- if ((angle_t)abs(angleToSpot-angleToTarget) < bestAngle)
++ if ((angle_t)fabs(angleToSpot-angleToTarget) < bestAngle)
+ {
+- bestAngle = abs(angleToSpot-angleToTarget);
++ bestAngle = fabs(angleToSpot-angleToTarget);
+ bestActor = mo;
+ }
+ }
+@@ -198,14 +198,14 @@
+ }
+ angle = R_PointToAngle2(self->x, self->y, self->target->x,
+ self->target->y);
+- if (abs(self->angle-angle) < ANGLE_45/2 && self->CheckMeleeRange())
++ if (fabs(self->angle-angle) < ANGLE_45/2 && self->CheckMeleeRange())
+ {
+ int damage = pr_dragonflight.HitDice (8);
+ int newdam = P_DamageMobj (self->target, self, self, damage, NAME_Melee);
+ P_TraceBleed (newdam > 0 ? newdam : damage, self->target, self);
+ S_Sound (self, CHAN_WEAPON, self->AttackSound, 1, ATTN_NORM);
+ }
+- else if (abs(self->angle-angle) <= ANGLE_1*20)
++ else if (fabs(self->angle-angle) <= ANGLE_1*20)
+ {
+ self->SetState (self->MissileState);
+ S_Sound (self, CHAN_WEAPON, self->AttackSound, 1, ATTN_NORM);
+diff -Naur gzdoom-g1.8.09/src/g_hexen/a_heresiarch.cpp gzdoom-g1.8.09.patched/src/g_hexen/a_heresiarch.cpp
+--- gzdoom-g1.8.09/src/g_hexen/a_heresiarch.cpp 2014-12-21 09:18:40.000000000 -0500
++++ gzdoom-g1.8.09.patched/src/g_hexen/a_heresiarch.cpp 2021-10-09 17:06:55.063109651 -0400
+@@ -314,7 +314,7 @@
+ case SORC_STOPPING: // Balls stopping
+ if ((parent->StopBall == RUNTIME_TYPE(actor)) &&
+ (parent->args[1] > SORCBALL_SPEED_ROTATIONS) &&
+- (abs(angle - (parent->angle>>ANGLETOFINESHIFT)) < (30<<5)))
++ (fabs(angle - (parent->angle>>ANGLETOFINESHIFT)) < (30<<5)))
+ {
+ // Can stop now
+ actor->target->args[3] = SORC_FIRESPELL;
+diff -Naur gzdoom-g1.8.09/src/g_hexen/a_hexenspecialdecs.cpp gzdoom-g1.8.09.patched/src/g_hexen/a_hexenspecialdecs.cpp
+--- gzdoom-g1.8.09/src/g_hexen/a_hexenspecialdecs.cpp 2014-12-21 09:18:40.000000000 -0500
++++ gzdoom-g1.8.09.patched/src/g_hexen/a_hexenspecialdecs.cpp 2021-10-09 17:07:05.703108684 -0400
+@@ -109,7 +109,7 @@
+ if (playeringame[i])
+ {
+ AActor *pmo = players[i].mo;
+- if (P_CheckSight (self, pmo) && (abs (R_PointToAngle2 (pmo->x,
++ if (P_CheckSight (self, pmo) && (fabs (R_PointToAngle2 (pmo->x,
+ pmo->y, self->x, self->y) - pmo->angle) <= ANGLE_45))
+ { // Previous state (pottery bit waiting state)
+ self->SetState (self->state - 1);
+diff -Naur gzdoom-g1.8.09/src/p_enemy.cpp gzdoom-g1.8.09.patched/src/p_enemy.cpp
+--- gzdoom-g1.8.09/src/p_enemy.cpp 2014-12-21 09:18:40.000000000 -0500
++++ gzdoom-g1.8.09.patched/src/p_enemy.cpp 2021-10-09 16:57:46.631159506 -0400
+@@ -2738,7 +2738,7 @@
+
+ // 0 means no limit. Also, if we turn in a single step anyways, no need to go through the algorithms.
+ // It also means that there is no need to check for going past the other.
+- if (max_turn && (max_turn < (angle_t)abs(self->angle - other_angle)))
++ if (max_turn && (max_turn < (angle_t)fabs(self->angle - other_angle)))
+ {
+ if (self->angle > other_angle)
+ {
+diff -Naur gzdoom-g1.8.09/src/p_mobj.cpp gzdoom-g1.8.09.patched/src/p_mobj.cpp
+--- gzdoom-g1.8.09/src/p_mobj.cpp 2014-12-21 09:18:40.000000000 -0500
++++ gzdoom-g1.8.09.patched/src/p_mobj.cpp 2021-10-09 16:59:08.847152032 -0400
+@@ -2932,7 +2932,7 @@
+ if (thing->flags4&MF4_SHIELDREFLECT)
+ {
+ // Shield reflection (from the Centaur
+- if (abs (angle - thing->angle)>>24 > 45)
++ if ((int)(fabs (angle - thing->angle))>>24 > 45)
+ return true; // Let missile explode
+
+ if (thing->IsKindOf (RUNTIME_CLASS(AHolySpirit))) // shouldn't this be handled by another flag???
+diff -Naur gzdoom-g1.8.09/src/p_setup.cpp gzdoom-g1.8.09.patched/src/p_setup.cpp
+--- gzdoom-g1.8.09/src/p_setup.cpp 2014-12-21 09:18:40.000000000 -0500
++++ gzdoom-g1.8.09.patched/src/p_setup.cpp 2021-10-09 17:02:30.783133675 -0400
+@@ -1311,7 +1311,7 @@
+
+ ptp_angle = R_PointToAngle2 (li->v1->x, li->v1->y, li->v2->x, li->v2->y);
+ dis = 0;
+- delta_angle = (abs(ptp_angle-(segangle<<16))>>ANGLETOFINESHIFT)*360/FINEANGLES;
++ delta_angle = ((int)fabs(ptp_angle-(segangle<<16))>>ANGLETOFINESHIFT)*360/FINEANGLES;
+
+ if (delta_angle != 0)
+ {
diff --git a/games/gzdoom-legacy/compilefix.1.9.1.diff b/games/gzdoom-legacy/compilefix.1.9.1.diff
new file mode 100644
index 0000000000000..129886b3ea172
--- /dev/null
+++ b/games/gzdoom-legacy/compilefix.1.9.1.diff
@@ -0,0 +1,12 @@
+diff -Naur gzdoom-g1.9.1/game-music-emu/CMakeLists.txt gzdoom-g1.9.1.patched/game-music-emu/CMakeLists.txt
+--- gzdoom-g1.9.1/game-music-emu/CMakeLists.txt 2016-02-23 05:34:50.000000000 -0500
++++ gzdoom-g1.9.1.patched/game-music-emu/CMakeLists.txt 2021-10-09 15:42:40.090569168 -0400
+@@ -84,7 +84,7 @@
+ if (__LIBGME_TEST_VISIBILITY)
+ # get the gcc version
+ exec_program(${CMAKE_CXX_COMPILER} ARGS --version OUTPUT_VARIABLE _gcc_version_info)
+- string (REGEX MATCH "[3-9]\\.[0-9]\\.[0-9]" _gcc_version "${_gcc_version_info}")
++ string (REGEX MATCH "[1-9][0-9]*\\.[0-9]\\.[0-9]" _gcc_version "${_gcc_version_info}")
+
+ # gcc <4.1 had poor support for symbol visibility
+ if ((${_gcc_version} VERSION_GREATER "4.1") OR (${_gcc_version} VERSION_EQUAL "4.1"))
diff --git a/games/gzdoom-legacy/compilefix.2.4.0.diff b/games/gzdoom-legacy/compilefix.2.4.0.diff
new file mode 100644
index 0000000000000..15aff4b37b825
--- /dev/null
+++ b/games/gzdoom-legacy/compilefix.2.4.0.diff
@@ -0,0 +1,23 @@
+diff -Naur gzdoom-g2.4.0/game-music-emu/CMakeLists.txt gzdoom-g2.4.0.patched/game-music-emu/CMakeLists.txt
+--- gzdoom-g2.4.0/game-music-emu/CMakeLists.txt 2017-03-19 16:37:06.000000000 -0400
++++ gzdoom-g2.4.0.patched/game-music-emu/CMakeLists.txt 2021-10-09 14:02:12.973117056 -0400
+@@ -89,7 +89,7 @@
+ if (__LIBGME_TEST_VISIBILITY)
+ # get the gcc version
+ exec_program(${CMAKE_CXX_COMPILER} ARGS --version OUTPUT_VARIABLE _gcc_version_info)
+- string (REGEX MATCH "[3-9]\\.[0-9]\\.[0-9]" _gcc_version "${_gcc_version_info}")
++ string (REGEX MATCH "[1-9][0-9]*\\.[0-9]\\.[0-9]" _gcc_version "${_gcc_version_info}")
+
+ # gcc <4.1 had poor support for symbol visibility
+ if ((${_gcc_version} VERSION_GREATER "4.1") OR (${_gcc_version} VERSION_EQUAL "4.1"))
+diff -Naur gzdoom-g2.4.0/src/sound/oalsound.cpp gzdoom-g2.4.0.patched/src/sound/oalsound.cpp
+--- gzdoom-g2.4.0/src/sound/oalsound.cpp 2017-03-19 16:37:06.000000000 -0400
++++ gzdoom-g2.4.0.patched/src/sound/oalsound.cpp 2021-10-09 13:59:39.997130962 -0400
+@@ -40,6 +40,7 @@
+ #include <dlfcn.h>
+ #endif
+
++#include <functional>
+ #include <memory>
+ #include <chrono>
+
diff --git a/games/gzdoom-legacy/gzdoom-legacy.SlackBuild b/games/gzdoom-legacy/gzdoom-legacy.SlackBuild
index 6087eb7917c5b..d2ab9ef85a5c5 100644
--- a/games/gzdoom-legacy/gzdoom-legacy.SlackBuild
+++ b/games/gzdoom-legacy/gzdoom-legacy.SlackBuild
@@ -6,6 +6,7 @@
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+# 20211009 bkw: BUILD=3, fix build on -current.
# 20200426 bkw:
# - Fix <unknown version> in window title for real this time, BUILD=2.
@@ -38,7 +39,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=gzdoom-legacy
SRCNAM=gzdoom
VERSION=${VERSION:-2.4.0}
-BUILD=${BUILD:-2}
+BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -50,9 +51,6 @@ if [ -z "$ARCH" ]; then
esac
fi
-# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
-# the name of the created package would be, and then exit. This information
-# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
@@ -107,7 +105,8 @@ patch -p1 < $CWD/window_title_version.diff
# title will read 1.8.08 for version 1.8.09, eg.
sed -i "/#define *VERSIONSTR/s,[^ ]*$,\"$VERSION\"," src/version.h
-# This isn't currently used, but was in the past, and will be again I'm sure.
+# Version-specific patches. As of 2021, it's unlikely any old versions
+# of gzdoom will build without patching.
[ -e $CWD/compilefix.$VERSION.diff ] && \
patch -p1 < $CWD/compilefix.$VERSION.diff
diff --git a/games/gzdoom-legacy/slack-desc b/games/gzdoom-legacy/slack-desc
index 18c19805b0591..518ebe6f7ba79 100644
--- a/games/gzdoom-legacy/slack-desc
+++ b/games/gzdoom-legacy/slack-desc
@@ -6,7 +6,7 @@
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
-gzdoom-legacy: gzdoom-legacy (OpenGL port of DOOM)
+gzdoom-legacy: gzdoom-legacy (OpenGL port of DOOM, older version)
gzdoom-legacy:
gzdoom-legacy: Enhanced OpenGL port of the official DOOM source code that also
gzdoom-legacy: supports Heretic, Hexen, and Strife.