Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Aug 2020 11:53:59 +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: r547168 - in head/games/battletanks: . files
Message-ID:  <202008311153.07VBrx6E078740@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: danfe
Date: Mon Aug 31 11:53:59 2020
New Revision: 547168
URL: https://svnweb.freebsd.org/changeset/ports/547168

Log:
  - Finish the conversion to modern Python started with r524492
  - Rename local header to avoid the clash with /usr/include/semaphore.h
    which breaks the build on recent -CURRENT
  
  Reported by:	pkg-fallout

Modified:
  head/games/battletanks/Makefile
  head/games/battletanks/files/patch-SConstruct

Modified: head/games/battletanks/Makefile
==============================================================================
--- head/games/battletanks/Makefile	Mon Aug 31 11:52:54 2020	(r547167)
+++ head/games/battletanks/Makefile	Mon Aug 31 11:53:59 2020	(r547168)
@@ -19,7 +19,7 @@ LIB_DEPENDS=	libsigc-2.0.so:devel/libsigc++20 \
 		libvorbisfile.so:audio/libvorbis \
 		libsmpeg.so:multimedia/smpeg
 
-USES=		lua:51 openal:al pkgconfig python:build scons:python2 sdl tar:bzip2
+USES=		lua:51 openal:al pkgconfig python:build scons sdl tar:bzip2
 USE_CXXSTD=	gnu++98
 USE_LDCONFIG=	yes
 USE_SDL=	image sdl
@@ -37,6 +37,10 @@ OPTIONS_DEFINE=	DOCS
 post-patch:
 	@${REINPLACE_CMD} -e 's/lua5\.1/lua-${LUA_VER}/' \
 		${WRKSRC}/engine/SConscript
+# Prevent the clash with /usr/include/semaphore.h
+	@${MV} ${WRKSRC}/sdlx/semaphore.h ${WRKSRC}/sdlx/sdlx_semaphore.h
+	@${REINPLACE_CMD} -e 's/semaphore\.h"/sdlx_&/' \
+		${WRKSRC}/sdlx/semaphore.cpp ${WRKSRC}/sdlx/thread.h
 
 pre-build:
 # Regenerate `sl08.h' after we patch `sl08.py' (patching the header itself

Modified: head/games/battletanks/files/patch-SConstruct
==============================================================================
--- head/games/battletanks/files/patch-SConstruct	Mon Aug 31 11:52:54 2020	(r547167)
+++ head/games/battletanks/files/patch-SConstruct	Mon Aug 31 11:53:59 2020	(r547168)
@@ -1,5 +1,5 @@
---- SConstruct.orig	2009-12-10 15:58:55.000000000 +0100
-+++ SConstruct	2010-01-16 17:07:22.000000000 +0100
+--- SConstruct.orig	2009-12-10 14:58:55 UTC
++++ SConstruct
 @@ -16,7 +16,7 @@ picLibBuilder = Builder(
  env['BUILDERS']['StaticLibrary'] = picLibBuilder
  env['BUILDERS']['Library'] = picLibBuilder
@@ -25,11 +25,26 @@
  
  opts.Update(env)
  opts.Save('options.cache', env.Clone())
-@@ -57,6 +58,8 @@ if os.environ.has_key('CXXFLAGS'):
+@@ -47,16 +48,18 @@ debug = buildmode == "debug"
+ Export('debug')
+ 
+ import SCons.Util
+-if os.environ.has_key('CC'):
++if 'CC' in os.environ:
+ 	env['CC'] = os.environ['CC']
+-if os.environ.has_key('CFLAGS'):
++if 'CFLAGS' in os.environ:
+ 	env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CFLAGS'])
+-if os.environ.has_key('CXX'):
++if 'CXX' in os.environ:
+ 	env['CXX'] = os.environ['CXX']
+-if os.environ.has_key('CXXFLAGS'):
++if 'CXXFLAGS' in os.environ:
  	env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS'])
- if os.environ.has_key('LDFLAGS'):
+-if os.environ.has_key('LDFLAGS'):
++if 'LDFLAGS' in os.environ:
  	env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])
-+if os.environ.has_key('CPPPATH'):
++if 'CPPPATH' in os.environ:
 +	env['CPPPATH'] = os.environ['CPPPATH'].split()
  
  if (sys.platform != "win32" and env['gcc_visibility']): 
@@ -44,7 +59,36 @@
  		
  	env.Append(CPPFLAGS=['-Wall', '-Wno-deprecated', '-pedantic', '-Wno-long-long', '-pipe', '-pthread'])
  	env.Append(CCFLAGS=['-Wall', '-Wno-deprecated', '-pedantic', '-Wno-long-long', '-pipe', '-pthread'])
-@@ -253,24 +253,28 @@ env.Append(CPPPATH=['#'])
+@@ -205,7 +205,7 @@ try : 
+ 
+ 	except: 
+ 		info = sys.exc_info()
+-		print "%s %s %s" %(info[0], info[1], info[2])
++		print("%s %s %s" %(info[0], info[1], info[2]))
+ except : 
+ 	svnversion = os.popen('svnversion -n .', 'r')
+ 	version = svnversion.readline().strip()
+@@ -238,7 +238,10 @@ except : 
+ 			env.Append(CPPDEFINES='PLUGINS_DIR="\\"' + plugins_dir + '\\""')
+ 
+ version = version[version.rfind(':') + 1:]
+-revision = int(version.replace('M', ''))
++try:
++    revision = int(version.replace('M', ''))
++except ValueError:
++    revision = 0
+ 
+ Export('version')
+ Export('revision')
+@@ -246,31 +249,35 @@ Export('lib_dir')
+ Export('plugins_dir')
+ 
+ version = '0.9.%s' %version
+-print "version: %s" %version
++print("version: %s" %version)
+ 
+ bt_sublibs = ['mrt', 'sdlx', 'objects', 'clunk']
+ env.Append(CPPPATH=['#'])
  
  if (os.path.exists('private')):
  	dir = 'private'



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