File The-Powder-Toy-92.5-scons-3.patch of Package powdertoy
From: Andreas Stieger <astieger@suse.com>
Date: Mon, 20 Nov 2017 20:45:34 +0100
Subject: Fix build with scons 3
Upstream: committed
References: https://github.com/ThePowderToy/The-Powder-Toy/commit/1c275e943fd84a324c68f658aea6834b590369a0 https://github.com/ThePowderToy/The-Powder-Toy/commit/c0bb5882b4b21b7bfd59735526f31eb7baaa65e8 https://github.com/ThePowderToy/The-Powder-Toy/commit/553b36b31cc79731778c1a392bce95fc94d56a71
Index: The-Powder-Toy-92.5/SConscript
===================================================================
--- The-Powder-Toy-92.5.orig/SConscript
+++ The-Powder-Toy-92.5/SConscript
@@ -21,9 +21,9 @@ class ourSpawn:
data, err = proc.communicate()
rv = proc.wait()
if rv:
- print "====="
- print err
- print "====="
+ print("=====")
+ print(err)
+ print("=====")
return rv
def SetupSpawn(env):
buf = ourSpawn()
@@ -137,7 +137,7 @@ if tool:
for var in ["CC","CXX","LD","LIBPATH","STRIP"]:
if var in os.environ:
env[var] = os.environ[var]
- print "copying environment variable {0}={1!r}".format(var,os.environ[var])
+ print("copying environment variable {0}={1!r}".format(var,os.environ[var]))
# variables containing several space separated things
for var in ["CFLAGS","CCFLAGS","CXXFLAGS","LINKFLAGS","CPPDEFINES","CPPPATH"]:
if var in os.environ:
@@ -145,7 +145,7 @@ for var in ["CFLAGS","CCFLAGS","CXXFLAGS
env[var] += SCons.Util.CLVar(os.environ[var])
else:
env[var] = SCons.Util.CLVar(os.environ[var])
- print "copying environment variable {0}={1!r}".format(var,os.environ[var])
+ print("copying environment variable {0}={1!r}".format(var,os.environ[var]))
#Used for intro text / executable name, actual bit flags are only set if the --64bit/--32bit command line args are given
def add32bitflags(env):
@@ -377,7 +377,7 @@ if GetOption('clean'):
try:
shutil.rmtree("generated/")
except:
- print "couldn't remove build/generated/"
+ print("couldn't remove build/generated/")
elif not GetOption('help'):
conf = Configure(env)
conf.AddTest('CheckFramework', CheckFramework)
@@ -417,7 +417,7 @@ elif platform == "Darwin":
env.Append(CPPDEFINES=['MACOSX'])
#env.Append(LINKFLAGS=['-headerpad_max_install_names']) #needed in some cross compiles
if GetOption('luajit'):
- env.Append(LINKFLAGS=['-pagezero_size=10000', '-image_base=100000000'])
+ env.Append(LINKFLAGS=['-pagezero_size', '10000', '-image_base', '100000000'])
#Add architecture flags and defines
Index: The-Powder-Toy-92.5/SConstruct
===================================================================
--- The-Powder-Toy-92.5.orig/SConstruct
+++ The-Powder-Toy-92.5/SConstruct
@@ -1,6 +1,12 @@
+import sys
#run generator.py
if not GetOption('clean'):
- execfile("generator.py")
+ if sys.version_info[0] < 3:
+ execfile("generator.py")
+ else:
+ with open("generator.py") as f:
+ code = compile(f.read(), "generator.py", 'exec')
+ exec(code)
AddOption('--builddir',dest="builddir",default="build",help="Directory to build to.")
SConscript('SConscript', variant_dir=GetOption('builddir'), duplicate=0)
@@ -9,14 +15,14 @@ if GetOption('clean'):
try:
shutil.rmtree(".sconf_temp/")
except:
- print "couldn't remove .sconf_temp/"
+ print("couldn't remove .sconf_temp/")
try:
shutil.rmtree("generated/")
except:
- print "couldn't remove generated/"
+ print("couldn't remove generated/")
try:
os.remove(".sconsign.dblite")
except:
- print "couldn't remove .sconsign.dblite"
+ print("couldn't remove .sconsign.dblite")