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.
This commit is contained in:
Alexey Dokuchaev 2022-11-24 16:16:32 +00:00
parent dbf29c579e
commit bed6f6f7e1
2 changed files with 49 additions and 2 deletions

View File

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

View File

@ -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: