ports/101116: [UPDATE] games/sauerbraten: fix building on 4.x and 7.x plus other changes

Alejandro Pulver alepulver at FreeBSD.org
Mon Jul 31 18:10:16 UTC 2006


>Number:         101116
>Category:       ports
>Synopsis:       [UPDATE] games/sauerbraten: fix building on 4.x and 7.x plus other changes
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jul 31 18:10:14 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Alejandro Pulver
>Release:        FreeBSD 6.1-RELEASE-p1 i386
>Organization:
>Environment:


System: FreeBSD 6.1-RELEASE-p1 #3: Mon Jun 19 14:49:35 ART 2006
    root at phobos.mars.bsd:/usr/obj/usr/src/sys/ATHLON-PHOBOS



>Description:


- Fix building on 4.x and 7.x.
- Allow building only the client/server part through OPTIONS.
- Fix wrapper scripts: pass parameters to the real executables.
- Clean-up.
- Respect SDL_CONFIG.


>How-To-Repeat:





>Fix:


--- sauerbraten.diff begins here ---
Index: sauerbraten/Makefile
===================================================================
RCS file: /home/pcvs/ports/games/sauerbraten/Makefile,v
retrieving revision 1.5
diff -u -r1.5 Makefile
--- sauerbraten/Makefile	23 Jul 2006 02:45:23 -0000	1.5
+++ sauerbraten/Makefile	31 Jul 2006 17:59:36 -0000
@@ -9,56 +9,80 @@
 PORTVERSION=	20060611
 CATEGORIES=	games
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
-MASTER_SITE_SUBDIR=	sauerbraten
+MASTER_SITE_SUBDIR=	${PORTNAME}
 DISTNAME=	${PORTNAME}_2006_06_11_sp_edition_linux
 
 MAINTAINER=	acm at FreeBSD.org
 COMMENT=	First person shooter based on Cube
 
-USE_GL=		yes
-USE_SDL=	sdl image mixer
+USE_GCC=	3.2+
 USE_GMAKE=	yes
-USE_AUTOTOOLS=	autoconf:259 aclocal:19 automake:19
 GNU_CONFIGURE=	yes
-AUTOMAKE_ARGS=	-a -c --foreign --add-missing
+CONFIGURE_ENV=	ACLOCAL=true AUTOCONF=true AUTOMAKE=true
 CONFIGURE_WRKSRC=	${WRKSRC}/src/enet
 BUILD_WRKSRC=	${WRKSRC}/src
-WRKSRC=	${WRKDIR}/${PORTNAME}
-SAUDATDIR=	packages data
+WRKSRC=		${WRKDIR}/${PORTNAME}
+ALL_TARGET=	libenet
+
+OPTIONS=	CLIENT "Build client" on \
+		DEDICATED "Build dedicated server" on
+
 SUB_FILES=	sauer_client sauer_server pkg-message
 
+SAUDATDIR=	packages data
+
 .include <bsd.port.pre.mk>
 
-.if ${OSVERSION} < 500000
-BROKEN=		Does not build on 4.x
-.elif ${OSVERSION} > 700016
-BROKEN=		Does not build on CURRENT
+.if !defined(WITH_CLIENT) && !defined(WITH_DEDICATED)
+IGNORE=		needs at least one executable (CLIENT and DEDICATED)
+.endif
+
+.if defined(WITH_CLIENT)
+USE_GL=		yes
+USE_SDL=	image mixer sdl
+ALL_TARGET+=	client
+PLIST_SUB+=	CLIENT=""
+SAUER_BIN+=	client
+.else
+PLIST_SUB+=	CLIENT=""
+.endif
+
+.if defined(WITH_DEDICATED)
+ALL_TARGET+=	server
+PLIST_SUB+=	DEDICATED=""
+SAUER_BIN+=	server
+.else
+PLIST_SUB+=	DEDICATED=""
 .endif
 
 post-extract:
-	@${FIND} ${WRKSRC} -type d -name CVS -type d -print0 | ${XARGS} -0 ${RM} -R
+	@${FIND} ${WRKSRC} -type d -name CVS -type d -print0 | \
+		${XARGS} -0 ${RM} -R
 
 post-patch:
-	@${REINPLACE_CMD} -e 's|%%CXX%%|${CXX}|g ; \
-		s|%%CXXFLAGS%%|${CXXFLAGS}|g ; s|%%X11BASE%%|${X11BASE}|g' \
-			${WRKSRC}/src/Makefile
+	@${REINPLACE_CMD} -Ee '/^#define (HAS_GETHOSTBY(NAME|ADDR)_R) 1/d' \
+		${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
 
 do-install:
-	@${INSTALL_SCRIPT} ${WRKDIR}/sauer_client ${WRKDIR}/sauer_server ${PREFIX}/bin
-	@${INSTALL_PROGRAM} ${BUILD_WRKSRC}/sauer_client ${BUILD_WRKSRC}/sauer_server ${PREFIX}/libexec
-	@${MKDIR} ${DATADIR}
-	@cd ${WRKSRC} && \
+.for f in ${SAUER_BIN}
+	${INSTALL_SCRIPT} ${WRKDIR}/sauer_${f} ${PREFIX}/bin
+	${INSTALL_PROGRAM} ${BUILD_WRKSRC}/sauer_${f} ${PREFIX}/libexec
+.endfor
+	${MKDIR} ${DATADIR}
+	cd ${WRKSRC} && \
 		${FIND} -E ${SAUDATDIR} -type d -exec ${MKDIR} "${DATADIR}/{}" \; && \
 		${FIND} -E ${SAUDATDIR} -type f -iregex ".*\.(png|cfg|cgz|jpg|ogg|ogz|txt|md2|md3|ms3d|qc|wav)" \
 			-exec ${INSTALL_DATA} "{}" "${DATADIR}/{}" \;
 .if !defined(NOPORTDOCS)
-	@${MKDIR} ${DOCSDIR}
-	@cd ${WRKSRC}/docs && \
+	${MKDIR} ${DOCSDIR}
+	cd ${WRKSRC}/docs && \
 		${FIND} -E * -type d -exec ${MKDIR} "${DOCSDIR}/{}" \; && \
 		${FIND} -E * -type f -iregex ".*\.(html|css|jpg)" -exec ${INSTALL_DATA} "{}" "${DOCSDIR}/{}" \;
 .endif
 
 post-install:
+	@${ECHO_CMD}
 	@${CAT} ${PKGMESSAGE}
+	@${ECHO_CMD}
 
 .include <bsd.port.post.mk>
Index: sauerbraten/pkg-plist
===================================================================
RCS file: /home/pcvs/ports/games/sauerbraten/pkg-plist,v
retrieving revision 1.3
diff -u -r1.3 pkg-plist
--- sauerbraten/pkg-plist	15 Jun 2006 12:33:41 -0000	1.3
+++ sauerbraten/pkg-plist	31 Jul 2006 17:59:36 -0000
@@ -1,7 +1,7 @@
-bin/sauer_client
-bin/sauer_server
-libexec/sauer_client
-libexec/sauer_server
+%%CLIENT%%bin/sauer_client
+%%DEDICATED%%bin/sauer_server
+%%CLIENT%%libexec/sauer_client
+%%DEDICATED%%libexec/sauer_server
 %%PORTDOCS%%%%DOCSDIR%%/config.html
 %%PORTDOCS%%%%DOCSDIR%%/dev/sauer_maps_in_max.jpg
 %%PORTDOCS%%%%DOCSDIR%%/dev/sauerchild.JPG
Index: sauerbraten/files/patch-src_Makefile
===================================================================
RCS file: sauerbraten/files/patch-src_Makefile
diff -N sauerbraten/files/patch-src_Makefile
--- sauerbraten/files/patch-src_Makefile	15 Jun 2006 12:33:41 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,30 +0,0 @@
---- src/Makefile	Tue Jun  6 15:25:26 2006
-+++ src/Makefile	Wed Jun 14 01:19:40 2006
-@@ -1,9 +1,8 @@
--CXX=g++
--CXXOPTFLAGS=-Wall -fsigned-char -O3 -fomit-frame-pointer
--CXXFLAGS=$(CXXOPTFLAGS) -Ienet/include -I. -Ishared -Iengine -Ifpsgame `sdl-config --cflags`
-+CXX=%%CXX%%
-+CXXFLAGS=%%CXXFLAGS%% -I%%X11BASE%%/include -Ienet/include -I. -Ishared -Iengine -Ifpsgame `sdl11-config --cflags` -DHAS_SOCKLEN_T
- 
--PLATFORM_PREFIX=linux
--CLIENT_LIBS=-Lenet -lenet `sdl-config --libs` -lSDL_image -lSDL_mixer -lz -lGL -lGLU 
-+PLATFORM_PREFIX=FreeBSD
-+CLIENT_LIBS=-L%%X11BASE%%/lib -Lenet -lenet `sdl11-config --libs` -lSDL_image -lSDL_mixer -lz -lGL -lGLU 
- CLIENT_OBJS= \
- 	shared/tools.o \
- 	engine/client.o \
-@@ -46,11 +45,11 @@
- 	cd enet; ./configure
- 	
- libenet: enet/Makefile
--	-make -C enet/ all
-+	-gmake -C enet/ all
- 
- clean: enet/Makefile
- 	-rm -f $(SERVER_OBJS) $(CLIENT_OBJS) sauer_server sauer_client
--	-make -C enet/ clean
-+	-gmake -C enet/ clean
- 
- engine/server-standalone.o:
- 	$(CXX) $(CXXFLAGS) -DSTANDALONE -c -o engine/server-standalone.o engine/server.cpp
Index: sauerbraten/files/patch-src__Makefile
===================================================================
RCS file: sauerbraten/files/patch-src__Makefile
diff -N sauerbraten/files/patch-src__Makefile
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ sauerbraten/files/patch-src__Makefile	31 Jul 2006 17:59:36 -0000
@@ -0,0 +1,30 @@
+--- ./src/Makefile.orig	Tue Jun  6 17:25:26 2006
++++ ./src/Makefile	Sun Jul 30 15:23:58 2006
+@@ -1,9 +1,9 @@
+-CXX=g++
++CXX?=g++
+ CXXOPTFLAGS=-Wall -fsigned-char -O3 -fomit-frame-pointer
+-CXXFLAGS=$(CXXOPTFLAGS) -Ienet/include -I. -Ishared -Iengine -Ifpsgame `sdl-config --cflags`
++CXXFLAGS+=$(CXXOPTFLAGS) -Ienet/include -I. -Ishared -Iengine -Ifpsgame `$(SDL_CONFIG) --cflags` -I$(X11BASE)/include
+ 
+-PLATFORM_PREFIX=linux
+-CLIENT_LIBS=-Lenet -lenet `sdl-config --libs` -lSDL_image -lSDL_mixer -lz -lGL -lGLU 
++PLATFORM_PREFIX=FreeBSD
++CLIENT_LIBS=-Lenet -lenet `$(SDL_CONFIG) --libs` -lSDL_image -lSDL_mixer -lz -L$(X11BASE)/lib -lGL -lGLU
+ CLIENT_OBJS= \
+ 	shared/tools.o \
+ 	engine/client.o \
+@@ -46,11 +46,11 @@
+ 	cd enet; ./configure
+ 	
+ libenet: enet/Makefile
+-	-make -C enet/ all
++	-$(MAKE) -C enet/ all
+ 
+ clean: enet/Makefile
+ 	-rm -f $(SERVER_OBJS) $(CLIENT_OBJS) sauer_server sauer_client
+-	-make -C enet/ clean
++	-$(MAKE) -C enet/ clean
+ 
+ engine/server-standalone.o:
+ 	$(CXX) $(CXXFLAGS) -DSTANDALONE -c -o engine/server-standalone.o engine/server.cpp
Index: sauerbraten/files/pkg-message.in
===================================================================
RCS file: /home/pcvs/ports/games/sauerbraten/files/pkg-message.in,v
retrieving revision 1.1
diff -u -r1.1 pkg-message.in
--- sauerbraten/files/pkg-message.in	30 Apr 2006 10:25:12 -0000	1.1
+++ sauerbraten/files/pkg-message.in	31 Jul 2006 17:59:36 -0000
@@ -1,9 +1,9 @@
 ###############################################################################
 
-1) First time, sauerbraten create ~/.sauerbraten directory and symlinks
-2) Config files are into ~/.sauerbraten directory.
-3) See %%DATADIR%%/data/keymap.cfg, if you want add new bind into 
-   ~/.sauerbraten/config.cfg
+1) First time, sauerbraten creates a ~/.sauerbraten directory with symlinks.
+2) Config files are in the ~/.sauerbraten directory.
+3) If you want add new bindings into ~/.sauerbraten/config.cfg, see
+   %%DATADIR%%/data/keymap.cfg.
 4) Enjoy it ;)
 
 ###############################################################################
Index: sauerbraten/files/sauer_client.in
===================================================================
RCS file: /home/pcvs/ports/games/sauerbraten/files/sauer_client.in,v
retrieving revision 1.1
diff -u -r1.1 sauer_client.in
--- sauerbraten/files/sauer_client.in	30 Apr 2006 10:25:12 -0000	1.1
+++ sauerbraten/files/sauer_client.in	31 Jul 2006 17:59:36 -0000
@@ -4,13 +4,15 @@
 # configuration in it. We therefore mirror the data directory hierarchy in
 # ~/.sauerbraten, and create symlinks to the data files.
 
-if [ -d "~/.sauerbraten" ]; then
-	cd ~/.sauerbraten || exit 1
-	exec %%PREFIX%%/libexec/sauer_client
+if [ -d ~/.sauerbraten ]
+then
+	echo "Using existing ~/.sauerbraten directory."
 else
+	echo "Creating ~/.sauerbraten directory."
 	cd %%DATADIR%% || exit 1
-	find * -type d -exec mkdir -p ~/.sauerbraten/{} \; || exit 1
-	find * -type f -exec ln -s %%DATADIR%%/{} ~/.sauerbraten/{} \; 2>/dev/null || exit 1
-	cd ~/.sauerbraten || exit 1
-	exec %%PREFIX%%/libexec/sauer_client
+	find * -type d -exec mkdir -p ~/.sauerbraten/{} \;
+	find * -type f -exec ln -s %%DATADIR%%/{} ~/.sauerbraten/{} \; 2>/dev/null
 fi
+
+cd ~/.sauerbraten || exit 1
+exec %%PREFIX%%/libexec/sauer_client "$@"
Index: sauerbraten/files/sauer_server.in
===================================================================
RCS file: /home/pcvs/ports/games/sauerbraten/files/sauer_server.in,v
retrieving revision 1.1
diff -u -r1.1 sauer_server.in
--- sauerbraten/files/sauer_server.in	30 Apr 2006 10:25:12 -0000	1.1
+++ sauerbraten/files/sauer_server.in	31 Jul 2006 17:59:36 -0000
@@ -4,13 +4,15 @@
 # configuration in it. We therefore mirror the data directory hierarchy in
 # ~/.sauerbraten, and create symlinks to the data files.
 
-if [ -d "~/.sauerbraten" ]; then
-	cd ~/.sauerbraten || exit 1
-	exec %%PREFIX%%/libexec/sauer_server
+if [ -d ~/.sauerbraten ]
+then
+	echo "Using existing ~/.sauerbraten directory."
 else
+	echo "Creating ~/.sauerbraten directory."
 	cd %%DATADIR%% || exit 1
-	find * -type d -exec mkdir -p ~/.sauerbraten/{} \; || exit 1
-	find * -type f -exec ln -s %%DATADIR%%/{} ~/.sauerbraten/{} \; 2>/dev/null || exit 1
-	cd ~/.sauerbraten || exit 1
-	exec %%PREFIX%%/libexec/sauer_server
+	find * -type d -exec mkdir -p ~/.sauerbraten/{} \;
+	find * -type f -exec ln -s %%DATADIR%%/{} ~/.sauerbraten/{} \; 2>/dev/null
 fi
+
+cd ~/.sauerbraten || exit 1
+exec %%PREFIX%%/libexec/sauer_server "$@"
--- sauerbraten.diff ends here ---



>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list