termux-packages/x11-packages/the-powder-toy/00-SConscript.patch

116 lines
4.5 KiB
Diff

diff -uNr The-Powder-Toy-95.0/SConscript The-Powder-Toy-95.0.mod/SConscript
--- The-Powder-Toy-95.0/SConscript 2020-02-27 05:38:53.000000000 +0200
+++ The-Powder-Toy-95.0.mod/SConscript 2020-03-08 20:42:15.679348686 +0200
@@ -134,7 +134,7 @@
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:
@@ -142,7 +142,7 @@
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):
@@ -155,12 +155,8 @@
env["BIT"] = 64
#add 32/64 bit defines before configuration
if GetOption('64bit'):
- env.Append(LINKFLAGS=['-m64'])
- env.Append(CCFLAGS=['-m64'])
add64bitflags(env)
elif GetOption('32bit'):
- env.Append(LINKFLAGS=['-m32'])
- env.Append(CCFLAGS=['-m32'])
add32bitflags(env)
if GetOption('universal'):
@@ -242,16 +238,14 @@
runSdlConfig = platform == "Linux" or compilePlatform == "Linux" or platform == "FreeBSD"
if platform == "Darwin" and conf.CheckFramework("SDL2"):
runSdlConfig = False
- elif not conf.CheckLib("SDL2"):
- FatalError("SDL2 development library not found or not installed")
if runSdlConfig:
try:
- env.ParseConfig('sdl2-config --cflags')
+ env.ParseConfig('bash @TERMUX_PREFIX@/bin/sdl2-config --cflags')
if GetOption('static'):
- env.ParseConfig('sdl2-config --static-libs')
+ env.ParseConfig('bash @TERMUX_PREFIX@/bin/sdl2-config --static-libs')
else:
- env.ParseConfig('sdl2-config --libs')
+ env.ParseConfig('bash @TERMUX_PREFIX@/bin/sdl2-config --libs')
except:
pass
@@ -335,19 +329,15 @@
if useCurl and (platform == "Linux" or compilePlatform == "Linux" or platform == "FreeBSD"):
if GetOption('static'):
- env.ParseConfig("curl-config --static-libs")
+ env.ParseConfig("bash @TERMUX_PREFIX@/bin/curl-config --static-libs")
else:
- env.ParseConfig("curl-config --libs")
+ env.ParseConfig("bash @TERMUX_PREFIX@/bin/curl-config --libs")
# Needed for ssl. Scons seems incapable of parsing this out of curl-config
if platform == "Darwin":
if not conf.CheckFramework('Security'):
FatalError("Could not find Security.Framework")
- #Look for pthreads
- if not conf.CheckLib(['pthread', 'pthreadVC2']):
- FatalError("pthreads development library not found or not installed")
-
if msvc:
if not conf.CheckHeader('dirent.h') or not conf.CheckHeader('fftw3.h') or not conf.CheckHeader('pthread.h') or not conf.CheckHeader('zlib.h'):
FatalError("Required headers not found")
@@ -378,9 +368,6 @@
if platform == "Linux" or platform == "FreeBSD":
if not conf.CheckLib('X11'):
FatalError("X11 development library not found or not installed")
-
- if not conf.CheckLib('rt'):
- FatalError("librt not found or not installed")
elif platform == "Windows":
#These need to go last
if not conf.CheckLib('gdi32') or not conf.CheckLib('winmm') or (not msvc and not conf.CheckLib('dxguid')):
@@ -436,8 +423,6 @@
#Add architecture flags and defines
-if isX86:
- env.Append(CPPDEFINES='X86')
if not GetOption('no-sse'):
if GetOption('sse'):
if msvc:
@@ -482,7 +467,7 @@
else:
env.Append(CCFLAGS=['/MD'])
else:
- env.Append(CCFLAGS=['-O3', '-ftree-vectorize', '-funsafe-math-optimizations', '-ffast-math', '-fomit-frame-pointer'])
+ env.Append(CCFLAGS=['-Oz', '-fomit-frame-pointer'])
if platform != "Darwin":
env.Append(CCFLAGS=['-funsafe-loop-optimizations'])
@@ -559,8 +544,8 @@
if platform == "Windows":
sources += env.RES('resources/powder-res.rc')
if not msvc:
- sources = filter(lambda source: not 'src\\simulation\\Gravity.cpp' in str(source), sources)
- sources = filter(lambda source: not 'src/simulation/Gravity.cpp' in str(source), sources)
+ sources = [source for source in sources if not 'src\\simulation\\Gravity.cpp' in str(source)]
+ sources = [source for source in sources if not 'src/simulation/Gravity.cpp' in str(source)]
envCopy = env.Clone()
envCopy.Append(CCFLAGS='-mstackrealign')
sources += envCopy.Object('src/simulation/Gravity.cpp')