- Fix build with clang (global var defined as static,

unrecognized compiler arguments)
- Add staging support
- Use options subs

MFH:		2014Q2
This commit is contained in:
Pawel Pekala 2014-04-18 09:16:29 +00:00
parent 1b6a0aa634
commit edd8b88ba6
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=351523
3 changed files with 23 additions and 18 deletions

View file

@ -14,9 +14,10 @@ COMMENT= Quake III engine with Cell Shading capabilities
ONLY_FOR_ARCHS= i386
ONLY_FOR_ARCHS_REASON= does not run properly; try games/ioquake3 with option
USES= gmake dos2unix zip
USES= compiler dos2unix gmake zip
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
BUILD_WRKSRC= ${WRKSRC}/code/unix
MAKE_JOBS_UNSAFE= yes
LIBDIR= ${PREFIX}/lib/${PORTNAME}
MAKE_ENV= LIBDIR="${LIBDIR}"
@ -28,13 +29,13 @@ OPTIONS_DEFINE= GAMELIBS OPTIMIZED_CFLAGS
OPTIONS_MULTI= FLAVOR
OPTIONS_MULTI_FLAVOR= CLIENT DEDICATED SMP_CLIENT
OPTIONS_DEFAULT= CLIENT DEDICATED OPTIMIZED_CFLAGS SMP_CLIENT
OPTIONS_SUB= yes
CLIENT_DESC= Build client
DEDICATED_DESC= Build dedicated server
GAMELIBS_DESC= Force building game libraries
SMP_CLIENT_DESC= Build SMP (threaded) client
NO_STAGE= yes
.include <bsd.port.pre.mk>
.if ${ARCH} == "i386"
@ -58,25 +59,16 @@ USE_XORG= xxf86dga
.if ${PORT_OPTIONS:MCLIENT}
MAKE_ENV+= CLIENT=YES
PLIST_SUB+= CLIENT=""
Q3BIN+= quake3
.else
PLIST_SUB+= CLIENT="@comment "
.endif
.if ${PORT_OPTIONS:MDEDICATED}
MAKE_ENV+= DEDICATED=YES
PLIST_SUB+= DEDICATED=""
Q3BIN+= q3ded
.else
PLIST_SUB+= DEDICATED="@comment "
.endif
.if ${PORT_OPTIONS:MGAMELIBS} || !defined(HAVE_VM_COMPILED)
MAKE_ENV+= GAMELIBS=YES
PLIST_SUB+= GAMELIBS=""
.else
PLIST_SUB+= GAMELIBS="@comment "
.endif
.if ${PORT_OPTIONS:MOPTIMIZED_CFLAGS}
@ -85,10 +77,7 @@ MAKE_ENV+= OPTIMIZED_CFLAGS=YES
.if ${PORT_OPTIONS:MSMP_CLIENT}
MAKE_ENV+= SMP=YES PTHREAD_LIBS="${PTHREAD_LIBS}"
PLIST_SUB+= SMP=""
Q3BIN+= quake3-smp
.else
PLIST_SUB+= SMP="@comment "
.endif
post-patch:
@ -98,17 +87,22 @@ post-patch:
's|//[[:blank:]]*\(Swap_Init[[:blank:]]*();\)|\1|' \
${WRKSRC}/code/botlib/be_interface.c \
${WRKSRC}/code/renderer/tr_init.c
.if ${COMPILER_TYPE} == clang
@${REINPLACE_CMD} -E 's,-falign-(jumps|loops)=2,,g; s|-O6||' \
${WRKSRC}/code/unix/Makefile
.endif
do-install:
.for bin in ${Q3BIN}
# Adjust program names to avoid conflicts with other Quake3 ports
${INSTALL_PROGRAM} ${BUILD_WRKSRC}/release/${bin} \
${PREFIX}/bin/${bin:C/(quake3|q3)/\1cel/}
${STAGEDIR}${PREFIX}/bin/${bin:C/(quake3|q3)/\1cel/}
.endfor
.if ${PORT_OPTIONS:MGAMELIBS} || !defined(HAVE_VM_COMPILED)
.for dir in baseq3 missionpack
@${MKDIR} ${LIBDIR}/${dir}
${INSTALL_PROGRAM} ${BUILD_WRKSRC}/release/${dir}/*.so ${LIBDIR}/${dir}
@${MKDIR} ${STAGEDIR}${LIBDIR}/${dir}
${INSTALL_PROGRAM} ${BUILD_WRKSRC}/release/${dir}/*.so \
${STAGEDIR}${LIBDIR}/${dir}
.endfor
.endif

View file

@ -0,0 +1,11 @@
--- code/qcommon/vm_x86.c.orig 2014-04-17 13:05:34.157088687 +0200
+++ code/qcommon/vm_x86.c 2014-04-17 12:58:45.706901862 +0200
@@ -84,7 +84,7 @@
#endif // !_WIN32
-static int callMask = 0; // bk001213 - init
+ int callMask = 0; // bk001213 - init
static int instruction, pass;
static int lastConst = 0;

View file

@ -1,6 +1,6 @@
%%DEDICATED%%bin/q3celded
%%CLIENT%%bin/quake3cel
%%SMP%%bin/quake3cel-smp
%%SMP_CLIENT%%bin/quake3cel-smp
%%GAMELIBS%%%%LIBDIR%%/baseq3/cgame.so
%%GAMELIBS%%%%LIBDIR%%/baseq3/qagame.so
%%GAMELIBS%%%%LIBDIR%%/baseq3/ui.so