git: bed6f6f7e19c - main - games/oblige: use the ports instead of bundled 3rd-party components

From: Alexey Dokuchaev <danfe_at_FreeBSD.org>
Date: Thu, 24 Nov 2022 16:16:52 UTC
The branch main has been updated by danfe:

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

commit bed6f6f7e19c1d6e194fdf8a73ad30881afa49b6
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2022-11-24 16:16:32 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2022-11-24 16:16:32 +0000

    games/oblige: use the ports instead of bundled 3rd-party components
    
    Unfortunately, we cannot get rid of bundled Lua just yet as none of
    the Lua versions we have can digest the project's *.lua scripts.
---
 games/oblige/Makefile             | 10 ++++++++--
 games/oblige/files/patch-Makefile | 41 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+), 2 deletions(-)

diff --git a/games/oblige/Makefile b/games/oblige/Makefile
index ae7f2d062159..74f02ca32b60 100644
--- a/games/oblige/Makefile
+++ b/games/oblige/Makefile
@@ -10,19 +10,23 @@ WWW=		https://oblige.sourceforge.net/
 
 LICENSE=	GPLv2+
 
+BUILD_DEPENDS=	${LOCALBASE}/include/glbsp.h:games/glbsp
 LIB_DEPENDS=	libfltk.so:x11-toolkits/fltk \
 		libfontconfig.so:x11-fonts/fontconfig \
+		libphysfs.so:devel/physfs \
 		libpng.so:graphics/png
 
 USES=		gmake jpeg xorg zip
 USE_XORG=	x11 xcursor xext xfixes xft xinerama xrender
-MAKE_ARGS=	CXX="${CXX}"
 WRKSRC=		${WRKDIR}/Oblige-${PORTVERSION}-source
 
 OPTIONS_DEFINE=	DOCS
 
 PORTDOCS=	AUTHORS.txt CHANGES.txt README.txt TODO.txt
 
+post-extract:
+	@cd ${WRKSRC} && ${RM} -r glbsp_src physfs_src
+
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/Oblige ${STAGEDIR}${PREFIX}/bin/oblige
 	cd ${WRKSRC} && ${COPYTREE_SHARE} "addons data engines games \
@@ -35,9 +39,11 @@ do-install:
 	${INSTALL_DATA} ${WRKSRC}/misc/icon_128x128.png \
 		${STAGEDIR}${PREFIX}/share/icons/hicolor/128x128/apps/oblige.png
 
-post-install-DOCS-on:
+do-install-DOCS-on:
 	@${MKDIR} ${STAGEDIR}${DOCSDIR}
 	${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR}
 	cd ${WRKSRC} && ${COPYTREE_SHARE} changelogs ${STAGEDIR}${DOCSDIR}
 
 .include <bsd.port.mk>
+
+PATCH_ARGS+=	-l
diff --git a/games/oblige/files/patch-Makefile b/games/oblige/files/patch-Makefile
new file mode 100644
index 000000000000..920f47b4f42c
--- /dev/null
+++ b/games/oblige/files/patch-Makefile
@@ -0,0 +1,41 @@
+--- Makefile.orig	2018-01-09 05:01:02 UTC
++++ Makefile
+@@ -17,7 +17,7 @@ SCRIPT_DIR=$(PREFIX)/share/oblige
+ 
+ SCRIPT_DIR=$(PREFIX)/share/oblige
+ 
+-CXX=g++
++CXX?=c++
+ 
+ OBJ_DIR=obj_linux
+ 
+@@ -34,9 +34,9 @@ FLTK_LIBS=$(shell $(FLTK_CONFIG) --use-images --ldflag
+ FLTK_FLAGS=$(shell $(FLTK_CONFIG) --cflags)
+ FLTK_LIBS=$(shell $(FLTK_CONFIG) --use-images --ldflags)
+ 
+-CXXFLAGS=$(OPTIMISE) -Wall -D$(OS) -Ilua_src -Iglbsp_src -Iajpoly_src -Iphysfs_src $(FLTK_FLAGS)
++CXXFLAGS=$(OPTIMISE) -Wall -D$(OS) -Ilua_src -Iajpoly_src $(FLTK_FLAGS)
+ LDFLAGS=-L/usr/X11R6/lib
+-LIBS=-lm -lz $(FLTK_LIBS)
++LIBS=-lm -lz -lglbsp -lphysfs $(FLTK_LIBS)
+ 
+ 
+ #----- OBLIGE Objects ----------------------------------------------
+@@ -174,7 +174,7 @@ AJPOLY_OBJS= \
+ 	$(OBJ_DIR)/ajpoly/pl_util.o  \
+ 	$(OBJ_DIR)/ajpoly/pl_wad.o
+ 
+-AJPOLY_CXXFLAGS=$(OPTIMISE) -Wall -Iphysfs_src
++AJPOLY_CXXFLAGS=$(OPTIMISE) -Wall -I$(LOCALBASE)/include
+ 
+ $(OBJ_DIR)/ajpoly/%.o: ajpoly_src/%.cc
+ 	$(CXX) $(AJPOLY_CXXFLAGS) -o $@ -c $<
+@@ -212,7 +212,7 @@ all: $(PROGRAM)
+ 
+ all: $(PROGRAM)
+ 
+-$(PROGRAM): $(OBJS) $(LUA_OBJS) $(GLBSP_OBJS) $(AJPOLY_OBJS) $(PHYSFS_OBJS)
++$(PROGRAM): $(OBJS) $(LUA_OBJS) $(AJPOLY_OBJS)
+ 	$(CXX) -Wl,--warn-common $^ -o $@ $(LDFLAGS) $(LIBS)
+ 
+ clean: