aboutsummaryrefslogtreecommitdiff
path: root/games/sdlquake2
diff options
context:
space:
mode:
authorAlejandro Pulver <alepulver@FreeBSD.org>2006-07-22 19:24:55 +0000
committerAlejandro Pulver <alepulver@FreeBSD.org>2006-07-22 19:24:55 +0000
commit410bfadff0e342a8ab9d892282fef0f7fc1e8e2b (patch)
tree9c100524acca97a0fb313621930075cd626ce45d /games/sdlquake2
parentece6a326a1e80de8b814bec1e73fa7bfbe6b337e (diff)
downloadports-410bfadff0e342a8ab9d892282fef0f7fc1e8e2b.tar.gz
ports-410bfadff0e342a8ab9d892282fef0f7fc1e8e2b.zip
- Add more OPTIONS (allow building without X11 and without game).
Notes
Notes: svn path=/head/; revision=168501
Diffstat (limited to 'games/sdlquake2')
-rw-r--r--games/sdlquake2/Makefile55
-rw-r--r--games/sdlquake2/files/patch-Makefile25
-rw-r--r--games/sdlquake2/pkg-plist8
3 files changed, 69 insertions, 19 deletions
diff --git a/games/sdlquake2/Makefile b/games/sdlquake2/Makefile
index f7df90bf2a22..78e8947d862f 100644
--- a/games/sdlquake2/Makefile
+++ b/games/sdlquake2/Makefile
@@ -13,33 +13,66 @@ MASTER_SITES= http://koti.mbnet.fi/~turol/sdlquake2/
MAINTAINER= alepulver@FreeBSD.org
COMMENT= Combination of R1Q2 and R1GL with SDL code from Quake2Forge
-LIB_DEPENDS= execinfo.1:${PORTSDIR}/devel/libexecinfo \
- jpeg.9:${PORTSDIR}/graphics/jpeg \
- png.5:${PORTSDIR}/graphics/png
+LIB_DEPENDS= execinfo.1:${PORTSDIR}/devel/libexecinfo
USE_BZIP2= yes
USE_GCC= 3.2+
USE_GMAKE= yes
-USE_GL= yes
-USE_SDL= sdl
-MAKE_ENV= LIBDIR="${LIBDIR}"
+OPTIONS= CLIENT "Build client" on \
+ DEDICATED "Build dedicated server" on \
+ GAME "Build main game modification" on
LIBDIR= ${PREFIX}/lib/${PORTNAME}
+MAKE_ENV= LIBDIR="${LIBDIR}"
PLIST_SUB= LIBDIR=${LIBDIR:S/${PREFIX}\///}
+
+.include "${.CURDIR}/../quake2-data/Makefile.include"
+
+.include <bsd.port.pre.mk>
+
+.if defined(WITH_CLIENT)
+LIB_DEPENDS+= jpeg.9:${PORTSDIR}/graphics/jpeg \
+ png.5:${PORTSDIR}/graphics/png
+USE_GL= yes
+USE_SDL= sdl
+MAKE_ENV+= BUILD_CLIENT=YES
+PLIST_SUB+= CLIENT=""
+.else
+PLIST_SUB+= CLIENT="@comment "
+.endif
+
+.if defined(WITH_DEDICATED)
+MAKE_ENV+= BUILD_DEDICATED=YES
+PLIST_SUB+= DEDICATED=""
+.else
+PLIST_SUB+= DEDICATED="@comment "
+.endif
+
+.if defined(WITH_GAME)
+MAKE_ENV+= BUILD_GAME=YES
+PLIST_SUB+= GAME=""
+.else
+PLIST_SUB+= GAME="@comment "
+.endif
+
do-install:
${MKDIR} ${LIBDIR}/baseq2
- ${INSTALL_PROGRAM} ${WRKSRC}/ref_sdlgl.so ${LIBDIR}
- ${INSTALL_PROGRAM} ${WRKSRC}/baseq2/game.so ${LIBDIR}/baseq2
+.if defined(WITH_CLIENT)
${INSTALL_PROGRAM} ${WRKSRC}/quake2 ${PREFIX}/bin/${PORTNAME}
+ ${INSTALL_PROGRAM} ${WRKSRC}/ref_sdlgl.so ${LIBDIR}
+.endif
+.if defined(WITH_DEDICATED)
${INSTALL_PROGRAM} ${WRKSRC}/q2ded ${PREFIX}/bin/${PORTNAME}-ded
+.endif
+.if defined(WITH_GAME)
+ ${INSTALL_PROGRAM} ${WRKSRC}/baseq2/game.so ${LIBDIR}/baseq2
+.endif
post-install:
@${ECHO_CMD}
@${CAT} ${PKGMESSAGE}
@${ECHO_CMD}
-.include "${.CURDIR}/../quake2-data/Makefile.include"
-
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/games/sdlquake2/files/patch-Makefile b/games/sdlquake2/files/patch-Makefile
index 1254e31ae689..5b764d456808 100644
--- a/games/sdlquake2/files/patch-Makefile
+++ b/games/sdlquake2/files/patch-Makefile
@@ -1,6 +1,6 @@
---- ./Makefile.orig Thu May 19 17:56:13 2005
-+++ ./Makefile Sun Feb 26 11:24:53 2006
-@@ -1,5 +1,18 @@
+--- Makefile.orig Thu May 19 17:56:13 2005
++++ Makefile Sat Jul 22 16:05:33 2006
+@@ -1,9 +1,34 @@
-CC:=gcc
-CFLAGS:=-O3 -ffast-math -march=athlon-xp -g -Wall $(shell sdl-config --cflags)
+CC?=gcc
@@ -21,7 +21,24 @@
GAMES:=baseq2
-@@ -43,15 +56,14 @@
+-TARGETS:=quake2 q2ded ref_sdlgl.so $(foreach game, $(GAMES), $(game)/game.so)
++TARGETS:=
++
++ifeq ($(strip $(BUILD_CLIENT)),YES)
++TARGETS+=quake2 ref_sdlgl.so
++endif
++
++ifeq ($(strip $(BUILD_DEDICATED)),YES)
++TARGETS+=q2ded
++endif
++
++ifeq ($(strip $(BUILD_GAME)),YES)
++TARGETS+=$(foreach game, $(GAMES), $(game)/game.so)
++endif
+
+ .PHONY: default all clean distclean
+
+@@ -43,15 +68,14 @@
@sed "s@^\(.*\)\.o:@$(dir $*)\1.o:@" < .depends/$*.d > .depends/$*.d.new
@mv .depends/$*.d.new .depends/$*.d
diff --git a/games/sdlquake2/pkg-plist b/games/sdlquake2/pkg-plist
index 5e1ec27bd9c7..a05e50c88dc4 100644
--- a/games/sdlquake2/pkg-plist
+++ b/games/sdlquake2/pkg-plist
@@ -1,6 +1,6 @@
-bin/sdlquake2
-bin/sdlquake2-ded
-%%LIBDIR%%/baseq2/game.so
-%%LIBDIR%%/ref_sdlgl.so
+%%CLIENT%%bin/sdlquake2
+%%DEDICATED%%bin/sdlquake2-ded
+%%GAME%%%%LIBDIR%%/baseq2/game.so
+%%CLIENT%%%%LIBDIR%%/ref_sdlgl.so
@dirrm %%LIBDIR%%/baseq2
@dirrm %%LIBDIR%%