2003-06-18 11:21:21 +02:00
|
|
|
# New ports collection makefile for: Quake2-LNX
|
|
|
|
# Date created: 11 Jun 2003
|
|
|
|
# Whom: Alexey Dokuchaev <danfe@regency.nsu.ru>
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
PORTNAME= quake2lnx
|
2005-03-15 20:32:31 +01:00
|
|
|
PORTVERSION= 0.16.2
|
2006-03-21 17:24:32 +01:00
|
|
|
PORTREVISION= 2
|
2003-06-18 11:21:21 +02:00
|
|
|
CATEGORIES= games
|
2005-11-17 11:51:28 +01:00
|
|
|
MASTER_SITES= http://offload1.icculus.org/quake2/files/:icc \
|
|
|
|
http://www.icculus.org/quake2/files/:icc \
|
|
|
|
ftp://ftp.idsoftware.com/idstuff/quake2/source/:id
|
2003-06-18 11:21:21 +02:00
|
|
|
DISTNAME= quake2-r${PORTVERSION}
|
2005-03-15 20:32:31 +01:00
|
|
|
DISTFILES= ${DISTNAME}${EXTRACT_SUFX}:icc
|
2004-05-08 21:01:30 +02:00
|
|
|
DIST_SUBDIR= ${PORTNAME}
|
2003-06-18 11:21:21 +02:00
|
|
|
EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
|
|
|
|
|
2004-08-27 10:46:33 +02:00
|
|
|
MAINTAINER= danfe@FreeBSD.org
|
2003-06-18 11:21:21 +02:00
|
|
|
COMMENT= Cleaned up copy of the original Quake II source code
|
|
|
|
|
|
|
|
USE_GMAKE= yes
|
2004-03-08 02:01:31 +01:00
|
|
|
WANT_SDL= yes
|
2003-06-18 11:21:21 +02:00
|
|
|
|
2006-03-21 12:37:03 +01:00
|
|
|
OPTIONS= X11 "Build X11 software driver" on \
|
2005-11-18 11:02:24 +01:00
|
|
|
GLX "Build GLX driver" on \
|
2006-03-21 12:37:03 +01:00
|
|
|
EYECANDY "Build executable with fancier GL graphics" off \
|
2005-11-18 11:02:24 +01:00
|
|
|
SDL "Build SDL software driver" off \
|
|
|
|
SDLGL "Build SDL OpenGL driver" off \
|
2006-03-21 12:37:03 +01:00
|
|
|
SDLCLIENT "Build executable that uses SDL" off \
|
|
|
|
SVGA "Build SVGA driver (i386 only)" off \
|
|
|
|
AA "Build ASCII software renderer" off \
|
|
|
|
CLIENT "Build client executable" on \
|
2005-11-18 11:02:24 +01:00
|
|
|
SERVER "Build dedicated server executable" on \
|
2006-03-21 12:37:03 +01:00
|
|
|
GAME "Build a main game .so file" on \
|
|
|
|
CTF "Build Capture The Flag mod" off \
|
|
|
|
ROGUE "Build Ground Zero (Rogue) mission pack" off \
|
2005-11-18 11:02:24 +01:00
|
|
|
XATRIX "Build The Reckoning (Xatrix) mission pack" off \
|
2006-03-21 12:37:03 +01:00
|
|
|
RETEXTURE "Enable support of retextured graphics" off \
|
|
|
|
JOYSTICK "Enable joystick support" off \
|
|
|
|
REDBLUE "Enable 3D glasses rendering" off \
|
|
|
|
IPV6 "Enable experimental IPv6 support" off \
|
|
|
|
ARTS "Enable support for aRts sound daemon" off \
|
|
|
|
OPTIMIZED_CFLAGS "Enable extra optimization options" off \
|
2005-11-18 11:02:24 +01:00
|
|
|
X86_ASM "Enable use of x86 assembly code" on
|
2003-06-18 11:21:21 +02:00
|
|
|
|
2005-12-28 22:15:32 +01:00
|
|
|
DATADIR= ${Q2DIR}
|
|
|
|
|
2005-11-17 11:51:28 +01:00
|
|
|
ALL_TARGET= build_release
|
2003-06-18 11:21:21 +02:00
|
|
|
|
2005-11-17 11:51:28 +01:00
|
|
|
PLIST_SUB+= LIBDIR="${LIBDIR:S/${PREFIX}\///}"
|
2003-06-18 11:21:21 +02:00
|
|
|
|
2005-11-17 11:51:28 +01:00
|
|
|
TGTDIR= ${WRKSRC}/release
|
|
|
|
LIBDIR= ${PREFIX}/lib/${PORTNAME}
|
2003-06-18 11:21:21 +02:00
|
|
|
|
2005-11-17 11:51:28 +01:00
|
|
|
.include <bsd.port.pre.mk>
|
2003-06-18 11:21:21 +02:00
|
|
|
|
2006-03-21 12:37:03 +01:00
|
|
|
### #
|
|
|
|
## CLIENTS AND RENDERERS ##
|
|
|
|
# ###
|
2003-06-18 11:21:21 +02:00
|
|
|
|
2006-03-21 12:37:03 +01:00
|
|
|
.if defined(WITH_X11)
|
|
|
|
USE_XLIB= yes
|
|
|
|
MAKE_ARGS+= BUILD_X11=YES
|
|
|
|
REF_TARGETS+= softx
|
|
|
|
PLIST_SUB+= X11=""
|
2003-06-18 11:21:21 +02:00
|
|
|
.else
|
2006-03-21 12:37:03 +01:00
|
|
|
PLIST_SUB+= X11="@comment "
|
2003-06-18 11:21:21 +02:00
|
|
|
.endif
|
|
|
|
|
2005-11-17 11:51:28 +01:00
|
|
|
.if defined(WITH_GLX) || defined(WITH_EYECANDY)
|
|
|
|
USE_GL= yes
|
|
|
|
MAKE_ARGS+= BUILD_GLX=YES
|
|
|
|
REF_TARGETS+= glx
|
|
|
|
PLIST_SUB+= GLX=""
|
2005-03-15 20:32:31 +01:00
|
|
|
.else
|
2005-11-17 11:51:28 +01:00
|
|
|
PLIST_SUB+= GLX="@comment "
|
2005-03-15 20:32:31 +01:00
|
|
|
.endif
|
|
|
|
|
2006-03-21 12:37:03 +01:00
|
|
|
.if defined(WITH_EYECANDY)
|
|
|
|
DISTFILES+= maxpak.pak:icc
|
|
|
|
LIB_DEPENDS+= jpeg.9:${PORTSDIR}/graphics/jpeg
|
|
|
|
MAKE_ARGS+= BUILD_QMAX=YES
|
|
|
|
PLIST_SUB+= QMAX=""
|
2005-11-17 11:51:28 +01:00
|
|
|
.else
|
2006-03-21 12:37:03 +01:00
|
|
|
PLIST_SUB+= QMAX="@comment "
|
2005-03-15 20:32:31 +01:00
|
|
|
.endif
|
|
|
|
|
2005-11-17 11:51:28 +01:00
|
|
|
.if defined(WITH_SDL) || ${HAVE_SDL:Msdl} != ""
|
|
|
|
USE_SDL= sdl
|
|
|
|
MAKE_ARGS+= BUILD_SDL=YES
|
|
|
|
REF_TARGETS+= softsdl
|
|
|
|
PLIST_SUB+= SDL=""
|
|
|
|
.else
|
|
|
|
PLIST_SUB+= SDL="@comment "
|
2003-06-18 11:21:21 +02:00
|
|
|
.endif
|
|
|
|
|
2006-03-21 12:37:03 +01:00
|
|
|
.if defined(WITH_SDLGL) && (defined(WITH_SDL) || ${HAVE_SDL:Msdl} != "")
|
|
|
|
MAKE_ARGS+= BUILD_SDLGL=YES
|
|
|
|
REF_TARGETS+= sdlgl
|
|
|
|
PLIST_SUB+= SDLGL=""
|
|
|
|
.else
|
|
|
|
PLIST_SUB+= SDLGL="@comment "
|
|
|
|
.endif
|
|
|
|
|
2005-11-17 11:51:28 +01:00
|
|
|
.if defined(WITH_SDLCLIENT) && (defined(WITH_SDL) || ${HAVE_SDL:Msdl} != "")
|
|
|
|
MAKE_ARGS+= BUILD_SDLQUAKE2=YES
|
|
|
|
EXE_TARGETS+= sdlquake2
|
|
|
|
PLIST_SUB+= SDLCLIENT=""
|
|
|
|
.else
|
|
|
|
PLIST_SUB+= SDLCLIENT="@comment "
|
2003-06-18 11:21:21 +02:00
|
|
|
.endif
|
|
|
|
|
2006-03-21 12:37:03 +01:00
|
|
|
.if ${ARCH} != "i386" && (defined(WITH_SVGA) || exists(${LOCALBASE}/lib/libvga.so.1))
|
|
|
|
LIB_DEPENDS+= vga.1:${PORTSDIR}/graphics/svgalib
|
|
|
|
MAKE_ARGS+= BUILD_SVGA=YES
|
|
|
|
REF_TARGETS+= soft
|
|
|
|
PLIST_SUB+= SVGA=""
|
2005-11-17 11:51:28 +01:00
|
|
|
.else
|
2006-03-21 12:37:03 +01:00
|
|
|
PLIST_SUB+= SVGA="@comment "
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(WITH_AA) || exists(${LOCALBASE}/lib/libaa.so.1)
|
|
|
|
LIB_DEPENDS+= aa.1:${PORTSDIR}/graphics/aalib
|
|
|
|
MAKE_ARGS+= BUILD_AA=YES
|
|
|
|
REF_TARGETS+= softaa
|
|
|
|
PLIST_SUB+= AA=""
|
|
|
|
.else
|
|
|
|
PLIST_SUB+= AA="@comment "
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(WITH_CLIENT)
|
|
|
|
MAKE_ARGS+= BUILD_CLIENT=YES
|
|
|
|
EXE_TARGETS+= quake2
|
|
|
|
PLIST_SUB+= CLIENT=""
|
|
|
|
.else
|
|
|
|
PLIST_SUB+= CLIENT="@comment "
|
2003-06-18 11:21:21 +02:00
|
|
|
.endif
|
|
|
|
|
2005-11-17 11:51:28 +01:00
|
|
|
.if defined(WITH_SERVER)
|
|
|
|
MAKE_ARGS+= BUILD_DEDICATED=YES
|
|
|
|
PLIST_SUB+= SERVER=""
|
|
|
|
EXE_TARGETS+= q2ded
|
|
|
|
.else
|
|
|
|
PLIST_SUB+= SERVER="@comment "
|
2003-06-18 11:21:21 +02:00
|
|
|
.endif
|
|
|
|
|
2006-03-21 12:37:03 +01:00
|
|
|
### #
|
|
|
|
## GAME, MISSION ADDONS, AND MODS ##
|
|
|
|
# ###
|
|
|
|
|
|
|
|
.if defined(WITH_GAME)
|
|
|
|
MAKE_ARGS+= BUILD_GAME=YES
|
|
|
|
PLIST_SUB+= GAME=""
|
2005-11-17 11:51:28 +01:00
|
|
|
.else
|
2006-03-21 12:37:03 +01:00
|
|
|
PLIST_SUB+= GAME="@comment "
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(WITH_CTF)
|
|
|
|
MAKE_ARGS+= BUILD_CTFDLL=YES
|
|
|
|
PLIST_SUB+= CTF=""
|
|
|
|
.else
|
|
|
|
PLIST_SUB+= CTF="@comment "
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(WITH_ROGUE)
|
|
|
|
DISTFILES+= roguesrc320.shar.Z:id
|
|
|
|
MAKE_ARGS+= BUILD_ROGUE=YES
|
|
|
|
Q2MP+= rogue
|
|
|
|
ROGUE_OFF= 454
|
|
|
|
PLIST_SUB+= ROGUE=""
|
|
|
|
.else
|
|
|
|
PLIST_SUB+= ROGUE="@comment "
|
2003-06-18 11:21:21 +02:00
|
|
|
.endif
|
|
|
|
|
2005-11-17 11:51:28 +01:00
|
|
|
.if defined(WITH_XATRIX)
|
|
|
|
DISTFILES+= xatrixsrc320.shar.Z:id
|
|
|
|
MAKE_ARGS+= BUILD_XATRIX=YES
|
|
|
|
Q2MP+= xatrix
|
|
|
|
XATRIX_OFF= 441
|
|
|
|
PLIST_SUB+= XATRIX=""
|
2005-03-15 20:32:31 +01:00
|
|
|
.else
|
2005-11-17 11:51:28 +01:00
|
|
|
PLIST_SUB+= XATRIX="@comment "
|
2005-03-15 20:32:31 +01:00
|
|
|
.endif
|
|
|
|
|
2006-03-21 12:37:03 +01:00
|
|
|
### #
|
|
|
|
## MISCELLANEOUS TUNABLES ##
|
|
|
|
# ###
|
|
|
|
|
|
|
|
.if defined(WITH_RETEXTURE)
|
|
|
|
. for i in 10 11 12 13 14 16 17 19
|
|
|
|
DISTFILES+= pak${i}.pak:icc
|
|
|
|
. endfor
|
|
|
|
MAKE_ARGS+= BUILD_RETEXTURE=YES
|
|
|
|
PLIST_SUB+= RETEX=""
|
2005-11-17 11:51:28 +01:00
|
|
|
.else
|
2006-03-21 12:37:03 +01:00
|
|
|
PLIST_SUB+= RETEX="@comment "
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(WITH_JOYSTICK)
|
|
|
|
MAKE_ARGS+= BUILD_JOYSTICK=YES
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(WITH_REDBLUE)
|
|
|
|
MAKE_ARGS+= BUILD_REDBLUE=YES
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(WITH_IPV6)
|
|
|
|
MAKE_ARGS+= HAVE_IPV6=YES
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(WITH_ARTS) || exists (${LOCALBASE}/lib/libartsc.so.0)
|
|
|
|
LIB_DEPENDS+= artsc.0:${PORTSDIR}/audio/arts
|
|
|
|
MAKE_ARGS+= BUILD_ARTS=YES
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(WITH_OPTIMIZED_CFLAGS)
|
|
|
|
MAKE_ARGS+= OPTIMIZED_CFLAGS="-O3 -s -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations"
|
2003-06-18 11:21:21 +02:00
|
|
|
.endif
|
|
|
|
|
2005-11-17 11:51:28 +01:00
|
|
|
.if ${ARCH} != "i386" || defined(WITHOUT_X86_ASM)
|
|
|
|
MAKE_ARGS+= NO_X86_ASM=YES
|
|
|
|
.endif
|
2003-06-18 11:21:21 +02:00
|
|
|
|
2006-03-21 12:37:03 +01:00
|
|
|
### #
|
|
|
|
## END OF CONFIGURATION KNOBS ##
|
|
|
|
# ###
|
|
|
|
|
2006-03-21 17:52:50 +01:00
|
|
|
post-extract: .SILENT
|
2005-11-17 11:51:28 +01:00
|
|
|
.for mp in ${Q2MP}
|
2006-03-21 17:52:50 +01:00
|
|
|
${MKDIR} ${WRKSRC}/src/${mp}
|
|
|
|
cd ${WRKSRC}/src/${mp} && ${GUNZIP_CMD} -c \
|
2005-11-17 11:51:28 +01:00
|
|
|
${DISTDIR}/${DIST_SUBDIR}/${mp}src320.shar.Z > \
|
|
|
|
${mp}src320.shar && \
|
2006-03-21 17:52:50 +01:00
|
|
|
${TAIL} +${${mp:U}_OFF} ${mp}src320.shar | ${SH} > /dev/null
|
|
|
|
. if defined(WITH_XATRIX) || defined(WITH_ROGUE)
|
|
|
|
${REINPLACE_CMD} -e 's/__ $$/&|| defined __FreeBSD__/' \
|
|
|
|
${WRKSRC}/src/${mp}/q_shared.c
|
|
|
|
. endif
|
2005-11-17 11:51:28 +01:00
|
|
|
.endfor
|
2003-06-18 11:21:21 +02:00
|
|
|
|
2006-03-21 17:24:32 +01:00
|
|
|
post-patch: .SILENT
|
|
|
|
${REINPLACE_CMD} -e 's|%%DATADIR%%|${DATADIR}| ; \
|
|
|
|
s|%%LIBDIR%%|${LIBDIR}|' ${WRKSRC}/src/qcommon/files.c \
|
|
|
|
${WRKSRC}/src/linux/vid_so.c
|
|
|
|
${REINPLACE_CMD} -e 's|dllname, RTLD_LAZY|& \| RTLD_GLOBAL|' \
|
|
|
|
${WRKSRC}/src/linux/qgl_linux.c
|
2006-03-21 17:52:50 +01:00
|
|
|
.if defined(WITH_ROGUE)
|
|
|
|
${REINPLACE_CMD} -e '/^#include <nan.h>/d' ${WRKSRC}/src/rogue/g_local.h
|
|
|
|
.endif
|
|
|
|
${REINPLACE_CMD} -e 's|/dev/js|/dev/joy|' ${WRKSRC}/src/linux/joystick.c
|
2006-03-21 17:24:32 +01:00
|
|
|
|
2003-06-18 11:21:21 +02:00
|
|
|
do-install:
|
|
|
|
.for tgt in ${EXE_TARGETS}
|
|
|
|
${INSTALL_PROGRAM} ${TGTDIR}/${tgt} ${PREFIX}/bin
|
|
|
|
.endfor
|
2005-11-18 11:02:24 +01:00
|
|
|
@${MKDIR} ${LIBDIR}
|
2003-06-18 11:21:21 +02:00
|
|
|
.for tgt in ${REF_TARGETS}
|
2005-11-17 11:51:28 +01:00
|
|
|
${INSTALL_PROGRAM} ${TGTDIR}/ref_${tgt}.so ${LIBDIR}
|
2003-06-18 11:21:21 +02:00
|
|
|
.endfor
|
|
|
|
.if defined(WITH_CTF)
|
2005-11-18 11:02:24 +01:00
|
|
|
@${MKDIR} ${LIBDIR}/ctf
|
2005-11-17 11:51:28 +01:00
|
|
|
${INSTALL_PROGRAM} ${TGTDIR}/ctf/game.so ${LIBDIR}/ctf
|
2003-06-18 11:21:21 +02:00
|
|
|
.endif
|
2005-11-17 11:51:28 +01:00
|
|
|
.if defined(WITH_EYECANDY)
|
|
|
|
${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/maxpak.pak ${DATADIR}/baseq2
|
2005-03-21 13:22:46 +01:00
|
|
|
.endif
|
2005-11-17 11:51:28 +01:00
|
|
|
.if defined(WITH_GAME)
|
2005-11-18 11:02:24 +01:00
|
|
|
@${MKDIR} ${LIBDIR}/baseq2
|
2005-11-17 11:51:28 +01:00
|
|
|
${INSTALL_PROGRAM} ${TGTDIR}/game.so ${LIBDIR}/baseq2
|
2005-03-15 20:32:31 +01:00
|
|
|
.endif
|
|
|
|
.if defined(WITH_RETEXTURE)
|
2005-11-17 11:51:28 +01:00
|
|
|
. for i in 10 11 12 13 14 16 17 19
|
2005-03-15 20:32:31 +01:00
|
|
|
${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/pak${i}.pak ${DATADIR}/baseq2
|
2005-11-17 11:51:28 +01:00
|
|
|
. endfor
|
2003-06-18 11:21:21 +02:00
|
|
|
.endif
|
2005-11-17 11:51:28 +01:00
|
|
|
.for mp in ${Q2MP}
|
2005-11-18 11:02:24 +01:00
|
|
|
@${MKDIR} ${LIBDIR}/${mp}
|
2005-11-17 11:51:28 +01:00
|
|
|
${INSTALL_PROGRAM} ${TGTDIR}/${mp}/game.so ${LIBDIR}/${mp}
|
|
|
|
.endfor
|
2003-06-18 11:21:21 +02:00
|
|
|
.if !defined(NOPORTDOCS)
|
|
|
|
@${MKDIR} ${DOCSDIR}
|
|
|
|
${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
|
2005-03-15 20:32:31 +01:00
|
|
|
${INSTALL_DATA} ${WRKSRC}/src/docs/README ${DOCSDIR}/README.320
|
|
|
|
${INSTALL_DATA} ${WRKSRC}/src/docs/joystick.txt ${DOCSDIR}
|
|
|
|
${INSTALL_DATA} ${WRKSRC}/src/docs/quake2.3dfxgl ${DOCSDIR}
|
2003-06-18 11:21:21 +02:00
|
|
|
.endif
|
|
|
|
|
2006-03-21 12:37:03 +01:00
|
|
|
.include "${.CURDIR}/../quake2-data/Makefile.include"
|
|
|
|
|
2003-06-18 11:21:21 +02:00
|
|
|
.include <bsd.port.post.mk>
|