Author: Reiner Herrmann <reiner@reiner-h.de>
Description: Fix build with recent scons version
Bug-Debian: https://bugs.debian.org/947555

--- a/SConstruct
+++ b/SConstruct
@@ -16,7 +16,7 @@
 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')
@@ -33,9 +33,9 @@
 	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())
@@ -47,15 +47,15 @@
 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 'LDFLAGS' in os.environ:
 	env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])
 
 if (sys.platform != "win32" and env['gcc_visibility']): 
@@ -174,7 +174,7 @@
 lib_dir = '.'
 plugins_dir = ''
 try : 
-	version_file = file('.svnversion', 'r')
+	version_file = open('.svnversion', 'r')
 	try : 
 		version = version_file.readline().strip()
 		prefix = env['prefix']
@@ -202,7 +202,7 @@
 
 	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()
@@ -243,29 +243,29 @@
 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'
-	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:
--- a/mrt/SConscript
+++ b/mrt/SConscript
@@ -20,7 +20,7 @@
 	'net_exception.cpp', 'dict_serializator.cpp', 
 	], LIBS=libs)
 
-if sys.platform != 'win32' and env.has_key('prefix') and len(env['prefix']) > 0:
+if sys.platform != 'win32' and 'prefix' in env and len(env['prefix']) > 0:
 	Import('install_targets')
 	Import('lib_dir')
 	install_targets.append(Install(lib_dir, mrt))
