git: b05652e4adc4 - main - games/darkplaces: the port had been updated and cleaned up (+)

From: Alexey Dokuchaev <danfe_at_FreeBSD.org>
Date: Wed, 01 Dec 2021 16:58:07 UTC
The branch main has been updated by danfe:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b05652e4adc416ebf6ca4b0d38199373376ca123

commit b05652e4adc416ebf6ca4b0d38199373376ca123
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2021-12-01 16:56:42 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2021-12-01 16:56:43 +0000

    games/darkplaces: the port had been updated and cleaned up (+)
    
    - Update to 20180412beta1 penultimate snapshot, the very latest one
      had introduced too many changes which e.g. broke dedicated server
    - Drop needless zip:infozip dependency, set USE_XORG more discretely
    - Follow the defaults and link to libjpeg the usual way rather than
      load it at run-time with dlopen(3)
    - Target `sdl-release' is spelled the same, regardless of the used
      SDL version
    - Remove SSE port option: upstream makefile logic enables it for x86
      CPUs; it's safe to assume that all modern x86 CPUs would support
      these instructions
    - Amend patches and remove `post-patch' target (patching makefiles
      for LOCALBASE with sed(1) is bogus in the first place as it is
      passed on the MAKE_ENV and thus propagated down to inner makes)
    - Do not try to use unsupported `-fno-signaling-nans' compiler flag
    - Define LICENSE (GPLv2 or later) and assume port's maintainership
    
    PR:     259123
---
 games/darkplaces/Makefile                 | 41 ++++++++++--------------------
 games/darkplaces/distinfo                 |  5 ++--
 games/darkplaces/files/patch-makefile     | 20 +++++++++++++++
 games/darkplaces/files/patch-makefile.inc | 42 ++++++++++++++++++++++++++++---
 4 files changed, 75 insertions(+), 33 deletions(-)

diff --git a/games/darkplaces/Makefile b/games/darkplaces/Makefile
index 819b8166b125..e50d48681469 100644
--- a/games/darkplaces/Makefile
+++ b/games/darkplaces/Makefile
@@ -1,34 +1,31 @@
 # Created by: Alejandro Pulver <alejandro@varnet.biz>
 
 PORTNAME=	darkplaces
-PORTVERSION=	20140513
-PORTREVISION=	5
+DISTVERSION=	20180412beta1
 CATEGORIES=	games
 MASTER_SITES=	http://icculus.org/twilight/darkplaces/files/
-DISTNAME=	${PORTNAME}engine${PORTVERSION}
+DISTNAME=	${PORTNAME}engine${DISTVERSION}
 
-MAINTAINER=	ports@FreeBSD.org
+MAINTAINER=	danfe@FreeBSD.org
 COMMENT=	Quake engine modification
 
+LICENSE=	GPLv2+
+
 # Loads libraries at run-time, thus RUN_DEPENDS.
 RUN_DEPENDS=	${LOCALBASE}/lib/libvorbis.so:audio/libvorbis
 
-USES=		compiler:c11 gmake jpeg xorg zip:infozip
-USE_XORG=	xxf86dga xpm
-MAKE_ENV=	DP_FS_BASEDIR="${Q1DIR}" DP_LINK_JPEG=dlopen
+USES=		compiler:c11 gmake jpeg zip
+MAKE_ENV=	DP_FS_BASEDIR="${Q1DIR}"
 WRKSRC=		${WRKDIR}/${PORTNAME}
 
 MAKEFILE=	makefile
 ALL_TARGET=	#
 
 OPTIONS_DEFINE=	DOCS SDL1
-OPTIONS_DEFINE_i386=	SSE
-OPTIONS_DEFINE_amd64=	SSE
 OPTIONS_MULTI=	MODULE
 MODULE_DESC=	Components
 OPTIONS_MULTI_MODULE=	GLX SDL SERVER
 OPTIONS_DEFAULT=	${OPTIONS_MULTI_MODULE}
-OPTIONS_DEFAULT_amd64=	SSE
 OPTIONS_SUB=	yes
 
 GLX_DESC=	Build GLX client
@@ -36,8 +33,10 @@ SDL_DESC=	Build SDL client
 SDL1_DESC=	Use SDL v1.2 instead of v2.0
 SERVER_DESC=	Build dedicated server
 
-.include "${.CURDIR}/../quake-data/Makefile.include"
+GLX_USE=	XORG=x11,xext,xpm,xxf86vm
+SDL_USE=	XORG=x11
 
+.include "${.CURDIR}/../quake-data/Makefile.include"
 .include <bsd.port.options.mk>
 
 .if ${PORT_OPTIONS:MGLX} || ${PORT_OPTIONS:MSDL}
@@ -67,30 +66,16 @@ USE_SDL=	sdl
 ALL_TARGET+=	sdl-release
 . else
 USE_SDL=	sdl2
-ALL_TARGET+=	sdl2-release
+ALL_TARGET+=	sdl-release
 . endif
 EXE_TARGETS+=	${PORTNAME}-sdl
 DESKTOP_ENTRIES+="Darkplaces (SDL client)" "Quake engine modification (SDL)" \
 		darkplaces darkplaces-sdl "Game;Shooter;" false
 .endif
 
-.if ! ${PORT_OPTIONS:MSSE}
-CFLAGS+=	-DNO_SSE=1
-.endif
-
 post-extract:
-	@${UNZIP_CMD} ${EXTRACT_BEFORE_ARGS} \
-		${WRKDIR}/${PORTNAME}enginesource${PORTVERSION}.zip \
-		-d ${WRKDIR}
-
-post-patch:
-	@${REINPLACE_CMD} 's,/usr/X11R6,${LOCALBASE},g' \
-		${WRKSRC}/makefile \
-		${WRKSRC}/makefile.inc \
-		${WRKSRC}/BSDmakefile
-.if ! ${PORT_OPTIONS:MSSE}
-	@${REINPLACE_CMD} '/^CFLAGS_SSE/ d' ${WRKSRC}/makefile.inc
-.endif
+	@${UNZIP_NATIVE_CMD} ${EXTRACT_BEFORE_ARGS} -d ${WRKDIR} \
+		${WRKDIR}/${PORTNAME}enginesource${DISTVERSION}.zip
 
 do-install:
 	${INSTALL_PROGRAM} ${EXE_TARGETS:S,^,${WRKSRC}/,} ${STAGEDIR}${PREFIX}/bin
diff --git a/games/darkplaces/distinfo b/games/darkplaces/distinfo
index 662b1b41cce6..bb05c04dd0ec 100644
--- a/games/darkplaces/distinfo
+++ b/games/darkplaces/distinfo
@@ -1,2 +1,3 @@
-SHA256 (darkplacesengine20140513.zip) = 69e5a50991884196e403bd6aab4a33bba553a934a167be366672ab4e223b06c9
-SIZE (darkplacesengine20140513.zip) = 28113487
+TIMESTAMP = 1523571096
+SHA256 (darkplacesengine20180412beta1.zip) = 651b3ea5daf07331340b51192f538939a59d44b7d7e3dee8227b7a7546ffd0c8
+SIZE (darkplacesengine20180412beta1.zip) = 29175480
diff --git a/games/darkplaces/files/patch-makefile b/games/darkplaces/files/patch-makefile
new file mode 100644
index 000000000000..2076774f5dd9
--- /dev/null
+++ b/games/darkplaces/files/patch-makefile
@@ -0,0 +1,20 @@
+--- makefile.orig	2016-07-18 03:23:15 UTC
++++ makefile
+@@ -31,7 +31,7 @@ ifeq ($(DP_MAKE_TARGET), mingw)
+ 	DP_SSE:=1
+ else
+ 	DP_MACHINE:=$(shell uname -m)
+-	ifeq ($(DP_MACHINE),x86_64)
++	ifeq ($(DP_MACHINE),amd64)
+ 		DP_SSE:=1
+ 	else
+ 	ifeq ($(DP_MACHINE),i686)
+@@ -64,7 +64,7 @@ endif
+ ifeq ($(DP_MACHINE),x86_64)
+ 	UNIX_X11LIBPATH:=/usr/X11R6/lib64
+ else
+-	UNIX_X11LIBPATH:=/usr/X11R6/lib
++	UNIX_X11LIBPATH:=$(LOCALBASE)/lib
+ endif
+ 
+ # default targets
diff --git a/games/darkplaces/files/patch-makefile.inc b/games/darkplaces/files/patch-makefile.inc
index 4f218579877f..57195f5dc5fb 100644
--- a/games/darkplaces/files/patch-makefile.inc
+++ b/games/darkplaces/files/patch-makefile.inc
@@ -1,6 +1,15 @@
---- makefile.inc.orig	2014-04-05 10:07:18 UTC
+--- makefile.inc.orig	2016-07-20 13:13:00 UTC
 +++ makefile.inc
-@@ -189,7 +189,7 @@ OPTIM_DEBUG=$(CPUOPTIMIZATIONS)
+@@ -22,7 +22,7 @@ CC?=gcc
+ # Experimental
+ #CPUOPTIMIZATIONS?=-fno-math-errno -ffinite-math-only -fno-rounding-math -fno-signaling-nans -fassociative-math -freciprocal-math -fno-signed-zeros -fno-trapping-math
+ # Normal
+-CPUOPTIMIZATIONS?=-fno-math-errno -ffinite-math-only -fno-rounding-math -fno-signaling-nans -fno-trapping-math
++CPUOPTIMIZATIONS?=-fno-math-errno -ffinite-math-only -fno-rounding-math -fno-trapping-math
+ # NOTE: *never* *ever* use the -ffast-math or -funsafe-math-optimizations flag
+ 
+ SDL_CONFIG?=sdl2-config
+@@ -193,7 +193,7 @@ OPTIM_DEBUG=$(CPUOPTIMIZATIONS)
  #OPTIM_RELEASE=-O2 -fno-strict-aliasing -fno-math-errno -fno-trapping-math -ffinite-math-only -fno-signaling-nans -fcx-limited-range -funroll-loops $(CPUOPTIMIZATIONS)
  #OPTIM_RELEASE=-O2 -fno-strict-aliasing -funroll-loops $(CPUOPTIMIZATIONS)
  #OPTIM_RELEASE=-O2 -fno-strict-aliasing $(CPUOPTIMIZATIONS)
@@ -9,7 +18,16 @@
  # NOTE: *never* *ever* use the -ffast-math or -funsafe-math-optimizations flag
  
  DO_CC=$(CC) $(CFLAGS) -c $< -o $@
-@@ -470,8 +470,8 @@ bin-release :
+@@ -270,7 +270,7 @@ LDFLAGS_SUNOSSDL=$(LDFLAGS_UNIXCOMMON) -lrt -ldl -lsoc
+ 
+ # Link
+ LDFLAGS_BSDCL=$(LDFLAGS_UNIXCOMMON) -lutil $(LDFLAGS_UNIXCL)
+-LDFLAGS_BSDSV=$(LDFLAGS_UNIXCOMMON) 
++LDFLAGS_BSDSV=-L$(LOCALBASE)/lib $(LDFLAGS_UNIXCOMMON)
+ LDFLAGS_BSDSDL=$(LDFLAGS_UNIXCOMMON) $(LDFLAGS_UNIXSDL)
+ 
+ 
+@@ -454,8 +454,8 @@ bin-release :
  	$(MAKE) prepare BUILD_DIR=build-obj/release/$(EXE)
  	$(MAKE) -C build-obj/release/$(EXE) $(EXE) \
  		DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
@@ -20,3 +38,21 @@
  	$(STRIP) $(EXE)
  
  bin-release-profile :
+@@ -485,11 +485,15 @@ world.o: world.c
+ 
+ vid_glx.o: vid_glx.c
+ 	$(CHECKLEVEL2)
+-	$(DO_CC) -I/usr/X11R6/include
++	$(DO_CC) -I$(LOCALBASE)/include
+ 
+ keysym2ucs.o: keysym2ucs.c
+ 	$(CHECKLEVEL2)
+-	$(DO_CC) -I/usr/X11R6/include
++	$(DO_CC) -I$(LOCALBASE)/include
++
++jpeg.o: jpeg.c
++	$(CHECKLEVEL2)
++	$(DO_CC) -I$(LOCALBASE)/include
+ 
+ crypto.o: crypto.c
+ 	$(CHECKLEVEL2)