ports/182534: [MAINTAINER] games/assaultcube: Build with newer GCC and Clang compilers (for v1.1.0.4)

Sender Ghost lightside at gmx.com
Tue Oct 1 05:00:01 UTC 2013


>Number:         182534
>Category:       ports
>Synopsis:       [MAINTAINER] games/assaultcube: Build with newer GCC and Clang compilers (for v1.1.0.4)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 01 05:00:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Sender Ghost
>Release:        FreeBSD 9.1-RELEASE
>Organization:
>Environment:
>Description:
Backported some changes from newer 1.2.0.0 beta version to be able compile with newer GCC and Clang compilers. Tested on GCC v4.2 and v4.8, Clang v3.3 (including with "-std=c++11" compiler option).

Also changed launcher scripts and removed the need to create symlinks for data files (as games/redeclipse port's maintainer did).

Notified by:
http://lists.freebsd.org/pipermail/freebsd-pkg-fallout/Week-of-Mon-20130923/023146.html
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -ruN assaultcube.orig/Makefile assaultcube/Makefile
--- assaultcube.orig/Makefile	2013-09-20 21:36:33.000000000 +0400
+++ assaultcube/Makefile	2013-10-01 07:49:46.000000000 +0400
@@ -3,7 +3,7 @@
 
 PORTNAME=	assaultcube
 PORTVERSION=	1.1.0.4
-PORTREVISION=	4
+PORTREVISION=	5
 CATEGORIES=	games
 MASTER_SITES=	SF/actiongame/AssaultCube%20Version%20${PORTVERSION}
 DISTFILES=	AssaultCube_v${PORTVERSION}_source${EXTRACT_SUFX} \
diff -ruN assaultcube.orig/files/assaultcube_client.in assaultcube/files/assaultcube_client.in
--- assaultcube.orig/files/assaultcube_client.in	2012-07-14 17:54:48.000000000 +0400
+++ assaultcube/files/assaultcube_client.in	2013-10-01 06:50:01.000000000 +0400
@@ -1,25 +1,4 @@
 #!/bin/sh
 
-# The executable needs to be run from its data directory, and needs to store
-# configuration in it. We therefore mirror the data directory hierarchy in
-# ~/.XXX, and create symlinks to the data files, but the configuration files
-# are copied, and write permission for the user is added to them.
-
-APPNAME="assaultcube"
-CUBE_OPTIONS="--home=${HOME}/.${APPNAME} --init"
-
-if [ -d ~/.$APPNAME ]
-then
-	echo "Using existing ~/.$APPNAME directory."
-else
-	echo "Creating ~/.$APPNAME directory."
-	cd %%DATADIR%% || exit 1
-	find * -type d -exec mkdir -p ~/.$APPNAME/{} \;
-	find * -type f -name "*.cfg" \
-	    -exec cp %%DATADIR%%/{} ~/.$APPNAME/{} \; \
-	    -exec chmod u+w ~/.$APPNAME/{} \; 2>/dev/null
-	find * -type f -exec ln -s %%DATADIR%%/{} ~/.$APPNAME/{} \; 2>/dev/null
-fi
-
-cd ~/.$APPNAME || exit 1
-exec %%PREFIX%%/libexec/${APPNAME}_client ${CUBE_OPTIONS} "$@"
+CUBE_OPTIONS="--home=${HOME}/.assaultcube --init"
+cd %%DATADIR%% && exec %%PREFIX%%/libexec/assaultcube_client ${CUBE_OPTIONS} "$@"
diff -ruN assaultcube.orig/files/assaultcube_master.in assaultcube/files/assaultcube_master.in
--- assaultcube.orig/files/assaultcube_master.in	2012-07-14 17:54:48.000000000 +0400
+++ assaultcube/files/assaultcube_master.in	2013-10-01 06:40:30.000000000 +0400
@@ -1,25 +1,4 @@
 #!/bin/sh
 
-# The executable needs to be run from its data directory, and needs to store
-# configuration in it. We therefore mirror the data directory hierarchy in
-# ~/.XXX, and create symlinks to the data files, but the configuration files
-# are copied, and write permission for the user is added to them.
-
-APPNAME="assaultcube"
 CUBE_OPTIONS=
-
-if [ -d ~/.$APPNAME ]
-then
-	echo "Using existing ~/.$APPNAME directory."
-else
-	echo "Creating ~/.$APPNAME directory."
-	cd %%DATADIR%% || exit 1
-	find * -type d -exec mkdir -p ~/.$APPNAME/{} \;
-	find * -type f -name "*.cfg" \
-	    -exec cp %%DATADIR%%/{} ~/.$APPNAME/{} \; \
-	    -exec chmod u+w ~/.$APPNAME/{} \; 2>/dev/null
-	find * -type f -exec ln -s %%DATADIR%%/{} ~/.$APPNAME/{} \; 2>/dev/null
-fi
-
-cd ~/.$APPNAME || exit 1
-exec %%PREFIX%%/libexec/${APPNAME}_master ${CUBE_OPTIONS} "$@"
+cd %%DATADIR%% && exec %%PREFIX%%/libexec/assaultcube_master ${CUBE_OPTIONS} "$@"
diff -ruN assaultcube.orig/files/assaultcube_server.in assaultcube/files/assaultcube_server.in
--- assaultcube.orig/files/assaultcube_server.in	2012-07-14 17:54:48.000000000 +0400
+++ assaultcube/files/assaultcube_server.in	2013-10-01 06:40:29.000000000 +0400
@@ -1,25 +1,4 @@
 #!/bin/sh
 
-# The executable needs to be run from its data directory, and needs to store
-# configuration in it. We therefore mirror the data directory hierarchy in
-# ~/.XXX, and create symlinks to the data files, but the configuration files
-# are copied, and write permission for the user is added to them.
-
-APPNAME="assaultcube"
 CUBE_OPTIONS=
-
-if [ -d ~/.$APPNAME ]
-then
-	echo "Using existing ~/.$APPNAME directory."
-else
-	echo "Creating ~/.$APPNAME directory."
-	cd %%DATADIR%% || exit 1
-	find * -type d -exec mkdir -p ~/.$APPNAME/{} \;
-	find * -type f -name "*.cfg" \
-	    -exec cp %%DATADIR%%/{} ~/.$APPNAME/{} \; \
-	    -exec chmod u+w ~/.$APPNAME/{} \; 2>/dev/null
-	find * -type f -exec ln -s %%DATADIR%%/{} ~/.$APPNAME/{} \; 2>/dev/null
-fi
-
-cd ~/.$APPNAME || exit 1
-exec %%PREFIX%%/libexec/${APPNAME}_server ${CUBE_OPTIONS} "$@"
+cd %%DATADIR%% && exec %%PREFIX%%/libexec/assaultcube_server ${CUBE_OPTIONS} "$@"
diff -ruN assaultcube.orig/files/patch-source_src_Makefile assaultcube/files/patch-source_src_Makefile
--- assaultcube.orig/files/patch-source_src_Makefile	2012-07-14 17:54:48.000000000 +0400
+++ assaultcube/files/patch-source_src_Makefile	2013-10-01 06:15:34.000000000 +0400
@@ -16,10 +16,10 @@
  USRLIB=$(shell if [ -e /usr/lib64 ]; then echo "/usr/lib64"; else echo "/usr/lib"; fi)
  override CXXFLAGS+= -rdynamic
 -CLIENT_INCLUDES= $(INCLUDES) -I/usr/include `sdl-config --cflags` -idirafter ../include
-+CLIENT_INCLUDES= $(INCLUDES) `${SDL_CONFIG} --cflags` -I${LOCALBASE}/include -idirafter ../include
++CLIENT_INCLUDES= $(INCLUDES) -I${LOCALBASE}/include `${SDL_CONFIG} --cflags` -idirafter ../include
  # -lSDL_ttf 
 -CLIENT_LIBS= -L../enet/.libs -lenet -L$(USRLIB) `sdl-config --libs` -lSDL_image -lz -lGL -lopenal -lvorbisfile
-+CLIENT_LIBS= -L../enet/.libs -lenet `${SDL_CONFIG} --libs` -L${LOCALBASE}/lib -lSDL_image -lz -lGL -lopenal -lvorbisfile -lintl
++CLIENT_LIBS= -L../enet/.libs -lenet -L${LOCALBASE}/lib -lX11 `${SDL_CONFIG} --libs` -lSDL_image -lz -lGL -lopenal -lvorbisfile -lintl
  endif
  
  CLIENT_OBJS= \
diff -ruN assaultcube.orig/files/patch-source_src_console.h assaultcube/files/patch-source_src_console.h
--- assaultcube.orig/files/patch-source_src_console.h	1970-01-01 03:00:00.000000000 +0300
+++ assaultcube/files/patch-source_src_console.h	2013-10-01 08:15:54.000000000 +0400
@@ -0,0 +1,17 @@
+--- source/src/console.h.orig	2010-11-14 21:46:24.000000000 +0300
++++ source/src/console.h	2013-10-01 08:15:27.000000000 +0400
+@@ -127,7 +127,7 @@
+     }
+ };
+ 
+-/** WIP ALERT */
++/** WIP ALERT *//*
+ struct textinputbuffer_wip
+ {
+     string buf;
+@@ -257,4 +257,4 @@
+         return false;
+     }
+ };
+-
++*/
diff -ruN assaultcube.orig/files/patch-source_src_master.cpp assaultcube/files/patch-source_src_master.cpp
--- assaultcube.orig/files/patch-source_src_master.cpp	1970-01-01 03:00:00.000000000 +0300
+++ assaultcube/files/patch-source_src_master.cpp	2013-10-01 08:05:05.000000000 +0400
@@ -0,0 +1,11 @@
+--- source/src/master.cpp.orig	2010-11-14 21:46:24.000000000 +0300
++++ source/src/master.cpp	2013-10-01 08:04:23.000000000 +0400
+@@ -509,7 +509,7 @@
+     authreq &a = c.authreqs.add();
+     a.reqtime = servtime;
+     a.id = id;
+-    uint seed[3] = { starttime, servtime, randomMT() };
++    uint seed[3] = { (uint)starttime, servtime, randomMT() };
+     static vector<char> buf;
+     buf.setsize(0);
+     a.answer = genchallenge(u->pubkey, seed, sizeof(seed), buf);
diff -ruN assaultcube.orig/files/patch-source_src_modelcache.h assaultcube/files/patch-source_src_modelcache.h
--- assaultcube.orig/files/patch-source_src_modelcache.h	1970-01-01 03:00:00.000000000 +0300
+++ assaultcube/files/patch-source_src_modelcache.h	2013-10-01 07:09:46.000000000 +0400
@@ -0,0 +1,13 @@
+--- source/src/modelcache.h.orig	2010-11-14 21:46:24.000000000 +0300
++++ source/src/modelcache.h	2013-10-01 07:08:22.000000000 +0400
+@@ -31,8 +31,8 @@
+ 
+     void unlink()
+     {
+-        prev->entry::next = next;
+-        next->entry::prev = prev;
++        prev->modelcacheentry<T>::next = next;
++        next->modelcacheentry<T>::prev = prev;
+         prev = next = (T *)this;
+     }
+ 
diff -ruN assaultcube.orig/files/patch-source_src_server.cpp assaultcube/files/patch-source_src_server.cpp
--- assaultcube.orig/files/patch-source_src_server.cpp	1970-01-01 03:00:00.000000000 +0300
+++ assaultcube/files/patch-source_src_server.cpp	2013-10-01 07:52:17.000000000 +0400
@@ -0,0 +1,11 @@
+--- source/src/server.cpp.orig	2010-11-14 21:46:24.000000000 +0300
++++ source/src/server.cpp	2013-10-01 07:51:55.000000000 +0400
+@@ -3928,7 +3928,7 @@
+ 
+     if((isdedicated = dedicated))
+     {
+-        ENetAddress address = { ENET_HOST_ANY, scl.serverport };
++        ENetAddress address = { ENET_HOST_ANY, (enet_uint16)scl.serverport };
+         if(scl.ip[0] && enet_address_set_host(&address, scl.ip)<0) logline(ACLOG_WARNING, "server ip not resolved!");
+         serverhost = enet_host_create(&address, scl.maxclients+1, 3, 0, scl.uprate);
+         if(!serverhost) fatal("could not create server host");
diff -ruN assaultcube.orig/files/patch-source_src_serverms.cpp assaultcube/files/patch-source_src_serverms.cpp
--- assaultcube.orig/files/patch-source_src_serverms.cpp	1970-01-01 03:00:00.000000000 +0300
+++ assaultcube/files/patch-source_src_serverms.cpp	2013-10-01 07:23:41.000000000 +0400
@@ -0,0 +1,11 @@
+--- source/src/serverms.cpp.orig	2010-11-14 21:46:24.000000000 +0300
++++ source/src/serverms.cpp	2013-10-01 07:22:14.000000000 +0400
+@@ -334,7 +334,7 @@
+ 
+ 	if(listen)
+ 	{
+-        ENetAddress address = { ENET_HOST_ANY, infoport };
++        ENetAddress address = { ENET_HOST_ANY, (enet_uint16)infoport };
+         if(*ip)
+         {
+             if(enet_address_set_host(&address, ip)<0) logline(ACLOG_WARNING, "server ip not resolved");
diff -ruN assaultcube.orig/files/patch-source_src_stream.cpp assaultcube/files/patch-source_src_stream.cpp
--- assaultcube.orig/files/patch-source_src_stream.cpp	1970-01-01 03:00:00.000000000 +0300
+++ assaultcube/files/patch-source_src_stream.cpp	2013-10-01 07:56:40.000000000 +0400
@@ -0,0 +1,13 @@
+--- source/src/stream.cpp.orig	2010-11-14 21:46:24.000000000 +0300
++++ source/src/stream.cpp	2013-10-01 07:56:16.000000000 +0400
+@@ -593,8 +593,8 @@
+         }
+         uchar trailer[8] =
+         {
+-            crc&0xFF, (crc>>8)&0xFF, (crc>>16)&0xFF, (crc>>24)&0xFF,
+-            zfile.total_in&0xFF, (zfile.total_in>>8)&0xFF, (zfile.total_in>>16)&0xFF, (zfile.total_in>>24)&0xFF
++            uchar(crc&0xFF), uchar((crc>>8)&0xFF), uchar((crc>>16)&0xFF), uchar((crc>>24)&0xFF),
++            uchar(zfile.total_in&0xFF), uchar((zfile.total_in>>8)&0xFF), uchar((zfile.total_in>>16)&0xFF), uchar((zfile.total_in>>24)&0xFF)
+         };
+         file->write(trailer, sizeof(trailer));
+     }


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


More information about the freebsd-ports-bugs mailing list