Skip to content

Commit

Permalink
Made build with scons 3.0.0 work fixing issue #2093
Browse files Browse the repository at this point in the history
  • Loading branch information
loonycyborg authored and GregoryLundberg committed Nov 30, 2017
1 parent babcf80 commit 86ebdef
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions SConstruct
Expand Up @@ -17,7 +17,7 @@ from os import access, F_OK
# Warn user of current set of build options.
AddOption('--option-cache', dest='option_cache', nargs=1, type = 'string', action = 'store', metavar = 'FILE', help='file with cached construction variables', default = '.scons-option-cache')
if os.path.exists(GetOption("option_cache")):
optfile = file(GetOption("option_cache"))
optfile = open(GetOption("option_cache"))
print("Saved options: {}".format(optfile.read().replace("\n", ", ")[:-2]))
optfile.close()

Expand All @@ -26,7 +26,7 @@ if os.path.exists(GetOption("option_cache")):
#

config_h_re = re.compile(r"^.*#define\s*(\S*)\s*\"(\S*)\".*$", re.MULTILINE)
build_config = dict( config_h_re.findall(File("src/wesconfig.h").get_contents()) )
build_config = dict( config_h_re.findall(File("src/wesconfig.h").get_contents().decode("utf-8")) )
try:
version = build_config["VERSION"]
print("Building Wesnoth version %s" % version)
Expand Down Expand Up @@ -231,7 +231,7 @@ specifying --option-cache=FILE command line argument. Current option values can
If you set CXXFLAGS and/or LDFLAGS in the environment, the values will
be appended to the appropriate variables within scons.
""" + opts.GenerateHelpText(env, sort=cmp))
""" + opts.GenerateHelpText(env))

if GetOption("help"):
Return()
Expand Down Expand Up @@ -619,7 +619,7 @@ def CopyFilter(fn):

env["copy_filter"] = CopyFilter

linguas = Split(File("po/LINGUAS").get_contents())
linguas = Split(File("po/LINGUAS").get_contents().decode("utf-8"))

def InstallManpages(env, component):
env.InstallData("mandir", component, os.path.join("doc", "man", component + ".6"), "man6")
Expand Down
8 changes: 4 additions & 4 deletions po/SConscript
Expand Up @@ -4,7 +4,7 @@ from subprocess import Popen, PIPE
import os, shutil
import re
from fnmatch import fnmatch
from os.path import join, walk
from os.path import join
Import("env")

def remove_pot_cdate(path):
Expand Down Expand Up @@ -33,13 +33,13 @@ if "pot-update" in COMMAND_LINE_TARGETS:
def fill_source_list(arg, dir, files):
for file in files:
if fnmatch(file, "*.[hc]pp"):
match = re.search('^#define\\s+GETTEXT_DOMAIN\\s+"wesnoth(-.*)"', Dir(dir).File(file).get_contents(), re.MULTILINE)
match = re.search('^#define\\s+GETTEXT_DOMAIN\\s+"wesnoth(-.*)"', Dir(dir).File(file).get_contents().decode("utf-8"), re.MULTILINE)
if match:
source_domain = match.group(1)
else:
source_domain = ""
domain_sources[source_domain].append(Dir(dir).File(file).path)
walk("../src", fill_source_list, None)
os.walk("../src", fill_source_list, None)

for domain in textdomains:
pot = File(join(domain, domain + ".pot"))
Expand Down Expand Up @@ -68,7 +68,7 @@ if "pot-update" in COMMAND_LINE_TARGETS:
cfgs = []
FINDCFG = join(domain, "FINDCFG")
if os.path.exists(FINDCFG):
cfgs = Split(Popen(["sh", join("po", FINDCFG)], stdout = PIPE, cwd = "..").communicate()[0])
cfgs = Split(Popen(["sh", join("po", FINDCFG)], stdout = PIPE, cwd = "..").communicate()[0].decode("utf-8"))
cfgs = [File(x, Dir("..")) for x in cfgs]
if cfgs:
wml_pot = env.Command(
Expand Down
2 changes: 1 addition & 1 deletion scons/ieee_754.py
Expand Up @@ -3,7 +3,7 @@

def CheckIEEE754(context):
context.Message("Checking if floating point numbers are in the IEEE 754 format... ")
test_file = File(os.path.join("src", "compile_time_tests", "ieee_754.cpp")).get_contents()
test_file = File(os.path.join("src", "compile_time_tests", "ieee_754.cpp")).get_contents().decode("utf-8")
ret, _ = context.TryRun(test_file, ".cpp")
context.Result(ret)
return ret
Expand Down

0 comments on commit 86ebdef

Please sign in to comment.