diff -ruN assaultcube.orig/Makefile assaultcube/Makefile --- assaultcube.orig/Makefile 2014-12-08 20:48:38.000000000 +0400 +++ assaultcube/Makefile 2015-02-15 11:39:33.000000000 +0400 @@ -24,23 +24,24 @@ LICENSE_PERMS_OTHER= dist-mirror pkg-mirror auto-accept USES= gmake openal:al tar:bzip2 -GNU_CONFIGURE= yes -ALL_TARGET= libenet +ALL_TARGET= # empty WRKSRC= ${WRKDIR}/AssaultCube_v${PORTVERSION} -CONFIGURE_ARGS= --enable-shared=no --enable-static=yes -CONFIGURE_WRKSRC= ${WRKSRC}/source/enet BUILD_WRKSRC= ${WRKSRC}/source/src PORTDATA= config packages scripts PORTDOCS= * -OPTIONS_DEFINE= DOCS +OPTIONS_DEFINE= DOCS PORT_ENET OPTIONS_MULTI= BUILD OPTIONS_MULTI_BUILD= CLIENT DEDICATED MASTER OPTIONS_DEFAULT= CLIENT DEDICATED CLIENT_DESC= Build client DEDICATED_DESC= Build dedicated server MASTER_DESC= Build master server +PORT_ENET_DESC= Use libenet from net/enet over bundled +PORT_ENET_LIB_DEPENDS= libenet.so:${PORTSDIR}/net/enet +PORT_ENET_ALL_TARGET_OFF= libenet +PORT_ENET_CONFIGURE_OFF= --enable-shared=no --enable-static=yes .include @@ -70,6 +71,30 @@ ACUBE_BIN+= master .endif +.if !${PORT_OPTIONS:MPORT_ENET} +GNU_CONFIGURE= yes +CONFIGURE_WRKSRC= ${WRKSRC}/source/enet +.endif + +post-patch: .SILENT + ${REINPLACE_CMD} -e '/defined/s|FreeBSD|${OPSYS}|g' \ + ${WRKSRC}/source/enet/unix.c + ${REINPLACE_CMD} -e '/^CXXFLAGS=/d ; /^CXX=/d ; \ + /^PLATFORM_PREFIX=/s|native|${OPSYS}|; \ + /^INCLUDES=/s|$$| -I${LOCALBASE}/include| ; \ + s|-I/usr/include || ; \ + s|sdl-config|${SDL_CONFIG}| ; \ + s|-lcurl|& -lintl| ; \ + s|$$(USRLIB)|${LOCALBASE}/lib| ; \ + /^SERVER_LIBS=/s|-lz|& -L${LOCALBASE}/lib|' \ + ${BUILD_WRKSRC}/Makefile +.if ${PORT_OPTIONS:MPORT_ENET} + ${SED} -i .port_enet.bak -e 's/libenet // ; \ + s|-I\.\./enet/include|| ; \ + s|-L\.\./enet/\.libs||' \ + ${BUILD_WRKSRC}/Makefile +.endif + pre-install: .SILENT # Current STAGEDIR doesn't create empty directories for package, # in case of dynamically generated TMPPLIST, where these directories exist diff -ruN assaultcube.orig/files/patch-source_src_Makefile assaultcube/files/patch-source_src_Makefile --- assaultcube.orig/files/patch-source_src_Makefile 2013-11-03 09:10:47.000000000 +0400 +++ assaultcube/files/patch-source_src_Makefile 1970-01-01 03:00:00.000000000 +0300 @@ -1,35 +0,0 @@ ---- source/src/Makefile.orig 2013-10-29 13:20:58.000000000 +0400 -+++ source/src/Makefile 2013-10-29 17:00:06.000000000 +0400 -@@ -1,9 +1,7 @@ --CXXFLAGS= -O3 -fomit-frame-pointer --CXX=clang++ # Use clang++, as g++ optimizations cause crashes... - override CXXFLAGS+= -Wall -fsigned-char - - PLATFORM= $(shell uname -s) --PLATFORM_PREFIX=native -+PLATFORM_PREFIX=FreeBSD - - INCLUDES= -I. -Ibot -I../enet/include - -@@ -22,8 +20,8 @@ - else - USRLIB=$(shell if [ -e /usr/lib64 ]; then echo "/usr/lib64"; else echo "/usr/lib"; fi) - # override CXXFLAGS+= -rdynamic # clang++ doesn't use this... --CLIENT_INCLUDES= $(INCLUDES) -I/usr/include `sdl-config --cflags` -idirafter ../include --CLIENT_LIBS= -L../enet/.libs -lenet -L$(USRLIB) -lX11 `sdl-config --libs` -lSDL_image -lz -lGL -lopenal -lvorbisfile -lcurl -+CLIENT_INCLUDES= $(INCLUDES) -I${LOCALBASE}/include `${SDL_CONFIG} --cflags` -idirafter ../include -+CLIENT_LIBS= -L../enet/.libs -lenet -L${LOCALBASE}/lib -lX11 `${SDL_CONFIG} --libs` -lSDL_image -lz -lGL -lopenal -lvorbisfile -lcurl -lintl - endif - - CLIENT_OBJS= \ -@@ -87,8 +85,8 @@ - SERVER_INCLUDES= -DSTANDALONE $(INCLUDES) -I../include - SERVER_LIBS= -L../lib -lzdll -lenet -llibintl -lws2_32 -lwinmm - else --SERVER_INCLUDES= -DSTANDALONE $(INCLUDES) --SERVER_LIBS= -L../enet/.libs -lenet -lz -+SERVER_INCLUDES= -DSTANDALONE $(INCLUDES) -I${LOCALBASE}/include -+SERVER_LIBS= -L../enet/.libs -lenet -lz -L${LOCALBASE}/lib - endif - - SERVER_OBJS= \