diff options
author | Andrew Clemons <andrew.clemons@gmail.com> | 2022-02-18 18:06:50 +1300 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2022-02-19 12:10:40 +0700 |
commit | b08754ba17785d8200ba2d8e596509c36ff4be98 (patch) | |
tree | 1aa4bbe5c824dde8f85557989faec5a719162f69 /system/xboxdrv-linux/scons-py3.patch | |
parent | b933c905c2486b640c9d6120d37c74da10ba2eff (diff) |
system/xboxdrv-linux: Fix 15.0 build.
Apply some patches from arch to fix build with py3 scons on 15.0.
Signed-off-by: Andrew Clemons <andrew.clemons@gmail.com>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/xboxdrv-linux/scons-py3.patch')
-rw-r--r-- | system/xboxdrv-linux/scons-py3.patch | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/system/xboxdrv-linux/scons-py3.patch b/system/xboxdrv-linux/scons-py3.patch new file mode 100644 index 0000000000000..4aa6fa6193175 --- /dev/null +++ b/system/xboxdrv-linux/scons-py3.patch @@ -0,0 +1,63 @@ +From 17bd43a7d3ef86216abc36b42b4e6a1f70aa9979 Mon Sep 17 00:00:00 2001 +From: xnick <xnick@users.noreply.github.com> +Date: Thu, 12 Oct 2017 20:34:35 +0300 +Subject: [PATCH] Update SConstruct + +python3 compatible +--- + SConstruct | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/SConstruct b/SConstruct +index 4cd79704..c0007054 100644 +--- a/SConstruct ++++ b/SConstruct +@@ -19,7 +19,7 @@ def build_dbus_glue(target, source, env): + xml = re.sub(r"callback = \(([A-Za-z_]+)\) \(marshal_data \? marshal_data : cc->callback\);", + r"union { \1 fn; void* obj; } conv;\n " + "conv.obj = (marshal_data ? marshal_data : cc->callback);\n " +- "callback = conv.fn;", xml) ++ "callback = conv.fn;", xml.decode('utf-8')) + + with open(target[0].get_path(), "w") as f: + f.write(xml) +@@ -29,10 +29,10 @@ def build_bin2h(target, source, env): + Takes a list of files and converts them into a C source that can be included + """ + def c_escape(str): +- return str.translate(string.maketrans("/.-", "___")) ++ return str.translate(bytes.maketrans(b"/.-", b"___")) + +- print target +- print source ++ print(target) ++ print(source) + with open(target[0].get_path(), "w") as fout: + fout.write("// autogenerated by scons Bin2H builder, do not edit by hand!\n\n") + +@@ -45,8 +45,8 @@ def build_bin2h(target, source, env): + data = fin.read() + fout.write("// \"%s\"\n" % src.get_path()) + fout.write("const char %s[] = {" % c_escape(src.get_path())) +- bytes_arr = ["0x%02x" % ord(c) for c in data] +- for i in xrange(len(bytes_arr)): ++ bytes_arr = ["0x%02x" % c for c in data] ++ for i in range(len(bytes_arr)): + if i % 13 == 0: + fout.write("\n ") + fout.write(bytes_arr[i]) +@@ -131,12 +131,12 @@ env.Append(CPPDEFINES = { 'PACKAGE_VERSION': "'\"%s\"'" % package_version }) + conf = Configure(env) + + if not conf.env['CXX']: +- print "g++ must be installed!" ++ print('g++ must be installed!') + Exit(1) + + # X11 checks + if not conf.CheckLibWithHeader('X11', 'X11/Xlib.h', 'C++'): +- print 'libx11-dev must be installed!' ++ print('libx11-dev must be installed!') + Exit(1) + + env = conf.Finish() |