diff options
author | Alexey Dokuchaev <danfe@FreeBSD.org> | 2020-08-31 11:53:59 +0000 |
---|---|---|
committer | Alexey Dokuchaev <danfe@FreeBSD.org> | 2020-08-31 11:53:59 +0000 |
commit | d1a3e4e4e9ff7f5baaaaa7350e0529d9f861f3fd (patch) | |
tree | 5f79216d8d461fe2f2f25cdcafd2ba105753f74b /games/battletanks | |
parent | 98ad6a3c9d0b60089dcb3fe1ecc2a110abc8e34b (diff) | |
download | ports-d1a3e4e4e9ff7f5baaaaa7350e0529d9f861f3fd.tar.gz ports-d1a3e4e4e9ff7f5baaaaa7350e0529d9f861f3fd.zip |
- 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
Notes
Notes:
svn path=/head/; revision=547168
Diffstat (limited to 'games/battletanks')
-rw-r--r-- | games/battletanks/Makefile | 6 | ||||
-rw-r--r-- | games/battletanks/files/patch-SConstruct | 56 |
2 files changed, 55 insertions, 7 deletions
diff --git a/games/battletanks/Makefile b/games/battletanks/Makefile index 7bfddc50d1ac..642cb7d5d304 100644 --- a/games/battletanks/Makefile +++ b/games/battletanks/Makefile @@ -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 diff --git a/games/battletanks/files/patch-SConstruct b/games/battletanks/files/patch-SConstruct index 5e4fbb64401b..e684a7ffed8b 100644 --- a/games/battletanks/files/patch-SConstruct +++ b/games/battletanks/files/patch-SConstruct @@ -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' |