Update QuakeSpasm to 0.96.0 github release (#9537)

This commit is contained in:
erysdren
2023-09-29 03:34:44 -05:00
committed by GitHub
parent b8c6ec3538
commit dd83406b82
2 changed files with 4 additions and 196 deletions

View File

@@ -1,190 +0,0 @@
From 77b165e3088b42842a0119cb919908e86ab6127f Mon Sep 17 00:00:00 2001
From: Jaycie Ewald <jaycie.ewald@outlook.com>
Date: Sat, 3 Jun 2023 10:43:28 -0500
Subject: Haiku support.
Changes already submitted upstream.
---
Quake/Makefile | 23 +++++++++++++++--------
Quake/build_cross_haiku32-sdl2.sh | 2 +-
Quake/build_cross_haiku64-sdl2.sh | 2 +-
Quake/common.c | 23 +++++++++++++++++++++++
Quake/sys_sdl_unix.c | 21 +++++++++++++++++++++
5 files changed, 61 insertions(+), 10 deletions(-)
diff --git a/Quake/Makefile b/Quake/Makefile
index beea5e1..91141a0 100644
--- a/Quake/Makefile
+++ b/Quake/Makefile
@@ -10,9 +10,6 @@ DO_USERDIRS=0
### Enable/Disable SDL2
USE_SDL2=0
-### Do we need to link the math library?
-LINK_M=1
-
### Enable/Disable codecs for streaming music support
USE_CODEC_WAVE=1
USE_CODEC_FLAC=0
@@ -38,7 +35,7 @@ check_gcc = $(shell if echo | $(CC) $(1) -Werror -S -o /dev/null -xc - > /dev/nu
# ---------------------------
-HOST_OS := $(shell uname|sed -e s/_.*//|tr '[:upper:]' '[:lower:]')
+HOST_OS ?= $(shell uname|sed -e s/_.*//|tr '[:upper:]' '[:lower:]')
DEBUG ?= 0
@@ -112,7 +109,7 @@ SDL_LIBS := $(shell $(SDL_CONFIG) --libs)
ifeq ($(HOST_OS),sunos)
NET_LIBS :=-lsocket -lnsl -lresolv
-else ifdef HAIKU_OS
+else ifeq ($(HOST_OS),haiku)
NET_LIBS :=-lnetwork
else
NET_LIBS :=
@@ -185,10 +182,10 @@ ifeq ($(USE_CODEC_UMX),1)
CFLAGS+= -DUSE_CODEC_UMX
endif
+ifeq ($(HOST_OS),haiku)
COMMON_LIBS:= -lGL
-
-ifeq ($(LINK_M),1)
-COMMON_LIBS += -lm
+else
+COMMON_LIBS:= -lGL -lm
endif
LIBS := $(COMMON_LIBS) $(NET_LIBS) $(CODECLIBS)
@@ -305,7 +302,17 @@ debug:
clean:
$(RM) *.o *.d $(DEFAULT_TARGET)
+ifeq ($(HOST_OS),haiku)
+QS_DATA_DIR=$(shell finddir B_USER_NONPACKAGED_DATA_DIRECTORY)/QuakeSpasm/
+QS_APP_DIR=$(shell finddir B_APPS_DIRECTORY)/QuakeSpasm/
+install: quakespasm
+ mkdir -p $(QS_APP_DIR)
+ mkdir -p $(QS_DATA_DIR)
+ cp quakespasm $(QS_APP_DIR)
+ cp quakespasm.pak $(QS_DATA_DIR)
+else
install: quakespasm
cp quakespasm /usr/local/games/quake
+endif
sinclude $(OBJS:.o=.d)
diff --git a/Quake/build_cross_haiku32-sdl2.sh b/Quake/build_cross_haiku32-sdl2.sh
index b180335..d6c5e55 100755
--- a/Quake/build_cross_haiku32-sdl2.sh
+++ b/Quake/build_cross_haiku32-sdl2.sh
@@ -14,4 +14,4 @@ STRIP="$TARGET-strip"
LDFLAGS=-L/usr/lib32 # hack
export CC AS AR RANLIB STRIP LDFLAGS
-exec $MAKE_CMD HAIKU_OS=1 LINK_M=0 USE_SDL2=1 LDFLAGS=$LDFLAGS CC=$CC AS=$AS RANLIB=$RANLIB AR=$AR STRIP=$STRIP -f Makefile $*
+exec $MAKE_CMD HOST_OS=haiku USE_SDL2=1 LDFLAGS=$LDFLAGS CC=$CC AS=$AS RANLIB=$RANLIB AR=$AR STRIP=$STRIP -f Makefile $*
diff --git a/Quake/build_cross_haiku64-sdl2.sh b/Quake/build_cross_haiku64-sdl2.sh
index 0b43404..8090528 100755
--- a/Quake/build_cross_haiku64-sdl2.sh
+++ b/Quake/build_cross_haiku64-sdl2.sh
@@ -13,4 +13,4 @@ AR="$TARGET-ar"
STRIP="$TARGET-strip"
export CC AS AR RANLIB STRIP
-exec $MAKE_CMD HAIKU_OS=1 LINK_M=0 USE_SDL2=1 CC=$CC AS=$AS RANLIB=$RANLIB AR=$AR STRIP=$STRIP -f Makefile $*
+exec $MAKE_CMD HOST_OS=haiku USE_SDL2=1 CC=$CC AS=$AS RANLIB=$RANLIB AR=$AR STRIP=$STRIP -f Makefile $*
diff --git a/Quake/common.c b/Quake/common.c
index c604a0a..931f971 100644
--- a/Quake/common.c
+++ b/Quake/common.c
@@ -28,6 +28,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "miniz.h"
+#include "arch_def.h"
+#ifdef PLATFORM_HAIKU
+#include <FindDirectory.h>
+#include <fs_info.h>
+#endif
+
static char *largv[MAX_NUM_ARGVS + 1];
static char argvdummy[] = " ";
@@ -2052,11 +2058,28 @@ _add_path:
if (i != 0 || path_id != 1 || fitzmode)
qspak = NULL;
else {
+ #ifdef PLATFORM_HAIKU
+ qboolean old = com_modified;
+ dev_t volume = dev_for_path("/boot");
+ char buffer[B_PATH_NAME_LENGTH];
+ status_t result;
+
+ result = find_directory(B_SYSTEM_DATA_DIRECTORY, volume, false, buffer, sizeof(buffer));
+ if (result != B_OK)
+ Sys_Error ("Couldn't determine userspace directory");
+
+ q_snprintf (pakfile, sizeof(pakfile), "%s/QuakeSpasm/quakespasm.pak", buffer);
+
+ qspak = COM_LoadPackFile (pakfile);
+
+ com_modified = old;
+ #else
qboolean old = com_modified;
if (been_here) base = host_parms->userdir;
q_snprintf (pakfile, sizeof(pakfile), "%s/quakespasm.pak", base);
qspak = COM_LoadPackFile (pakfile);
com_modified = old;
+ #endif
}
if (pak) {
search = (searchpath_t *) Z_Malloc(sizeof(searchpath_t));
diff --git a/Quake/sys_sdl_unix.c b/Quake/sys_sdl_unix.c
index 71c8595..ab683ca 100644
--- a/Quake/sys_sdl_unix.c
+++ b/Quake/sys_sdl_unix.c
@@ -244,10 +244,30 @@ static char cwd[MAX_OSPATH];
static char userdir[MAX_OSPATH];
#ifdef PLATFORM_OSX
#define SYS_USERDIR "Library/Application Support/QuakeSpasm"
+#elif defined(PLATFORM_HAIKU)
+#define SYS_USERDIR "QuakeSpasm"
#else
#define SYS_USERDIR ".quakespasm"
#endif
+#ifdef PLATFORM_HAIKU
+
+#include <FindDirectory.h>
+#include <fs_info.h>
+
+static void Sys_GetUserdir (char *dst, size_t dstsize)
+{
+ dev_t volume = dev_for_path("/boot");
+ char buffer[B_PATH_NAME_LENGTH];
+ status_t result;
+
+ result = find_directory(B_USER_NONPACKAGED_DATA_DIRECTORY, volume, false, buffer, sizeof(buffer));
+ if (result != B_OK)
+ Sys_Error ("Couldn't determine userspace directory");
+
+ q_snprintf (dst, dstsize, "%s/%s", buffer, SYS_USERDIR);
+}
+#else
static void Sys_GetUserdir (char *dst, size_t dstsize)
{
size_t n;
@@ -274,6 +294,7 @@ static void Sys_GetUserdir (char *dst, size_t dstsize)
q_snprintf (dst, dstsize, "%s/%s", home_dir, SYS_USERDIR);
}
+#endif /* PLATFORM_HAIKU */
#endif /* DO_USERDIRS */
#ifdef PLATFORM_OSX
--
2.41.0

View File

@@ -26,13 +26,11 @@ COPYRIGHT="1996-2001 Id Software, Inc.
2010-2014 QuakeSpasm developers"
LICENSE="GNU GPL v2"
REVISION="1"
srcGitRev="70df2b661e9c632d04825b259e63ad58c29c01ac"
SOURCE_URI="https://github.com/sezero/quakespasm/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="b89ba914d061376945b1fbe2cd0631e162f4f0d835e004eba87a0a9cce107ad4"
SOURCE_DIR="quakespasm-$srcGitRev"
SOURCE_URI="https://github.com/sezero/quakespasm/archive/refs/tags/quakespasm-$portVersion.tar.gz"
CHECKSUM_SHA256="4087f94a822c0161fb38a0fa8941b8ddbc2a1c458d41ef88982b635be4ee8c5b"
SOURCE_DIR="quakespasm-quakespasm-$portVersion"
ADDITIONAL_FILES="QuakeSpasm.rdef.in
haiku_readme.txt"
PATCHES="quakespasm-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
@@ -75,7 +73,7 @@ INSTALL()
local APP_SIGNATURE="application/x-vnd.QuakeSpasm"
local MAJOR="`echo "$portVersion" | cut -d. -f1`"
local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
local MINOR="`echo "${portVersion//~git}" | cut -d. -f3`"
local MINOR="`echo "$portVersion" | cut -d. -f3`"
local LONG_INFO="$SUMMARY"
sed \
-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \