python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / misc / drivers / xboxdrv / scons-py3.patch
blob4aa6fa6193175e0dbcd1f370c76430ba43c862f8
1 From 17bd43a7d3ef86216abc36b42b4e6a1f70aa9979 Mon Sep 17 00:00:00 2001
2 From: xnick <xnick@users.noreply.github.com>
3 Date: Thu, 12 Oct 2017 20:34:35 +0300
4 Subject: [PATCH] Update SConstruct
6 python3 compatible
7 ---
8 SConstruct | 16 ++++++++--------
9 1 file changed, 8 insertions(+), 8 deletions(-)
11 diff --git a/SConstruct b/SConstruct
12 index 4cd79704..c0007054 100644
13 --- a/SConstruct
14 +++ b/SConstruct
15 @@ -19,7 +19,7 @@ def build_dbus_glue(target, source, env):
16 xml = re.sub(r"callback = \(([A-Za-z_]+)\) \(marshal_data \? marshal_data : cc->callback\);",
17 r"union { \1 fn; void* obj; } conv;\n "
18 "conv.obj = (marshal_data ? marshal_data : cc->callback);\n "
19 - "callback = conv.fn;", xml)
20 + "callback = conv.fn;", xml.decode('utf-8'))
22 with open(target[0].get_path(), "w") as f:
23 f.write(xml)
24 @@ -29,10 +29,10 @@ def build_bin2h(target, source, env):
25 Takes a list of files and converts them into a C source that can be included
26 """
27 def c_escape(str):
28 - return str.translate(string.maketrans("/.-", "___"))
29 + return str.translate(bytes.maketrans(b"/.-", b"___"))
31 - print target
32 - print source
33 + print(target)
34 + print(source)
35 with open(target[0].get_path(), "w") as fout:
36 fout.write("// autogenerated by scons Bin2H builder, do not edit by hand!\n\n")
38 @@ -45,8 +45,8 @@ def build_bin2h(target, source, env):
39 data = fin.read()
40 fout.write("// \"%s\"\n" % src.get_path())
41 fout.write("const char %s[] = {" % c_escape(src.get_path()))
42 - bytes_arr = ["0x%02x" % ord(c) for c in data]
43 - for i in xrange(len(bytes_arr)):
44 + bytes_arr = ["0x%02x" % c for c in data]
45 + for i in range(len(bytes_arr)):
46 if i % 13 == 0:
47 fout.write("\n ")
48 fout.write(bytes_arr[i])
49 @@ -131,12 +131,12 @@ env.Append(CPPDEFINES = { 'PACKAGE_VERSION': "'\"%s\"'" % package_version })
50 conf = Configure(env)
52 if not conf.env['CXX']:
53 - print "g++ must be installed!"
54 + print('g++ must be installed!')
55 Exit(1)
57 # X11 checks
58 if not conf.CheckLibWithHeader('X11', 'X11/Xlib.h', 'C++'):
59 - print 'libx11-dev must be installed!'
60 + print('libx11-dev must be installed!')
61 Exit(1)
63 env = conf.Finish()