Skip to content

Commit

Permalink
games/nehquake: unbreak, undeprecate, and assume maintainership
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
Alexey Dokuchaev authored and Alexey Dokuchaev committed Nov 22, 2023
1 parent cab14f4 commit eecd094
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 35 deletions.
23 changes: 14 additions & 9 deletions games/nehquake/Makefile
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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}
Expand All @@ -55,3 +58,5 @@ do-install:
@${MKDIR} ${STAGEDIR}${Q1DIR}/nehahra

.include <bsd.port.mk>

PATCH_ARGS+= -l
44 changes: 27 additions & 17 deletions 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 @@
#

Expand All @@ -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

Expand All @@ -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)
Expand All @@ -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
#############################################################################


Expand All @@ -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 \
Expand All @@ -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

Expand Down
12 changes: 9 additions & 3 deletions games/nehquake/files/patch-src__glquake.h
@@ -1,10 +1,16 @@
--- ./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
-#define APIENTRY /* */
#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;
15 changes: 12 additions & 3 deletions 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;
Expand Down
12 changes: 9 additions & 3 deletions 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
}
]

0 comments on commit eecd094

Please sign in to comment.