aboutsummaryrefslogtreecommitdiffstats
path: root/games/kmquake2
diff options
context:
space:
mode:
authoralepulver <alepulver@FreeBSD.org>2006-06-09 03:00:43 +0800
committeralepulver <alepulver@FreeBSD.org>2006-06-09 03:00:43 +0800
commit077d45dd0e9c61c871ceccf6f226758071772f62 (patch)
tree37c24a223b6bad0c06640d27a3a466aa35c78394 /games/kmquake2
parent29d5bd935c33eb8c85cd59e2f840e18a1012860e (diff)
downloadfreebsd-ports-gnome-077d45dd0e9c61c871ceccf6f226758071772f62.tar.gz
freebsd-ports-gnome-077d45dd0e9c61c871ceccf6f226758071772f62.tar.zst
freebsd-ports-gnome-077d45dd0e9c61c871ceccf6f226758071772f62.zip
- Add CLIENT and GAME options.
- Fix building of the dedicated server. - IGNORE if no executables selected. - Miscelaneous fixes.
Diffstat (limited to 'games/kmquake2')
-rw-r--r--games/kmquake2/Makefile55
-rw-r--r--games/kmquake2/files/patch-Makefile81
-rw-r--r--games/kmquake2/files/patch-client__snd_loc.h2
-rw-r--r--games/kmquake2/files/patch-qcommon__files.c2
-rw-r--r--games/kmquake2/files/patch-unix__gl_glx.c2
-rw-r--r--games/kmquake2/files/patch-unix__sys_unix.c2
-rw-r--r--games/kmquake2/pkg-plist5
7 files changed, 121 insertions, 28 deletions
diff --git a/games/kmquake2/Makefile b/games/kmquake2/Makefile
index d96cb05440b3..b97f670aee07 100644
--- a/games/kmquake2/Makefile
+++ b/games/kmquake2/Makefile
@@ -23,27 +23,23 @@ EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
MAINTAINER= alepulver@FreeBSD.org
COMMENT= Enhanced Quake2 OpenGL only engine with Lazarus support
-LIB_DEPENDS= jpeg.9:${PORTSDIR}/graphics/jpeg \
- openal.0:${PORTSDIR}/audio/openal \
- png.5:${PORTSDIR}/graphics/png \
- vorbis.3:${PORTSDIR}/audio/libvorbis
EXTRACT_DEPENDS=unzip:${PORTSDIR}/archivers/unzip
-WRKSRC= ${WRKDIR}/KMQuake2_${PORTVERSION:S/.//}_src_unix
-
USE_BZIP2= yes
USE_GCC= 3.2+
USE_GMAKE= yes
-USE_GL= yes
+WRKSRC= ${WRKDIR}/KMQuake2_${PORTVERSION:S/.//}_src_unix
OPTIONS= 3ZB2 "Build 3zb2 modification (bots)" off \
+ CLIENT "Build client" on \
CTF "Build Capture The Flag modification" off \
DEDICATED "Build dedicated server" on \
+ GAME "Build main game modification" on \
HYBRID "Build Rogue-Xatrix hybrid modification" off \
LIGHTS "Build Lights modification with bots" off \
OPTIMIZED_CFLAGS "Enable compilation optimizations" on \
PAX "Build Pax Imperia modification" off \
- ROGUE "Build Ground Zero (Rogue( mission pack" off \
+ ROGUE "Build Ground Zero (Rogue) mission pack" off \
SDL "Build SDL client" on \
XATRIX "Build The Reckoning (Xatrix) mission pack" off \
ZAERO "Build Zaero mission pack" off
@@ -61,11 +57,16 @@ KMQ2_FLARES= Flares.tar
PAX_DATA= paximperia.zip
PAX_PATCH= pax_101_patch.zip
+MOD_LIST= 3ZB2 CTF HYBRID LIGHTS PAX ROGUE XATRIX ZAERO
+
.include "${.CURDIR}/../quake2-data/Makefile.include"
.include <bsd.port.pre.mk>
-MOD_LIST= 3ZB2 CTF HYBRID LIGHTS PAX ROGUE ROGUE_XATRIX XATRIX ZAERO
+.if defined(WITHOUT_CLIENT) && defined(WITHOUT_DEDICATED) && \
+ defined(WITHOUT_SDL)
+IGNORE= needs at least one of CLIENT, DEDICATED and SDL options
+.endif
.for mod in ${MOD_LIST}
. if defined(WITH_${mod})
@@ -84,13 +85,37 @@ EXTRA_PATCHES+= ${FILESDIR}/extra-patch-addons__Makefile
MAKE_ENV+= KMQ2_ADDONS="${KMQ2_ADDONS:S/${EXTRACT_SUFX}//}"
.endif
+.if !defined(WITHOUT_CLIENT) || !defined(WITHOUT_SDL)
+LIB_DEPENDS+= jpeg.9:${PORTSDIR}/graphics/jpeg \
+ openal.0:${PORTSDIR}/audio/openal \
+ png.5:${PORTSDIR}/graphics/png \
+ vorbis.3:${PORTSDIR}/audio/libvorbis
+USE_GL= yes
+.endif
+
+.if !defined(WITHOUT_CLIENT)
+MAKE_ENV+= BUILD_KMQUAKE2=YES
+PLIST_SUB+= CLIENT=""
+Q2BIN+= ${PORTNAME}
+.else
+PLIST_SUB+= CLIENT="@comment "
+.endif
+
.if !defined(WITHOUT_DEDICATED)
-MAKE_ENV+= BUILD_DEDICATED=YES
+MAKE_ENV+= BUILD_KMQUAKE2_DEDICATED=YES
PLIST_SUB+= DEDICATED=""
+Q2BIN+= ${PORTNAME}-ded
.else
PLIST_SUB+= DEDICATED="@comment "
.endif
+.if !defined(WITHOUT_GAME)
+MAKE_ENV+= BUILD_GAME=YES
+PLIST_SUB+= GAME=""
+.else
+PLIST_SUB+= GAME="@comment "
+.endif
+
.if !defined(WITHOUT_OPTIMIZED_CFLAGS)
MAKE_ENV+= OPTIMIZED_CFLAGS=YES
.endif
@@ -107,6 +132,7 @@ PLIST_SUB+= PAX="@comment "
USE_SDL= sdl
MAKE_ENV+= BUILD_KMQUAKE2_SDL=YES
PLIST_SUB+= SDL=""
+Q2BIN+= ${PORTNAME}-sdl
.else
PLIST_SUB+= SDL="@comment "
.endif
@@ -132,12 +158,13 @@ post-extract:
.endif
do-install:
- ${INSTALL_PROGRAM} ${WRKSRC}/quake2/${PORTNAME} ${PREFIX}/bin
-.if !defined(WITHOUT_SDL)
- ${INSTALL_PROGRAM} ${WRKSRC}/quake2/${PORTNAME}-sdl ${PREFIX}/bin
-.endif
+.for bin in ${Q2BIN}
+ ${INSTALL_PROGRAM} ${WRKSRC}/quake2/${bin} ${PREFIX}/bin
+.endfor
${MKDIR} ${LIBDIR}/baseq2
+.if !defined(WITHOUT_GAME)
${CP} -Rp ${WRKSRC}/quake2/baseq2/* ${LIBDIR}/baseq2
+.endif
.if defined(MOD_REQUESTED)
${CP} -Rp ${WRKDIR}/${KMQ2_ADDONS:S/${EXTRACT_SUFX}//}/quake2/* \
${LIBDIR}
diff --git a/games/kmquake2/files/patch-Makefile b/games/kmquake2/files/patch-Makefile
index a2a8708815a4..fa5149d83782 100644
--- a/games/kmquake2/files/patch-Makefile
+++ b/games/kmquake2/files/patch-Makefile
@@ -1,16 +1,18 @@
--- ./Makefile.orig Mon Apr 10 04:38:03 2006
-+++ ./Makefile Sat May 20 13:44:43 2006
++++ ./Makefile Thu Jun 8 15:41:00 2006
@@ -20,12 +20,12 @@
#OPTIONS
######################################
-BUILD_DATADIR=NO # Use DATADIR to read (data, renderers, etc.) and ~/.quake2 to write.
-+BUILD_DATADIR=YES # Use DATADIR to read (data, renderers, etc.) and ~/.quake2 to write.
- BUILD_GAME=YES # game$(ARCH).so
- BUILD_KMQUAKE2=YES # kmquake executable (uses OSS for cdrom and sound)
+-BUILD_GAME=YES # game$(ARCH).so
+-BUILD_KMQUAKE2=YES # kmquake executable (uses OSS for cdrom and sound)
-BUILD_KMQUAKE2_DEDICATED=YES # build a dedicated kmquake2 server
-BUILD_KMQUAKE2_SDL=YES # kmquake2-sdl executable (uses SDL for cdrom and sound)
-BUILD_LIBDIR=NO # Use LIBDIR to read data and renderers (independent from DATADIR).
++BUILD_DATADIR=YES # Use DATADIR to read (data, renderers, etc.) and ~/.quake2 to write.
++#BUILD_GAME=YES # game$(ARCH).so
++#BUILD_KMQUAKE2=YES # kmquake executable (uses OSS for cdrom and sound)
+#BUILD_KMQUAKE2_DEDICATED=YES # build a dedicated kmquake2 server
+#BUILD_KMQUAKE2_SDL=YES # kmquake2-sdl executable (uses SDL for cdrom and sound)
+BUILD_LIBDIR=YES # Use LIBDIR to read data and renderers (independent from DATADIR).
@@ -37,6 +39,15 @@
CLIENT_DIR=$(MOUNT_DIR)/client
SERVER_DIR=$(MOUNT_DIR)/server
+@@ -62,7 +66,7 @@
+ endif
+
+ #Ogg Vorbis support
+-LDFLAGS += \
++CLIENT_LDFLAGS = \
+ -lvorbisfile \
+ -lvorbis \
+ -logg
@@ -72,7 +76,7 @@
X11BASE?=/usr/X11R6
PREFIX?=$(LOCALBASE)
@@ -55,6 +66,24 @@
endif
ifeq ($(strip $(BUILD_KMQUAKE2_SDL)),YES)
+@@ -109,7 +113,7 @@
+
+ DO_CC=$(CC) $(CFLAGS) -I$(LOCALBASE)/include -o $@ -c $<
+ DO_DED_CC=$(CC) $(CFLAGS) -DDEDICATED_ONLY -o $@ -c $<
+-DO_DED_DEBUG_CC=$(CC) $(DEBUG_CFLAGS) -DDEDICATED_ONLY -o $@ -c $<
++DO_DED_DEBUG_CC=$(CC) $(CFLAGS) -DDEDICATED_ONLY -o $@ -c $<
+ DO_SHLIB_CC=$(CC) $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $<
+ DO_GL_SHLIB_CC=$(CC) $(CFLAGS) $(SHLIBCFLAGS) $(GLCFLAGS) -o $@ -c $<
+ DO_AS=$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
+@@ -128,7 +132,7 @@
+ endif
+
+ ifeq ($(strip $(BUILD_KMQUAKE2_DEDICATED)),YES)
+- TARGETS += $(BINDIR)/kmquake2_netserver
++ TARGETS += $(BINDIR)/kmquake2-ded
+ endif
+
+ ifeq ($(strip $(BUILD_KMQUAKE2_SDL)),YES)
@@ -136,7 +140,11 @@
endif
@@ -68,16 +97,52 @@
endif
all:
-@@ -293,6 +301,9 @@
+@@ -164,7 +172,7 @@
+ $(BUILD_DEBUG_DIR)/ref_gl \
+ $(BUILD_DEBUG_DIR)/game
+
+- $(MAKE) targets BUILDDIR=$(BUILD_DEBUG_DIR) CFLAGS+="$(DEBUG_CFLAGS) -DKMQUAKE2_VERSION='\"$(VERSION) Debug\"'"
++ $(MAKE) targets BUILDDIR=$(BUILD_DEBUG_DIR) CFLAGS="$(DEBUG_CFLAGS) -DKMQUAKE2_VERSION='\"$(VERSION) Debug\"'"
+ release:
+
+ @-mkdir -p $(BUILD_RELEASE_DIR) \
+@@ -174,7 +182,7 @@
+ $(BUILD_RELEASE_DIR)/ref_gl \
+ $(BUILD_RELEASE_DIR)/game
+
+- $(MAKE) targets BUILDDIR=$(BUILD_RELEASE_DIR) CFLAGS+="$(RELEASE_CFLAGS) -DKMQUAKE2_VERSION='\"$(VERSION)\"'"
++ $(MAKE) targets BUILDDIR=$(BUILD_RELEASE_DIR) CFLAGS="$(RELEASE_CFLAGS) -DKMQUAKE2_VERSION='\"$(VERSION)\"'"
+
+ targets: $(TARGETS)
+
+@@ -285,13 +293,16 @@
+ @echo
+ @echo "==================== Linking $@ ===================="
@echo
- $(CC) $(CFLAGS) -o $@ $(QUAKE2_OBJS) $(QUAKE2_AS_OBJS) $(QUAKE2_SDL_OBJS) $(GLXLDFLAGS) $(LDFLAGS) $(SDLLDFLAGS)
+- $(CC) $(CFLAGS) -o $@ $(QUAKE2_OBJS) $(QUAKE2_AS_OBJS) $(QUAKE2_LNX_OBJS) $(GLXLDFLAGS) $(LDFLAGS)
++ $(CC) $(CFLAGS) -o $@ $(QUAKE2_OBJS) $(QUAKE2_AS_OBJS) $(QUAKE2_LNX_OBJS) $(GLXLDFLAGS) $(LDFLAGS) $(CLIENT_LDFLAGS)
+ $(BINDIR)/kmquake2-sdl : $(QUAKE2_OBJS) $(QUAKE2_AS_OBJS) $(QUAKE2_SDL_OBJS)
+ @echo
+ @echo "==================== Linking $@ ===================="
+ @echo
+- $(CC) $(CFLAGS) -o $@ $(QUAKE2_OBJS) $(QUAKE2_AS_OBJS) $(QUAKE2_SDL_OBJS) $(GLXLDFLAGS) $(LDFLAGS) $(SDLLDFLAGS)
++ $(CC) $(CFLAGS) -o $@ $(QUAKE2_OBJS) $(QUAKE2_AS_OBJS) $(QUAKE2_SDL_OBJS) $(GLXLDFLAGS) $(LDFLAGS) $(SDLLDFLAGS) $(CLIENT_LDFLAGS)
++
+addons:
+ $(MAKE) -C ../$(KMQ2_ADDONS) release
-+
+
$(BUILDDIR)/client/cl_cin.o : $(CLIENT_DIR)/cl_cin.c
$(DO_CC)
-
+@@ -586,7 +597,7 @@
+ $(BUILDDIR)/ded/cl_null.o \
+ $(BUILDDIR)/ded/cd_null.o
+
+-$(BINDIR)/kmquake2_netserver : $(Q2DED_OBJS)
++$(BINDIR)/kmquake2-ded : $(Q2DED_OBJS)
+ $(CC) $(CFLAGS) -o $@ $(Q2DED_OBJS) $(LDFLAGS)
+
+ $(BUILDDIR)/ded/cmd.o : $(COMMON_DIR)/cmd.c
@@ -753,8 +764,8 @@
$(BUILDDIR)/game/p_weapon.o \
$(BUILDDIR)/game/q_shared.o
diff --git a/games/kmquake2/files/patch-client__snd_loc.h b/games/kmquake2/files/patch-client__snd_loc.h
index d92606a50972..7844aabee6e8 100644
--- a/games/kmquake2/files/patch-client__snd_loc.h
+++ b/games/kmquake2/files/patch-client__snd_loc.h
@@ -1,5 +1,5 @@
--- ./client/snd_loc.h.orig Wed Jan 11 10:51:56 2006
-+++ ./client/snd_loc.h Sat May 20 13:44:43 2006
++++ ./client/snd_loc.h Thu Jun 8 13:39:12 2006
@@ -22,7 +22,7 @@
#ifdef OGG_SUPPORT
#if defined __unix__
diff --git a/games/kmquake2/files/patch-qcommon__files.c b/games/kmquake2/files/patch-qcommon__files.c
index 48e12bec86f6..73e4e79ff4c6 100644
--- a/games/kmquake2/files/patch-qcommon__files.c
+++ b/games/kmquake2/files/patch-qcommon__files.c
@@ -1,5 +1,5 @@
--- ./qcommon/files.c.orig Thu Mar 23 06:30:01 2006
-+++ ./qcommon/files.c Sat May 20 13:44:43 2006
++++ ./qcommon/files.c Thu Jun 8 13:39:12 2006
@@ -1314,7 +1314,7 @@
char *homedir; /* Home directory. */
diff --git a/games/kmquake2/files/patch-unix__gl_glx.c b/games/kmquake2/files/patch-unix__gl_glx.c
index cd18c89ce56e..d81b239ef8de 100644
--- a/games/kmquake2/files/patch-unix__gl_glx.c
+++ b/games/kmquake2/files/patch-unix__gl_glx.c
@@ -1,5 +1,5 @@
--- ./unix/gl_glx.c.orig Mon Apr 3 14:40:42 2006
-+++ ./unix/gl_glx.c Sat May 20 13:51:55 2006
++++ ./unix/gl_glx.c Thu Jun 8 13:39:12 2006
@@ -379,15 +379,11 @@
}
else
diff --git a/games/kmquake2/files/patch-unix__sys_unix.c b/games/kmquake2/files/patch-unix__sys_unix.c
index 3f0eac9af753..48469854ec4e 100644
--- a/games/kmquake2/files/patch-unix__sys_unix.c
+++ b/games/kmquake2/files/patch-unix__sys_unix.c
@@ -1,5 +1,5 @@
--- ./unix/sys_unix.c.orig Thu Apr 6 11:30:11 2006
-+++ ./unix/sys_unix.c Sat May 20 13:44:43 2006
++++ ./unix/sys_unix.c Thu Jun 8 13:39:12 2006
@@ -219,23 +219,10 @@
void *(*GetGameAPI) (void *);
diff --git a/games/kmquake2/pkg-plist b/games/kmquake2/pkg-plist
index 2b0e281029bd..a7f99c71f884 100644
--- a/games/kmquake2/pkg-plist
+++ b/games/kmquake2/pkg-plist
@@ -1,4 +1,5 @@
-bin/kmquake2
+%%CLIENT%%bin/kmquake2
+%%DEDICATED%%bin/kmquake2-ded
%%SDL%%bin/kmquake2-sdl
%%3ZB2%%%%LIBDIR%%/3zb2/kmq2game.so
%%LIBDIR%%/baseq2/gfx/flare1.png
@@ -7,7 +8,7 @@ bin/kmquake2
%%LIBDIR%%/baseq2/gfx/flare4.png
%%LIBDIR%%/baseq2/gfx/flare5.png
%%LIBDIR%%/baseq2/gfx/flare6.png
-%%LIBDIR%%/baseq2/kmq2game.so
+%%GAME%%%%LIBDIR%%/baseq2/kmq2game.so
%%LIBDIR%%/baseq2/kmquake2.pk3
%%CTF%%%%LIBDIR%%/ctf/kmq2game.so
%%LIGHTS%%%%LIBDIR%%/lights/kmq2game.so