* Integrate with quake-data
* Minor fixes PR: ports/91840 Submitted by: "Alejandro Pulver" <alejandro@varnet.biz> (maintainer)
This commit is contained in:
parent
db02c5d6b3
commit
d3032bf33b
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=157392
@ -17,87 +17,69 @@ COMMENT= Quake engine modification
|
||||
WRKSRC= ${WRKDIR}/${PORTNAME}
|
||||
|
||||
USE_GMAKE= yes
|
||||
USE_REINPLACE= yes
|
||||
USE_ZIP= yes
|
||||
|
||||
MAKEFILE= makefile
|
||||
ALL_TARGET= #
|
||||
|
||||
OPTIONS= CLIENT "Build GLX client" on \
|
||||
DEDICATED "Build dedicated server" on \
|
||||
OPTIMIZED_CFLAGS "Enable compilation optimizations" on \
|
||||
SERVER "Build dedicated server" on \
|
||||
SDL_CLIENT "Build SDL client" on
|
||||
|
||||
SUB_FILES= pkg-message
|
||||
PKGMESSAGE= ${WRKDIR}/pkg-message
|
||||
PLIST_FILES= %%DATADIR%%/dummy
|
||||
PLIST_DIRS= %%DATADIR%%
|
||||
|
||||
.include "${.CURDIR}/../quake-data/Makefile.include"
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
.if !defined(WITH_CLIENT) && !defined(WITH_SDL_CLIENT) && \
|
||||
!defined(WITH_DEDICATED)
|
||||
IGNORE= You must choose at least one option of CLIENT, SDL_CLIENT and DEDICATED
|
||||
IGNORE= please select at least one of CLIENT, SDL_CLIENT and DEDICATED
|
||||
.endif
|
||||
|
||||
.if defined(WITH_CLIENT) || defined(WITH_SDL_CLIENT)
|
||||
# Loads libraries on run-time, thus RUN_DEPENDS
|
||||
RUN_DEPENDS= ${LOCALBASE}/lib/libvorbis.so:${PORTSDIR}/audio/libvorbis \
|
||||
${LOCALBASE}/lib/libjpeg.so:${PORTSDIR}/graphics/jpeg
|
||||
# Loads libraries at run-time, thus RUN_DEPENDS.
|
||||
RUN_DEPENDS+= ${LOCALBASE}/lib/libjpeg.so:${PORTSDIR}/graphics/jpeg \
|
||||
${LOCALBASE}/lib/libvorbis.so:${PORTSDIR}/audio/libvorbis
|
||||
.endif
|
||||
|
||||
.if defined(WITH_CLIENT)
|
||||
USE_GL= yes
|
||||
ALL_TARGET+= cl-release
|
||||
EXE_TARGETS+= ${PORTNAME}-glx
|
||||
PLIST_SUB+= CLIENT=""
|
||||
.else
|
||||
PLIST_SUB+= CLIENT="@comment "
|
||||
PLIST_FILES+= bin/${PORTNAME}-glx
|
||||
.endif
|
||||
|
||||
.if defined(WITH_DEDICATED)
|
||||
ALL_TARGET+= sv-release
|
||||
EXE_TARGETS+= ${PORTNAME}-dedicated
|
||||
PLIST_FILES+= bin/${PORTNAME}-dedicated
|
||||
.endif
|
||||
|
||||
.if defined(WITH_OPTIMIZED_CFLAGS)
|
||||
MAKE_ENV+= WITH_OPTIMIZED_CFLAGS=YES
|
||||
.endif
|
||||
|
||||
.if defined(WITH_SDL_CLIENT)
|
||||
USE_SDL= sdl
|
||||
ALL_TARGET+= sdl-release
|
||||
PLIST_SUB+= SDL_CLIENT=""
|
||||
.else
|
||||
PLIST_SUB+= SDL_CLIENT="@comment "
|
||||
.endif
|
||||
|
||||
.if defined(WITH_SERVER)
|
||||
ALL_TARGET+= sv-release
|
||||
PLIST_SUB+= SERVER=""
|
||||
.else
|
||||
PLIST_SUB+= SERVER="@comment "
|
||||
EXE_TARGETS+= ${PORTNAME}-sdl
|
||||
PLIST_FILES+= bin/${PORTNAME}-sdl
|
||||
.endif
|
||||
|
||||
post-extract:
|
||||
@${UNZIP_CMD} -a -q \
|
||||
@${UNZIP_CMD} -aq \
|
||||
-o ${WRKDIR}/${PORTNAME}enginesource${PORTVERSION}.zip \
|
||||
-d ${WRKDIR}
|
||||
|
||||
post-patch:
|
||||
@${REINPLACE_CMD} -e 's|sdl-config|${SDL_CONFIG}|g ; \
|
||||
s|/usr/X11R6|${X11BASE}| ; \
|
||||
s|gcc|${CC}| ; \
|
||||
s|\(-MD\)|${CFLAGS} \1|' \
|
||||
${WRKSRC}/${MAKEFILE} ${WRKSRC}/makefile.inc
|
||||
@${REINPLACE_CMD} -e 's,"\.","${DATADIR}",' ${WRKSRC}/fs.c
|
||||
.if defined(WITHOUT_OPTIMIZED_CFLAGS)
|
||||
@${REINPLACE_CMD} -e 's|$$(OPTIM_RELEASE)||' ${WRKSRC}/makefile.inc
|
||||
.endif
|
||||
.if ${ARCH} == "alpha"
|
||||
@${REINPLACE_CMD} -e 's|-ffast-math||' ${WRKSRC}/makefile.inc
|
||||
.endif
|
||||
|
||||
do-install:
|
||||
@${MKDIR} ${DATADIR}
|
||||
.for f in ${PORTNAME}-glx ${PORTNAME}-sdl ${PORTNAME}-dedicated
|
||||
@${TEST} -f ${WRKSRC}/${f} && \
|
||||
${INSTALL_PROGRAM} ${WRKSRC}/${f} ${PREFIX}/bin
|
||||
@${TEST} -L ${PREFIX}/bin/${PORTNAME} || \
|
||||
${LN} -s ${PREFIX}/bin/${f} ${PREFIX}/bin/${PORTNAME}
|
||||
.for f in ${EXE_TARGETS}
|
||||
${INSTALL_PROGRAM} ${WRKSRC}/${f} ${PREFIX}/bin
|
||||
.endfor
|
||||
|
||||
post-install:
|
||||
@${ECHO_CMD}
|
||||
@${CAT} ${PKGMESSAGE}
|
||||
@${ECHO_CMD}
|
||||
@${MKDIR} ${DATADIR}
|
||||
@${TOUCH} ${DATADIR}/dummy
|
||||
|
||||
.include <bsd.port.post.mk>
|
||||
|
11
games/darkplaces/files/patch-fs.c
Normal file
11
games/darkplaces/files/patch-fs.c
Normal file
@ -0,0 +1,11 @@
|
||||
--- fs.c.orig Tue Aug 2 23:18:34 2005
|
||||
+++ fs.c Sun Jan 15 17:38:11 2006
|
||||
@@ -933,7 +933,7 @@
|
||||
|
||||
fs_mempool = Mem_AllocPool("file management", 0, NULL);
|
||||
|
||||
- strcpy(fs_basedir, ".");
|
||||
+ strcpy(fs_basedir, Q1DIR);
|
||||
strcpy(fs_gamedir, "");
|
||||
|
||||
#ifdef MACOSX
|
46
games/darkplaces/files/patch-gl_backend.c
Normal file
46
games/darkplaces/files/patch-gl_backend.c
Normal file
@ -0,0 +1,46 @@
|
||||
--- gl_backend.c.orig Fri May 20 00:24:12 2005
|
||||
+++ gl_backend.c Sun Jan 15 17:06:32 2006
|
||||
@@ -21,6 +21,8 @@
|
||||
cvar_t gl_dither = {CVAR_SAVE, "gl_dither", "1"}; // whether or not to use dithering
|
||||
cvar_t gl_lockarrays = {0, "gl_lockarrays", "1"};
|
||||
|
||||
+cvar_t gl_compilelogs = {0, "gl_compilelogs", "0"};
|
||||
+
|
||||
int gl_maxdrawrangeelementsvertices;
|
||||
int gl_maxdrawrangeelementsindices;
|
||||
|
||||
@@ -236,6 +238,7 @@
|
||||
Cvar_RegisterVariable(&gl_polyblend);
|
||||
Cvar_RegisterVariable(&gl_dither);
|
||||
Cvar_RegisterVariable(&gl_lockarrays);
|
||||
+ Cvar_RegisterVariable(&gl_compilelogs);
|
||||
Cvar_RegisterVariable(&gl_paranoid);
|
||||
Cvar_RegisterVariable(&gl_printcheckerror);
|
||||
#ifdef NORENDER
|
||||
@@ -780,7 +783,7 @@
|
||||
CHECKGLERROR
|
||||
qglGetObjectParameterivARB(vertexshaderobject, GL_OBJECT_COMPILE_STATUS_ARB, &vertexshadercompiled);
|
||||
qglGetInfoLogARB(vertexshaderobject, sizeof(compilelog), NULL, compilelog);
|
||||
- if (compilelog[0])
|
||||
+ if (gl_compilelogs.integer && compilelog[0])
|
||||
Con_Printf("vertex shader compile log:\n%s\n", compilelog);
|
||||
if (!vertexshadercompiled)
|
||||
{
|
||||
@@ -809,7 +812,7 @@
|
||||
CHECKGLERROR
|
||||
qglGetObjectParameterivARB(fragmentshaderobject, GL_OBJECT_COMPILE_STATUS_ARB, &fragmentshadercompiled);
|
||||
qglGetInfoLogARB(fragmentshaderobject, sizeof(compilelog), NULL, compilelog);
|
||||
- if (compilelog[0])
|
||||
+ if (gl_compilelogs.integer && compilelog[0])
|
||||
Con_Printf("fragment shader compile log:\n%s\n", compilelog);
|
||||
if (!fragmentshadercompiled)
|
||||
{
|
||||
@@ -827,7 +830,7 @@
|
||||
CHECKGLERROR
|
||||
qglGetObjectParameterivARB(programobject, GL_OBJECT_LINK_STATUS_ARB, &programlinked);
|
||||
qglGetInfoLogARB(programobject, sizeof(compilelog), NULL, compilelog);
|
||||
- if (compilelog[0])
|
||||
+ if (gl_compilelogs.integer && compilelog[0])
|
||||
{
|
||||
Con_Printf("program link log:\n%s\n", compilelog);
|
||||
// software vertex shader is ok but software fragment shader is WAY
|
117
games/darkplaces/files/patch-makefile.inc
Normal file
117
games/darkplaces/files/patch-makefile.inc
Normal file
@ -0,0 +1,117 @@
|
||||
--- makefile.inc.orig Thu Aug 18 21:30:57 2005
|
||||
+++ makefile.inc Sun Jan 15 17:16:57 2006
|
||||
@@ -1,5 +1,4 @@
|
||||
# Choose the compiler you want to use
|
||||
-CC=gcc
|
||||
|
||||
# athlon optimizations
|
||||
#CPUOPTIMIZATIONS=-march=athlon
|
||||
@@ -135,13 +134,19 @@
|
||||
|
||||
# Compilation
|
||||
# CFLAGS_COMMON=-MD -Wall -Werror
|
||||
-CFLAGS_COMMON=-MD -Wall -Wsign-compare
|
||||
+CFLAGS_COMMON=-DQ1DIR='\"$(Q1DIR)\"' -MD -Wall -Wsign-compare
|
||||
CFLAGS_DEBUG=-ggdb
|
||||
CFLAGS_PROFILE=-g -pg -ggdb
|
||||
CFLAGS_RELEASE=
|
||||
|
||||
+ifeq ($(WITH_OPTIMIZED_CFLAGS),YES)
|
||||
OPTIM_DEBUG=$(CPUOPTIMIZATIONS)
|
||||
-OPTIM_RELEASE=-O2 -fno-strict-aliasing -ffast-math -funroll-loops $(CPUOPTIMIZATIONS)
|
||||
+OPTIM_RELEASE=-O2 -fno-strict-aliasing -funroll-loops $(CPUOPTIMIZATIONS)
|
||||
+
|
||||
+ifneq ($(shell uname -p),alpha)
|
||||
+OPTIM_RELEASE+=-ffast-math
|
||||
+endif
|
||||
+endif
|
||||
|
||||
DO_CC=$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
@@ -157,14 +162,14 @@
|
||||
OBJ_GLX= builddate.c sys_linux.o vid_glx.o $(OBJ_SOUND) $(OBJ_CD) $(OBJ_COMMON)
|
||||
|
||||
LDFLAGS_UNIXCOMMON=-lm
|
||||
-#LDFLAGS_UNIXCL=-L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -lXxf86vm $(LIB_SOUND)
|
||||
+#LDFLAGS_UNIXCL=-L$(X11BASE)/lib -lX11 -lXext -lXxf86dga -lXxf86vm $(LIB_SOUND)
|
||||
ifeq ($(DP_MAKE_TARGET), sunos)
|
||||
LDFLAGS_UNIXCL=-R$(UNIX_X11LIBPATH) -L$(UNIX_X11LIBPATH) -lX11 -lXext -lXxf86vm $(LIB_SOUND)
|
||||
else
|
||||
LDFLAGS_UNIXCL=-L$(UNIX_X11LIBPATH) -lX11 -lXext -lXxf86dga -lXxf86vm $(LIB_SOUND)
|
||||
endif
|
||||
|
||||
-LDFLAGS_UNIXSDL=`sdl-config --libs`
|
||||
+LDFLAGS_UNIXSDL=`$(SDL_CONFIG) --libs`
|
||||
EXE_UNIXCL=darkplaces-glx
|
||||
EXE_UNIXSV=darkplaces-dedicated
|
||||
EXE_UNIXSDL=darkplaces-sdl
|
||||
@@ -195,7 +200,7 @@
|
||||
# Link
|
||||
LDFLAGS_MACOSXCL=$(LDFLAGS_UNIXCOMMON) -ldl $(LDFLAGS_UNIXCL)
|
||||
LDFLAGS_MACOSXSV=$(LDFLAGS_UNIXCOMMON) -ldl
|
||||
-LDFLAGS_MACOSXSDL=$(LDFLAGS_UNIXCOMMON) -ldl `sdl-config --static-libs`
|
||||
+LDFLAGS_MACOSXSDL=$(LDFLAGS_UNIXCOMMON) -ldl `$(SDL_CONFIG) --static-libs`
|
||||
|
||||
OBJ_AGL= builddate.c sys_linux.o vid_agl.o $(OBJ_SOUND) $(OBJ_CD) $(OBJ_COMMON)
|
||||
|
||||
@@ -238,7 +243,7 @@
|
||||
LDFLAGS_WINCOMMON=-lwinmm -lwsock32
|
||||
LDFLAGS_WINCL=$(LDFLAGS_WINCOMMON) -mwindows -luser32 -lgdi32 -ldxguid -ldinput -lcomctl32
|
||||
LDFLAGS_WINSV=$(LDFLAGS_WINCOMMON) -mconsole
|
||||
-LDFLAGS_WINSDL=$(LDFLAGS_WINCOMMON) `sdl-config --libs`
|
||||
+LDFLAGS_WINSDL=$(LDFLAGS_WINCOMMON) `$(SDL_CONFIG) --libs`
|
||||
EXE_WINCL=darkplaces.exe
|
||||
EXE_WINSV=darkplaces-dedicated.exe
|
||||
EXE_WINSDL=darkplaces-sdl.exe
|
||||
@@ -330,40 +335,40 @@
|
||||
@echo "========== $(EXE) (debug) =========="
|
||||
$(MAKE) $(EXE) \
|
||||
DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
|
||||
- CFLAGS="$(CFLAGS_COMMON) $(CFLAGS_EXTRA) $(CFLAGS_DEBUG) $(OPTIM_DEBUG)"\
|
||||
- LDFLAGS="$(LDFLAGS_DEBUG) $(LDFLAGS_COMMON)"
|
||||
+ CFLAGS+="$(CFLAGS_COMMON) $(CFLAGS_EXTRA) $(CFLAGS_DEBUG) $(OPTIM_DEBUG)"\
|
||||
+ LDFLAGS+="$(LDFLAGS_DEBUG) $(LDFLAGS_COMMON)"
|
||||
|
||||
bin-profile :
|
||||
@echo
|
||||
@echo "========== $(EXE) (profile) =========="
|
||||
$(MAKE) $(EXE) \
|
||||
DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
|
||||
- CFLAGS="$(CFLAGS_COMMON) $(CFLAGS_EXTRA) $(CFLAGS_PROFILE) $(OPTIM_RELEASE)"\
|
||||
- LDFLAGS="$(LDFLAGS_PROFILE) $(LDFLAGS_COMMON)"
|
||||
+ CFLAGS+="$(CFLAGS_COMMON) $(CFLAGS_EXTRA) $(CFLAGS_PROFILE) $(OPTIM_RELEASE)"\
|
||||
+ LDFLAGS+="$(LDFLAGS_PROFILE) $(LDFLAGS_COMMON)"
|
||||
|
||||
bin-release :
|
||||
@echo
|
||||
@echo "========== $(EXE) (release) =========="
|
||||
$(MAKE) $(EXE) \
|
||||
DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \
|
||||
- CFLAGS="$(CFLAGS_COMMON) $(CFLAGS_EXTRA) $(CFLAGS_RELEASE) $(OPTIM_RELEASE)"\
|
||||
- LDFLAGS="$(LDFLAGS_RELEASE) $(LDFLAGS_COMMON)"
|
||||
+ CFLAGS+="$(CFLAGS_COMMON) $(CFLAGS_EXTRA) $(CFLAGS_RELEASE) $(OPTIM_RELEASE)"\
|
||||
+ LDFLAGS+="$(LDFLAGS_RELEASE) $(LDFLAGS_COMMON)"
|
||||
strip $(EXE)
|
||||
|
||||
vid_glx.o: vid_glx.c
|
||||
- $(DO_CC) -I/usr/X11R6/include
|
||||
+ $(DO_CC) -I$(X11BASE)/include
|
||||
|
||||
vid_sdl.o: vid_sdl.c
|
||||
- $(DO_CC) `sdl-config --cflags`
|
||||
+ $(DO_CC) `$(SDL_CONFIG) --cflags`
|
||||
|
||||
sys_sdl.o: sys_sdl.c
|
||||
- $(DO_CC) `sdl-config --cflags`
|
||||
+ $(DO_CC) `$(SDL_CONFIG) --cflags`
|
||||
|
||||
snd_sdl.o: snd_sdl.c
|
||||
- $(DO_CC) `sdl-config --cflags`
|
||||
+ $(DO_CC) `$(SDL_CONFIG) --cflags`
|
||||
|
||||
cd_sdl.o: cd_sdl.c
|
||||
- $(DO_CC) `sdl-config --cflags`
|
||||
+ $(DO_CC) `$(SDL_CONFIG) --cflags`
|
||||
|
||||
darkplaces.o: %.o : %.rc
|
||||
windres -o $@ $<
|
@ -1,5 +0,0 @@
|
||||
*******************************************************************************
|
||||
* Before running DarkPlaces copy Quake 1 data files (id1 directory)
|
||||
* into %%DATADIR%%.
|
||||
* Filenames should be in lower case!
|
||||
*******************************************************************************
|
@ -1,5 +0,0 @@
|
||||
bin/darkplaces
|
||||
%%CLIENT%%bin/darkplaces-glx
|
||||
%%SDL_CLIENT%%bin/darkplaces-sdl
|
||||
%%SERVER%%bin/darkplaces-dedicated
|
||||
@unexec rmdir %D/%%DATADIR%% >/dev/null 2>&1 || echo "If you are permanently removing this port, you should remove the data files and mods left in %D/%%DATADIR%%." | fmt
|
Loading…
Reference in New Issue
Block a user