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

116 lines
4.5 KiB
Diff
Raw Normal View History

2020-03-08 19:43:50 +01:00
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 @@
2018-09-10 00:42:26 +02:00
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:
2020-03-08 19:43:50 +01:00
@@ -142,7 +142,7 @@
2018-09-10 00:42:26 +02:00
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):
2020-03-08 19:43:50 +01:00
@@ -155,12 +155,8 @@
2018-09-10 00:42:26 +02:00
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'):
2020-03-08 19:43:50 +01:00
@@ -242,16 +238,14 @@
2019-05-19 19:52:39 +02:00
runSdlConfig = platform == "Linux" or compilePlatform == "Linux" or platform == "FreeBSD"
2020-03-08 19:43:50 +01:00
if platform == "Darwin" and conf.CheckFramework("SDL2"):
runSdlConfig = False
- elif not conf.CheckLib("SDL2"):
2019-05-19 19:52:39 +02:00
- FatalError("SDL2 development library not found or not installed")
2018-09-10 00:42:26 +02:00
2019-05-19 19:52:39 +02:00
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
2018-09-10 00:42:26 +02:00
2020-03-08 19:43:50 +01:00
@@ -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")
2018-09-10 00:42:26 +02:00
- #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")
2020-03-08 19:43:50 +01:00
@@ -378,9 +368,6 @@
2018-09-10 00:42:26 +02:00
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')):
2020-03-08 19:43:50 +01:00
@@ -436,8 +423,6 @@
2018-09-10 00:42:26 +02:00
#Add architecture flags and defines
-if isX86:
- env.Append(CPPDEFINES='X86')
if not GetOption('no-sse'):
if GetOption('sse'):
if msvc:
2020-03-08 19:43:50 +01:00
@@ -482,7 +467,7 @@
2018-09-10 00:42:26 +02:00
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'])
2020-03-08 19:43:50 +01:00
@@ -559,8 +544,8 @@
2018-09-10 00:42:26 +02:00
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')