1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282
|
Author: Reiner Herrmann <[email protected]>
Description: Fix build with Python3-enabled scons
Bug-Debian: https://bugs.debian.org/947563
--- a/SConstruct
b/SConstruct
@@ -13,19 13,19 @@
def establish_options(env):
- opts = Options('options_cache.py')
opts = Variables('options_cache.py')
opts.Add("CXXFLAGS", "Manually add to the CXXFLAGS", "-g")
opts.Add("LINKFLAGS", "Manually add to the LINKFLAGS", "-g")
if isDarwinPlatform:
- opts.Add(PathOption("INSTALLDIR", "Installation Directory", "./"))
opts.Add(PathVariable("INSTALLDIR", "Installation Directory", "./"))
else:
opts.Add("INSTALLDIR", "Installation Directory", "/usr/local/share")
opts.Add("BINDIR", "Binary Installation Directory", "/usr/local/bin")
opts.Add("DATADIR", "Directory where data will be put, set to the same as INSTALLDIR", "/usr/local/share")
- opts.Add(BoolOption("release", "Build for release", 0))
- opts.Add(BoolOption("profile", "Build with profiling on", 0))
- opts.Add(BoolOption("mingw", "Build with mingw enabled if not auto-detected", 0))
- opts.Add(BoolOption("server", "Build only the YOG server, excluding the game and any GUI/sound components", 0))
opts.Add(BoolVariable("release", "Build for release", 0))
opts.Add(BoolVariable("profile", "Build with profiling on", 0))
opts.Add(BoolVariable("mingw", "Build with mingw enabled if not auto-detected", 0))
opts.Add(BoolVariable("server", "Build only the YOG server, excluding the game and any GUI/sound components", 0))
opts.Add("font", "Build the game using an alternative font placed in the data/font folder", "sans.ttf")
Help(opts.GenerateHelpText(env))
opts.Update(env)
@@ -75,31 75,31 @@
env.Append(CPPDEFINES=["HAVE_CONFIG_H"])
#Simple checks for required libraries
if not conf.CheckLib("SDL") and not server_only:
- print "Could not find libSDL"
print("Could not find libSDL")
missing.append("SDL")
if not conf.CheckLib("SDL_ttf") and not server_only:
- print "Could not find libSDL_ttf"
print("Could not find libSDL_ttf")
missing.append("SDL_ttf")
if not conf.CheckLib("SDL_image") and not server_only:
- print "Could not find libSDL_image"
print("Could not find libSDL_image")
missing.append("SDL_image")
if not conf.CheckLib("SDL_net") and not server_only:
- print "Could not find libSDL_net"
print("Could not find libSDL_net")
missing.append("SDL_net")
if not conf.CheckLib("speex") or not conf.CheckCXXHeader("speex/speex.h") and not server_only:
- print "Could not find libspeex or could not find 'speex/speex.h'"
print("Could not find libspeex or could not find 'speex/speex.h'")
missing.append("speex")
if not conf.CheckLib("vorbisfile") and not server_only:
- print "Could not find libvorbisfile"
print("Could not find libvorbisfile")
missing.append("vorbisfile")
if not conf.CheckLib("vorbis") and not server_only:
- print "Could not find libvorbis"
print("Could not find libvorbis")
missing.append("vorbis")
if not conf.CheckLib("ogg") and not server_only:
- print "Could not find libogg"
print("Could not find libogg")
missing.append("ogg")
if not conf.CheckCXXHeader("zlib.h"):
- print "Could not find zlib.h"
print("Could not find zlib.h")
missing.append("zlib")
else:
if conf.CheckLib("z"):
@@ -107,7 107,7 @@
elif conf.CheckLib("zlib1"):
env.Append(LIBS="zlib1")
else:
- print "Could not find libz or zlib1.dll"
print("Could not find libz or zlib1.dll")
missing.append("zlib")
boost_thread = ''
@@ -116,7 116,7 @@
elif conf.CheckLib("boost_thread-mt") and conf.CheckCXXHeader("boost/thread/thread.hpp"):
boost_thread="boost_thread-mt"
else:
- print "Could not find libboost_thread or libboost_thread-mt or boost/thread/thread.hpp"
print("Could not find libboost_thread or libboost_thread-mt or boost/thread/thread.hpp")
missing.append("libboost_thread")
env.Append(LIBS=[boost_thread])
@@ -126,7 126,7 @@
elif conf.CheckLib("boost_system-mt") and conf.CheckCXXHeader("boost/thread/thread.hpp"):
boost_system="boost_system-mt"
else:
- print "Could not find libboost_system or libboost_system-mt or boost/thread/thread.hpp"
print("Could not find libboost_system or libboost_system-mt or boost/thread/thread.hpp")
missing.append("libboost_system")
env.Append(LIBS=[boost_system])
@@ -136,31 136,31 @@
elif conf.CheckLib("boost_date_time-mt") and conf.CheckCXXHeader("boost/date_time/posix_time/posix_time.hpp"):
boost_thread="boost_thread-mt"
else:
- print "Could not find libboost_date_time or libboost_date_time-mt or boost/thread/thread.hpp"
print("Could not find libboost_date_time or libboost_date_time-mt or boost/thread/thread.hpp")
missing.append("libboost_date_time")
env.Append(LIBS=[boost_date_time])
if not conf.CheckCXXHeader("boost/shared_ptr.hpp"):
- print "Could not find boost/shared_ptr.hpp"
print("Could not find boost/shared_ptr.hpp")
missing.append("boost/shared_ptr.hpp")
if not conf.CheckCXXHeader("boost/tuple/tuple.hpp"):
- print "Could not find boost/tuple/tuple.hpp"
print("Could not find boost/tuple/tuple.hpp")
missing.append("boost/tuple/tuple.hpp")
if not conf.CheckCXXHeader("boost/tuple/tuple_comparison.hpp"):
- print "Could not find boost/tuple/tuple_comparison.hpp"
print("Could not find boost/tuple/tuple_comparison.hpp")
missing.append("boost/tuple/tuple_comparison.hpp")
if not conf.CheckCXXHeader("boost/logic/tribool.hpp"):
- print "Could not find boost/logic/tribool.hpp"
print("Could not find boost/logic/tribool.hpp")
missing.append("boost/logic/tribool.hpp")
if not conf.CheckCXXHeader("boost/lexical_cast.hpp"):
- print "Could not find boost/lexical_cast.hpp"
print("Could not find boost/lexical_cast.hpp")
missing.append("boost/lexical_cast.hpp")
#Do checks for OpenGL, which is different on every system
gl_libraries = []
if isDarwinPlatform and not server_only:
- print "Using Apple's OpenGL framework"
print("Using Apple's OpenGL framework")
env.Append(FRAMEWORKS="OpenGL")
elif conf.CheckLib("GL") and conf.CheckCXXHeader("GL/gl.h") and not server_only:
gl_libraries.append("GL")
@@ -169,12 169,12 @@
elif conf.CheckLib("opengl32") and conf.CheckCXXHeader("GL/gl.h") and not server_only:
gl_libraries.append("opengl32")
elif not server_only:
- print "Could not find libGL or opengl32, or could not find GL/gl.h or OpenGL/gl.h"
print("Could not find libGL or opengl32, or could not find GL/gl.h or OpenGL/gl.h")
missing.append("OpenGL")
#Do checks for GLU, which is different on every system
if isDarwinPlatform and not server_only:
- print "Using Apple's GLUT framework"
print("Using Apple's GLUT framework")
env.Append(FRAMEWORKS="GLUT")
elif conf.CheckLib('GLU') and conf.CheckCXXHeader("GL/glu.h") and not server_only:
gl_libraries.append("GLU")
@@ -183,7 183,7 @@
elif conf.CheckLib('glu32') and conf.CheckCXXHeader('GL/glu.h') and not server_only:
gl_libraries.append("glu32")
elif not server_only:
- print "Could not find libGLU or glu32, or could not find GL/glu.h or OpenGL/glu.h"
print("Could not find libGLU or glu32, or could not find GL/glu.h or OpenGL/glu.h")
missing.append("GLU")
if gl_libraries or isDarwinPlatform:
@@ -198,31 198,31 @@
#Do checks for portaudio
if conf.CheckLib('portaudio') and conf.CheckCXXHeader('portaudio.h'):
if env['mingw'] or isWindowsPlatform:
- print "--------"
- print "NOTE: It appears you are compiling under Windows. At this stage, PortAudio crashes Globulation 2 when voice chat is used."
- print "NOTE: Disabling PortAudio in this build (you will be unable to use Voice Chat ingame)."
- print "--------"
print("--------")
print("NOTE: It appears you are compiling under Windows. At this stage, PortAudio crashes Globulation 2 when voice chat is used.")
print("NOTE: Disabling PortAudio in this build (you will be unable to use Voice Chat ingame).")
print("--------")
else:
if GetOption('portaudio'):
- print "trying to use portaudio"
print("trying to use portaudio")
configfile.add("HAVE_PORTAUDIO ", "Defined when Port Audio support is present and compiled")
env.Append(LIBS=['portaudio'])
else:
- print " no portaudio"
- print " no portaudio - although portaudio was found to be installed, you have "
- print " no portaudio - to explicitly activate it using: "
- print " no portaudio - $ scons --portaudio=true"
- print " no portaudio - this may not work properly if the version of portaudio"
- print " no portaudio - is wrong. portaudio is used to allow communicating over VOIP"
- print " no portaudio"
- print " no portaudio - if you know of a solution to detect portaudio version"
- print " no portaudio - let us know at:"
- print " no portaudio - https://savannah.nongnu.org/bugs/index.php?24668"
- print " no portaudio"
print(" no portaudio")
print(" no portaudio - although portaudio was found to be installed, you have ")
print(" no portaudio - to explicitly activate it using: ")
print(" no portaudio - $ scons --portaudio=true")
print(" no portaudio - this may not work properly if the version of portaudio")
print(" no portaudio - is wrong. portaudio is used to allow communicating over VOIP")
print(" no portaudio")
print(" no portaudio - if you know of a solution to detect portaudio version")
print(" no portaudio - let us know at:")
print(" no portaudio - https://savannah.nongnu.org/bugs/index.php?24668")
print(" no portaudio")
if missing:
for t in missing:
- print "Missing %s" % t
print("Missing %s" % t)
Exit(1)
conf.Finish()
@@ -242,7 242,7 @@
env.Clone = env.Copy
if not env['CC']:
- print "No compiler found in PATH. Please install gcc or another compiler."
print("No compiler found in PATH. Please install gcc or another compiler.")
Exit(1)
env["VERSION"] = "0.9.4.4"
--- a/scons/bundle.py
b/scons/bundle.py
@@ -4,10 4,10 @@
from addDependentLibsToBundle import addDependentLibsToBundle
def run(command) :
- print "\033[32m:: ", command, "\033[0m"
print("\033[32m:: ", command, "\033[0m")
return os.system(command)
def norun(command) :
- print "\033[31mXX ", command, "\033[0m"
print("\033[31mXX ", command, "\033[0m")
@@ -46,7 46,7 @@
return target, source
def generate(env) :
- print "Loading Bundle tool"
print("Loading Bundle tool")
Builder = SCons.Builder.Builder
Action = SCons.Action.Action
bundleBuilder = Builder(
--- a/scons/addDependentLibsToBundle.py
b/scons/addDependentLibsToBundle.py
@@ -4,10 4,10 @@
import sys
def run(command) :
- print "\033[32m:: ", command, "\033[0m"
print("\033[32m:: ", command, "\033[0m")
return os.system(command)
def norun(command) :
- print "\033[31mXX ", command, "\033[0m"
print("\033[31mXX ", command, "\033[0m")
def needsChange(binary, blacklist) :
--- a/scons/dmg.py
b/scons/dmg.py
@@ -15,7 15,7 @@
def generate(env) :
"""Add Builders and construction variables for qt to an Environment."""
- print "Lodading dmg tool..."
print("Lodading dmg tool...")
env.Append( BUILDERS={'Dmg' :
env.Builder( action=env.Action(create_dmg, create_dmg_message ))
} )
--- a/scons/nsis.py
b/scons/nsis.py
@@ -10,7 10,7 @@
def generate(env) :
"""Add Builders and construction variables for qt to an Environment."""
- print "Loading nsis tool..."
print("Loading nsis tool...")
Builder = SCons.Builder.Builder
|