aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Dokuchaev <danfe@FreeBSD.org>2023-11-22 12:16:30 +0000
committerAlexey Dokuchaev <danfe@FreeBSD.org>2023-11-22 12:16:30 +0000
commiteecd094e32a4fbc24d65197221242c29b83d3200 (patch)
treee01b6786715c2297fd4643fb0a28917ccdf7f260
parentcab14f4f9f1fab50f3f1eb6c39f457ac32ad0a03 (diff)
downloadports-eecd094e32a4fbc24d65197221242c29b83d3200.tar.gz
ports-eecd094e32a4fbc24d65197221242c29b83d3200.zip
games/nehquake: unbreak, undeprecate, and assume maintainership
Define LICENSE (GPLv2 or later), add missing USE_XORG components, do not allow ``make build'' to succeed when compilation actually fails, bump MAX_PRINTMSG value to accommodate long GL extensions string returned by modern video cards, amend post-install advice. Tested on: 13-STABLE/i386 + ATI Radeon HD 4350 (RV710)
-rw-r--r--games/nehquake/Makefile23
-rw-r--r--games/nehquake/files/patch-Makefile44
-rw-r--r--games/nehquake/files/patch-src__glquake.h12
-rw-r--r--games/nehquake/files/patch-src__quakedef.h15
-rw-r--r--games/nehquake/files/pkg-message.in12
5 files changed, 71 insertions, 35 deletions
diff --git a/games/nehquake/Makefile b/games/nehquake/Makefile
index e6581237db65..e4b1aa120525 100644
--- a/games/nehquake/Makefile
+++ b/games/nehquake/Makefile
@@ -5,18 +5,16 @@ CATEGORIES= games
MASTER_SITES= LOCAL/alepulver
DISTNAME= NehQuake-bjp-bin-src.linux
-MAINTAINER= ports@FreeBSD.org
+MAINTAINER= danfe@FreeBSD.org
COMMENT= Quake engine designed for playing Nehahra
-WWW= http://planetquake.com/nehahra/
+WWW= https://quakewiki.org/wiki/Nehahra \
+ https://www.quaddicted.com/reviews/nehahra.html
-BROKEN_FreeBSD_13= ld: error: duplicate symbol: sb_lines
-BROKEN_FreeBSD_14= ld: error: duplicate symbol: sb_lines
-DEPRECATED= Fails to build, abandoned upstream and marked broken over a year go
-EXPIRATION_DATE=2023-11-30
+LICENSE= GPLv2+
-USES= gl gmake dos2unix tar:bzip2 xorg
+USES= gl gmake tar:bzip2 xorg
USE_GL= gl
-USE_XORG= xxf86dga xxf86vm
+USE_XORG= x11 xext xxf86dga xxf86vm
OPTIONS_DEFINE= OPTIMIZED_CFLAGS SDL
OPTIONS_DEFINE_amd64= X86_ASM
@@ -36,7 +34,6 @@ ALL_TARGET= release
SUB_FILES= pkg-message
.include "${.CURDIR}/../quake-data/Makefile.include"
-
.include <bsd.port.options.mk>
.for f in OPTIMIZED_CFLAGS X86_ASM
@@ -47,6 +44,12 @@ MAKE_ENV+= USE_${f}=NO
. endif
.endfor
+post-patch:
+ @${REINPLACE_CMD} -E '/^int[[:blank:]]+sb_lines;/d' \
+ ${WRKSRC}/src/gl_screen.c
+ @${REINPLACE_CMD} -e '/text\[/s/4096/MAX_PRINTMSG/' \
+ ${WRKSRC}/src/sys_linux.c
+
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/release/nehahra ${STAGEDIR}${PREFIX}/bin
.if ${PORT_OPTIONS:MSDL}
@@ -55,3 +58,5 @@ do-install:
@${MKDIR} ${STAGEDIR}${Q1DIR}/nehahra
.include <bsd.port.mk>
+
+PATCH_ARGS+= -l
diff --git a/games/nehquake/files/patch-Makefile b/games/nehquake/files/patch-Makefile
index a83f9531ab5e..73f03aa0d8c4 100644
--- a/games/nehquake/files/patch-Makefile
+++ b/games/nehquake/files/patch-Makefile
@@ -1,5 +1,5 @@
---- Makefile.orig Sat May 27 13:47:34 2006
-+++ Makefile Sat May 27 14:04:12 2006
+--- Makefile.orig 2005-11-10 14:57:23 UTC
++++ Makefile
@@ -9,9 +9,9 @@
#
@@ -12,7 +12,7 @@
ifneq (,$(findstring libc6,$(shell if [ -e /lib/libc.so.6 ];then echo libc6;fi)))
GLIBC=-glibc
-@@ -28,32 +28,45 @@
+@@ -28,32 +28,45 @@ NOARCH=noarch
MOUNT_DIR=./src
@@ -34,26 +34,27 @@
+endif
-RELEASE_CFLAGS=$(BASE_CFLAGS) -march=i686 -O2 -ffast-math -funroll-loops \
-+BASE_CFLAGS=$(CFLAGS) -Dstricmp=strcasecmp #-Wall
-+
+- -fomit-frame-pointer -fexpensive-optimizations -fno-strict-aliasing
+-DEBUG_CFLAGS=$(BASE_CFLAGS) -g
++BASE_CFLAGS=$(CFLAGS) -Dstricmp=strcasecmp -Wno-implicit-function-declaration
+
+-LDFLAGS=-lm
+ifeq ($(strip $(USE_X86_ASM)),YES)
+BASE_CFLAGS+=-Did386
+endif
-+
+
+-LDFLAGS += -lz -L./src/fmod -Wl,-rpath,. -lfmod
+RELEASE_CFLAGS=$(BASE_CFLAGS)
-+
+
+ifeq ($(strip $(USE_OPTIMIZED_CFLAGS)),YES)
+RELEASE_CFLAGS+=-O2 -ffast-math -funroll-loops \
- -fomit-frame-pointer -fexpensive-optimizations -fno-strict-aliasing
--DEBUG_CFLAGS=$(BASE_CFLAGS) -g
++ -fomit-frame-pointer -fno-strict-aliasing
+endif
-
--LDFLAGS=-lm
++
+DEBUG_CFLAGS=$(BASE_CFLAGS) -g
-
--LDFLAGS += -lz -L./src/fmod -Wl,-rpath,. -lfmod
++
+LDFLAGS+=-lm -lz
-
++
ifeq ($(strip $(BUILD_SDL)),YES)
- SDLCFLAGS=$(shell sdl-config --cflags)
- SDLLDFLAGS=$(shell sdl-config --libs)
@@ -72,7 +73,7 @@
DO_CC=$(CC) $(CFLAGS) -o $@ -c $<
DO_DEBUG_CC=$(CC) $(DEBUG_CFLAGS) -o $@ -c $<
-@@ -70,10 +83,10 @@
+@@ -70,10 +83,10 @@ DO_GL_AS=$(CC) $(CFLAGS) $(GLCFLAGS) -DELF -x assemble
#############################################################################
@@ -85,7 +86,16 @@
endif
all:
-@@ -165,12 +178,15 @@
+@@ -94,7 +107,7 @@ debug:
+ $(BUILD_DEBUG_DIR)/glquake
+ $(MAKE) targets BUILDDIR=$(BUILD_DEBUG_DIR) CFLAGS="$(DEBUG_CFLAGS)"
+
+-release:
++release::
+ @-mkdir $(BUILD_RELEASE_DIR) \
+ $(BUILD_RELEASE_DIR)/glquake
+ $(MAKE) targets BUILDDIR=$(BUILD_RELEASE_DIR) CFLAGS="$(RELEASE_CFLAGS)"
+@@ -165,12 +178,15 @@ GLQUAKE_OBJS= \
$(BUILDDIR)/glquake/sys_linux.o \
$(BUILDDIR)/glquake/snd_dma.o \
$(BUILDDIR)/glquake/snd_mem.o \
@@ -103,7 +113,7 @@
GLQUAKE_LNX_OBJS = \
$(BUILDDIR)/glquake/cd_linux.o \
-@@ -182,10 +198,10 @@
+@@ -182,10 +198,10 @@ GLQUAKE_SDL_OBJS = \
GLX_OBJS=$(BUILDDIR)/glquake/gl_vidlinuxglx.o
diff --git a/games/nehquake/files/patch-src__glquake.h b/games/nehquake/files/patch-src__glquake.h
index dd490a83779f..cfb77303b314 100644
--- a/games/nehquake/files/patch-src__glquake.h
+++ b/games/nehquake/files/patch-src__glquake.h
@@ -1,6 +1,6 @@
---- ./src/glquake.h.orig Tue Sep 27 19:06:49 2005
-+++ ./src/glquake.h Tue May 16 17:36:22 2006
-@@ -275,7 +275,6 @@
+--- src/glquake.h.orig 2005-09-27 22:06:49 UTC
++++ src/glquake.h
+@@ -275,7 +275,6 @@ extern GLenum gl_Texture1;
#define TEXTURE1_SGIS gl_Texture1
#ifndef _WIN32
@@ -8,3 +8,9 @@
#endif
typedef void (APIENTRY *lpMTexFUNC) (GLenum, GLfloat, GLfloat);
+@@ -289,4 +288,4 @@ void GL_DisableMultitexture(void);
+ void GL_EnableMultitexture(void);
+ void GL_LightMaps_f (void);
+
+-extern bspversion;
++extern int bspversion;
diff --git a/games/nehquake/files/patch-src__quakedef.h b/games/nehquake/files/patch-src__quakedef.h
index 5e94e1b477ab..e25c9f65d293 100644
--- a/games/nehquake/files/patch-src__quakedef.h
+++ b/games/nehquake/files/patch-src__quakedef.h
@@ -1,6 +1,15 @@
---- ./src/quakedef.h.orig Tue Sep 27 13:41:52 2005
-+++ ./src/quakedef.h Tue May 16 17:48:38 2006
-@@ -337,7 +337,7 @@
+--- src/quakedef.h.orig 2005-09-27 16:41:52 UTC
++++ src/quakedef.h
+@@ -101,7 +101,7 @@ void VID_UnlockBuffer (void);
+ #define MAX_MSGLEN 65536 //8192 // max length of a reliable message
+ #define MAX_DATAGRAM 65536 //3027 // max length of unreliable message
+
+-#define MAX_PRINTMSG 4096
++#define MAX_PRINTMSG 16384
+
+ //
+ // per-level limits
+@@ -337,7 +337,7 @@ void Chase_Reset (void);
void Chase_Update (void);
extern int bspversion;
diff --git a/games/nehquake/files/pkg-message.in b/games/nehquake/files/pkg-message.in
index af45234bb45f..6f696193da92 100644
--- a/games/nehquake/files/pkg-message.in
+++ b/games/nehquake/files/pkg-message.in
@@ -1,9 +1,15 @@
[
{ type: install
message: <<EOM
-To complete the instalation of this port you have download the Nehahra data
-files from "http://planetquake.com/nehahra/" and extract them to
-"%%Q1DIR%%/nehahra".
+To complete the installation of this port, download Nehahra mod
+from https://www.quaddicted.com/filebase/nehahra.zip and unpack
+its "nehahra" subdirectory as "%%Q1DIR%%/nehahra".
+
+If you see the following error when loading certain large maps,
+
+ Error: Cache_TryAlloc: 1627728 is greater then free hunk
+
+run the game with e.g. ``-mem 64'' option (memory in megabytes).
EOM
}
]