Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Jan 2014 11:38:05 +0000 (UTC)
From:      Alexey Dokuchaev <danfe@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r339772 - in head/games/battletanks: . files
Message-ID:  <201401151138.s0FBc5DQ005311@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: danfe
Date: Wed Jan 15 11:38:05 2014
New Revision: 339772
URL: http://svnweb.freebsd.org/changeset/ports/339772
QAT: https://qat.redports.org/buildarchive/r339772/

Log:
  - Unbreak the build with Clang and remove disgusting USE_GCC knob
  - Rename a patch now that it fixes more than just GCC v4.6 issue
  - Tighten DESKTOP_ENTRIES (do not set Comment and StartupNotify)
  - Fix a few annoying SCons warnings (due to aging SConstruct file)
  - Python is only used for the build, so plain USE_PYTHON is wrong
  - Stagify, mention dedicated server mode availability in pkg-descr

Added:
  head/games/battletanks/files/patch-engine-sl08-sl08.py
     - copied, changed from r339568, head/games/battletanks/files/patch-gcc-4.6
  head/games/battletanks/files/patch-math-range_list.h   (contents, props changed)
Deleted:
  head/games/battletanks/files/patch-gcc-4.6
Modified:
  head/games/battletanks/Makefile
  head/games/battletanks/files/patch-SConstruct
  head/games/battletanks/pkg-descr
  head/games/battletanks/pkg-plist

Modified: head/games/battletanks/Makefile
==============================================================================
--- head/games/battletanks/Makefile	Wed Jan 15 10:24:58 2014	(r339771)
+++ head/games/battletanks/Makefile	Wed Jan 15 11:38:05 2014	(r339772)
@@ -18,27 +18,23 @@ LIB_DEPENDS=	libsigc-2.0.so:${PORTSDIR}/
 
 USES=		openal:al pkgconfig
 USE_BZIP2=	yes
-USE_GCC=	yes
 USE_LDCONFIG=	yes
 USE_LUA=	5.0+
 USE_SDL=	image sdl
 USE_SCONS=	yes
-USE_PYTHON=	yes
-SCONS_ARGS=	prefix=${PREFIX} resources_dir=${DATADIR}
+USE_PYTHON_BUILD=	yes
+SCONS_ARGS=	prefix=${PREFIX} resources_dir=${DATADIR} \
+		--install-sandbox=${STAGEDIR}
 SCONS_BUILDENV=	CC="${CC}" CXX="${CXX}" \
 		CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS} -fpermissive" \
 		LDFLAGS="${LDFLAGS} ${PTHREAD_LIBS}" \
 		CPPPATH="${LOCALBASE}/include" LIBPATH="${LOCALBASE}/lib"
 
-MAN6=		${PORTNAME}.6
-
 PORTDOCS=	LICENSE LICENSE.EXCEPTION README-en.txt README-linux.txt \
 		donate.url homepage.url project_page.url video.txt
 
-DESKTOP_ENTRIES="Battle Tanks" "${COMMENT}" "" "${PORTNAME}" \
-		"Game;ArcadeGame;" false
+DESKTOP_ENTRIES="Battle Tanks" "" "" "${PORTNAME}" "Game;ArcadeGame;" ""
 
-NO_STAGE=	yes
 pre-build:
 # Regenerate `sl08.h' after we patch `sl08.py' (as patching the header itself
 # would have resulted in a larger diff and gratuitous difference with Debian)
@@ -48,11 +44,11 @@ post-install:
 	${INSTALL_DATA} ${WRKSRC}/build/release/clunk/libclunk.so \
 		${WRKSRC}/build/release/engine/libbtanks_engine.so \
 		${WRKSRC}/build/release/mrt/libmrt.so \
-		${WRKSRC}/build/release/sdlx/libsdlx.so ${PREFIX}/lib
-	${INSTALL_MAN} ${FILESDIR}/${MAN6} ${MANPREFIX}/man/man6
-.if !defined(NOPORTDOCS)
-	@${MKDIR} ${DOCSDIR}
-	${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${DOCSDIR}
-.endif
+		${WRKSRC}/build/release/sdlx/libsdlx.so \
+			${STAGEDIR}${PREFIX}/lib
+	${INSTALL_MAN} ${FILESDIR}/${PORTNAME}.6 \
+		${STAGEDIR}${MANPREFIX}/man/man6
+	@${MKDIR} ${STAGEDIR}${DOCSDIR}
+	${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR}
 
 .include <bsd.port.mk>

Modified: head/games/battletanks/files/patch-SConstruct
==============================================================================
--- head/games/battletanks/files/patch-SConstruct	Wed Jan 15 10:24:58 2014	(r339771)
+++ head/games/battletanks/files/patch-SConstruct	Wed Jan 15 11:38:05 2014	(r339772)
@@ -1,6 +1,31 @@
 --- SConstruct.orig	2009-12-10 15:58:55.000000000 +0100
 +++ SConstruct	2010-01-16 17:07:22.000000000 +0100
-@@ -57,6 +57,8 @@
+@@ -16,7 +16,7 @@ picLibBuilder = Builder(
+ env['BUILDERS']['StaticLibrary'] = picLibBuilder
+ env['BUILDERS']['Library'] = picLibBuilder
+ 
+-opts = Options(['options.cache'])
++opts = Variables(['options.cache'])
+ #opts.Add('CC', 'C compiler')
+ #opts.Add('CXX', 'C++ compiler')
+ opts.Add('CCFLAGS', 'General options that are passed to the C compiler')
+@@ -30,12 +30,13 @@ opts.Add('CPPPATH', 'extra cpp path')
+ 
+ if sys.platform != "win32":
+ 	opts.Add('prefix', 'prefix for **nix packaging', '')
++	opts.Add('DESTDIR', 'staging dir (also for packaging)', '')
+ 	opts.Add('lib_dir', 'resources directory (default: prefix/lib)', '')
+ 	opts.Add('plugins_dir', 'plugins directory (default: prefix/lib/btanks)', '')
+ 	opts.Add('resources_dir', 'resources directory (default: prefix/share/btanks)', '')
+-	opts.Add(BoolOption('gcc_visibility', 'gcc visibility', 'true'))
++	opts.Add(BoolVariable('gcc_visibility', 'gcc visibility', 'true'))
+ 
+-opts.Add(EnumOption('mode', 'build mode', 'release', allowed_values=('debug','release')))
++opts.Add(EnumVariable('mode', 'build mode', 'release', allowed_values=('debug','release')))
+ 
+ opts.Update(env)
+ opts.Save('options.cache', env.Clone())
+@@ -57,6 +58,8 @@ if os.environ.has_key('CXXFLAGS'):
  	env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS'])
  if os.environ.has_key('LDFLAGS'):
  	env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])
@@ -9,7 +34,7 @@
  
  if (sys.platform != "win32" and env['gcc_visibility']): 
  	env.Append(CCFLAGS=['-fvisibility=hidden', '-DGCC_HASCLASSVISIBILITY'])
-@@ -98,9 +100,6 @@
+@@ -98,9 +101,6 @@ else:
  	if debug:
  		env.Append(CCFLAGS=['-ggdb', '-D_FORTIFY_SOURCE=2'])
  		env.Append(CPPFLAGS=['-ggdb', '-D_FORTIFY_SOURCE=2'])
@@ -19,3 +44,46 @@
  		
  	env.Append(CPPFLAGS=['-Wall', '-Wno-deprecated', '-pedantic', '-Wno-long-long', '-pipe', '-pthread'])
  	env.Append(CCFLAGS=['-Wall', '-Wno-deprecated', '-pedantic', '-Wno-long-long', '-pipe', '-pthread'])
+@@ -221,7 +221,7 @@ except : 
+ 			if len(env['resources_dir']):
+ 				resources_dir = env['resources_dir']
+ 			else: 
+-				resources_dir = prefix + "/share/btanks"
++				resources_dir = prefix + "/share/btankS"
+ 
+ 			if len(env['lib_dir']):
+ 				lib_dir = env['lib_dir']
+@@ -253,24 +253,28 @@ env.Append(CPPPATH=['#'])
+ 
+ if (os.path.exists('private')):
+ 	dir = 'private'
+-	BuildDir('#/build/' + buildmode + '/' + dir, dir, 0)
++	VariantDir('#/build/' + buildmode + '/' + dir, dir, 0)
+ 	SConscript('#/build/' + buildmode + '/' + dir + '/SConscript')	
+ 
+ for dir in bt_sublibs:
+-	BuildDir('#/build/' + buildmode + '/' + dir, dir, 0)
++	VariantDir('#/build/' + buildmode + '/' + dir, dir, 0)
+ 	SConscript('#/build/' + buildmode + '/' + dir + '/SConscript')
+ 
+ for dir in bt_sublibs:
+ 	env.Append(LIBPATH=['#/build/' + buildmode + '/' + dir])
+ 
+-env.BuildDir('#/build/' + buildmode + '/editor', 'editor', 0)
++env.VariantDir('#/build/' + buildmode + '/editor', 'editor', 0)
+ SConscript('#/build/' + buildmode + '/editor/SConscript')
+ 
+ env.Append(LIBPATH=['#/build/' + buildmode + '/engine'])
+ 
+-env.BuildDir('#/build/' + buildmode + '/engine', 'engine', 0)
++env.VariantDir('#/build/' + buildmode + '/engine', 'engine', 0)
+ SConscript('#/build/' + buildmode + '/engine/' + 'SConscript')
+ 
+ if len(install_targets) > 0:
+-	install_targets.append(env.Command(resources_dir + '/resources.dat', '#/data', 'zip -q -0 -r  $TARGET * -x \*.svn\* -x \*.wav', chdir='data'))
++	install_targets.append(
++	    env.Command(env['DESTDIR'] + resources_dir + '/resources.dat',
++		'#/data',
++		'zip -q -0 -r $TARGET * -x \*.svn\* -x \*.wav',
++		chdir='data'))
+ 	env.Alias('install', install_targets)

Copied and modified: head/games/battletanks/files/patch-engine-sl08-sl08.py (from r339568, head/games/battletanks/files/patch-gcc-4.6)
==============================================================================
--- head/games/battletanks/files/patch-gcc-4.6	Mon Jan 13 05:01:34 2014	(r339568, copy source)
+++ head/games/battletanks/files/patch-engine-sl08-sl08.py	Wed Jan 15 11:38:05 2014	(r339772)
@@ -2,9 +2,11 @@ From: Ansgar Burchardt <ansgar@debian.or
 Bug-Debian: http://bugs.debian.org/624916
 Subject: Fix FTBFS with gcc-4.6
 
+Update: Add missing this->'s to appease Clang
+
 --- engine/sl08/sl08.py.orig
 +++ engine/sl08/sl08.py
-@@ -152,8 +152,8 @@ class Generator(object):
+@@ -152,11 +152,11 @@ class Generator(object):
  			typedef base_signalXXX %s signal_type; 
  			typedef return_type (object_type::*func_t) %s; 
  
@@ -14,8 +16,12 @@ Subject: Fix FTBFS with gcc-4.6
 +			inline slotXXX(object_type *object, func_t func, signal_type * signal = 0) : object(object), func(func) {}
  
  			inline void assign(object_type *o, func_t f) { object = o; func = f; }
- 			inline void assign(object_type *o, func_t f, signal_type &signal_ref = NULL) { object = o; func = f; connect(signal_ref); }
-@@ -187,7 +187,7 @@ class Generator(object):
+-			inline void assign(object_type *o, func_t f, signal_type &signal_ref = NULL) { object = o; func = f; connect(signal_ref); }
++			inline void assign(object_type *o, func_t f, signal_type &signal_ref = NULL) { object = o; func = f; this->connect(signal_ref); }
+ 	
+ 			inline return_type operator() %s const { 
+ 				return (object->*func) %s ;
+@@ -187,10 +187,10 @@ class Generator(object):
  			typedef base_signalXXX %s signal_type; 
  			typedef void (object_type::*func_t) %s ;
  
@@ -23,4 +29,8 @@ Subject: Fix FTBFS with gcc-4.6
 +			inline slotXXX () : object(0), func(0) {}
  			inline slotXXX (object_type *object, func_t func) : object(object), func(func) {}
  			inline void assign(object_type *o, func_t f) { object = o; func = f; }
- 			inline void assign(object_type *o, func_t f, signal_type &signal_ref) { object = o; func = f; connect(signal_ref); }
+-			inline void assign(object_type *o, func_t f, signal_type &signal_ref) { object = o; func = f; connect(signal_ref); }
++			inline void assign(object_type *o, func_t f, signal_type &signal_ref) { object = o; func = f; this->connect(signal_ref); }
+ 	
+ 			inline void operator() %s const { 
+ 				(object->*func) %s; 

Added: head/games/battletanks/files/patch-math-range_list.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/battletanks/files/patch-math-range_list.h	Wed Jan 15 11:38:05 2014	(r339772)
@@ -0,0 +1,19 @@
+--- math/range_list.h.orig	2008-10-24 22:15:55.000000000 +0800
++++ math/range_list.h	2014-01-15 15:44:11.000000000 +0800
+@@ -53,14 +53,14 @@ public: 
+ 			return;
+ 		}
+ 	
+-		typename parent_type::iterator i = lower_bound(value);
++		typename parent_type::iterator i = this->lower_bound(value);
+ 		if (i != parent_type::end()) {
+ 			if (i->first == value)
+ 				return;
+ 
+ 			if (value + 1 == i->first) {
+ 				T e = i->second;
+-				erase(i);
++				this->erase(i);
+ 				i = parent_type::insert(typename parent_type::value_type(value, e)).first; //expand beginning
+ 				i = pack_left(i);
+ 			}

Modified: head/games/battletanks/pkg-descr
==============================================================================
--- head/games/battletanks/pkg-descr	Wed Jan 15 10:24:58 2014	(r339771)
+++ head/games/battletanks/pkg-descr	Wed Jan 15 11:38:05 2014	(r339772)
@@ -16,5 +16,6 @@ you in Battle Tanks.  Some of the game h
     destroyed, weather effects are simulated
   * Lots of war objects: troops, vehicles, helicopters, etc.
   * Keyboard and gamepad are supported
+  * Dedicated server mode (headless)
 
 WWW: http://btanks.sourceforge.net/

Modified: head/games/battletanks/pkg-plist
==============================================================================
--- head/games/battletanks/pkg-plist	Wed Jan 15 10:24:58 2014	(r339771)
+++ head/games/battletanks/pkg-plist	Wed Jan 15 11:38:05 2014	(r339772)
@@ -1,5 +1,6 @@
 bin/btanks
 bin/bted
+man/man6/btanks.6.gz
 lib/btanks/libbt_objects.so
 lib/libbtanks_engine.so
 lib/libclunk.so



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201401151138.s0FBc5DQ005311>