aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpawel <pawel@FreeBSD.org>2014-04-18 17:16:29 +0800
committerpawel <pawel@FreeBSD.org>2014-04-18 17:16:29 +0800
commit24795f34832e83cd2d826b9a5bc37d297e32645e (patch)
treef9c81fd754e7a603f8c73628ac04e5758c24c886
parent77108087199dc184736cc74e900e6315cc63ebc6 (diff)
downloadfreebsd-ports-gnome-24795f34832e83cd2d826b9a5bc37d297e32645e.tar.gz
freebsd-ports-gnome-24795f34832e83cd2d826b9a5bc37d297e32645e.tar.zst
freebsd-ports-gnome-24795f34832e83cd2d826b9a5bc37d297e32645e.zip
- Fix build with clang (global var defined as static,
unrecognized compiler arguments) - Add staging support - Use options subs MFH: 2014Q2
-rw-r--r--games/q3cellshading/Makefile28
-rw-r--r--games/q3cellshading/files/patch-code-qcommon-vm_x86.c11
-rw-r--r--games/q3cellshading/pkg-plist2
3 files changed, 23 insertions, 18 deletions
diff --git a/games/q3cellshading/Makefile b/games/q3cellshading/Makefile
index bd5ded09b76a..385ae31185e0 100644
--- a/games/q3cellshading/Makefile
+++ b/games/q3cellshading/Makefile
@@ -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
diff --git a/games/q3cellshading/files/patch-code-qcommon-vm_x86.c b/games/q3cellshading/files/patch-code-qcommon-vm_x86.c
new file mode 100644
index 000000000000..444315c8afdf
--- /dev/null
+++ b/games/q3cellshading/files/patch-code-qcommon-vm_x86.c
@@ -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;
diff --git a/games/q3cellshading/pkg-plist b/games/q3cellshading/pkg-plist
index 27716699bb1a..097a39e17dd1 100644
--- a/games/q3cellshading/pkg-plist
+++ b/games/q3cellshading/pkg-plist
@@ -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