summarylogtreecommitdiffstats
path: root/0001_python3_fix.patch
diff options
context:
space:
mode:
authorPaul Hentschel (hpmachining)2019-08-18 17:56:03 -0400
committerPaul Hentschel (hpmachining)2019-08-18 18:03:24 -0400
commit99e1fcd6b0f0c322a93ed4b508c826b1196104f8 (patch)
treeb0809c76b922a37765b19e10262eb76d73efe70a /0001_python3_fix.patch
parent481c126205df88133de5679ecb84d9a8aacff652 (diff)
downloadaur-99e1fcd6b0f0c322a93ed4b508c826b1196104f8.tar.gz
Update for python3.
Scons was updated to use python3. Some files needed to be patched to build using python3.
Diffstat (limited to '0001_python3_fix.patch')
-rw-r--r--0001_python3_fix.patch151
1 files changed, 151 insertions, 0 deletions
diff --git a/0001_python3_fix.patch b/0001_python3_fix.patch
new file mode 100644
index 000000000000..1876c5d4e74e
--- /dev/null
+++ b/0001_python3_fix.patch
@@ -0,0 +1,151 @@
+diff -ruN a/config/qt5/__init__.py b/config/qt5/__init__.py
+--- a/config/qt5/__init__.py 2019-02-09 03:42:39.000000000 -0500
++++ b/config/qt5/__init__.py 2019-08-18 17:14:51.786563078 -0400
+@@ -42,6 +42,11 @@
+ import SCons.Util
+
+
++def _bytes_to_str(s):
++ if isinstance(s, bytes): return s.decode()
++ return s
++
++
+ class ToolQt5Warning(SCons.Warnings.Warning): pass
+ class GeneratedMocFileNotIncluded(ToolQt5Warning): pass
+ class QtdirNotFound(ToolQt5Warning): pass
+@@ -187,7 +192,7 @@
+ if moc_options['debug']:
+ print("scons: qt5: Scanning '%s' (header of '%s')" %
+ (h, cpp))
+- h_contents = h.get_contents()
++ h_contents = _bytes_to_str(h.get_contents())
+
+ if moc_options['gobble_comments']:
+ h_contents = self.ccomment.sub('', h_contents)
+@@ -271,7 +276,7 @@
+ print("scons: qt5: Scanning '%s' (header of '%s')" %
+ (h, cpp))
+
+- h_contents = h.get_contents()
++ h_contents = _bytes_to_str(h.get_contents())
+ if moc_options['gobble_comments']:
+ h_contents = self.ccomment.sub('', h_contents)
+ h_contents = self.cxxcomment.sub('', h_contents)
+@@ -370,7 +375,8 @@
+ continue
+
+ try:
+- cpp_contents = cpp.get_contents()
++ cpp_contents = _bytes_to_str(cpp.get_contents())
++
+ if moc_options['gobble_comments']:
+ cpp_contents = self.ccomment.sub('', cpp_contents)
+ cpp_contents = self.cxxcomment.sub('', cpp_contents)
+@@ -423,6 +429,7 @@
+ p = subprocess.Popen('%s -v' % moc, shell = True,
+ stdout = subprocess.PIPE, close_fds = True)
+ vernumber = p.stdout.read()
++ if isinstance(vernumber, bytes): vernumber = vernumber.decode()
+ vernumber = mocver_re.match(vernumber)
+
+ if vernumber:
+@@ -457,7 +464,7 @@
+ else: result.append(itemPath)
+ return result
+
+- contents = node.get_contents()
++ contents = _bytes_to_str(node.get_contents())
+ includes = qrcinclude_re.findall(contents)
+ qrcpath = os.path.dirname(node.path)
+ dirs = [included for included in includes if
+@@ -932,7 +939,7 @@
+ except: pass
+
+ debugSuffix = ''
+- if sys.platform in ["darwin", "linux2"] and not crosscompiling :
++ if sys.platform in ["darwin", "linux2", "linux"] and not crosscompiling :
+ if debug : debugSuffix = '_debug'
+ for module in modules :
+ if module not in pclessModules : continue
+diff -ruN a/SConstruct b/SConstruct
+--- a/SConstruct 2019-02-09 03:42:39.000000000 -0500
++++ b/SConstruct 2019-08-18 16:58:35.889914920 -0400
+@@ -48,7 +48,7 @@
+ lines += os.popen('svn status -v cbang').readlines()
+ lines = filter(lambda l: len(l) and l[0] in 'MA ', lines)
+ files = map(lambda l: l.split()[-1], lines)
+- files = filter(lambda f: not os.path.isdir(f), files)
++ files = list(filter(lambda f: not os.path.isdir(f), files))
+
+ tar = env.TarBZ2Dist('camotics', files)
+ Alias('dist', tar)
+@@ -129,7 +129,7 @@
+ src = []
+ for subdir in ['', 'ast', 'parse', 'interp', 'machine', 'plan', 'plan/bbctrl']:
+ src += Glob('src/gcode/%s/*.cpp' % subdir)
+-src = map(lambda path: re.sub(r'^src/', 'build/', str(path)), src)
++src = list(map(lambda path: re.sub(r'^src/', 'build/', str(path)), src))
+ lib = env.Library('build/libGCode', src)
+ libGCode = lib
+ env.Prepend(LIBS = lib)
+@@ -137,14 +137,14 @@
+
+ # libSTL
+ src = Glob('src/stl/*.cpp')
+-src = map(lambda path: re.sub(r'^src/', 'build/', str(path)), src)
++src = list(map(lambda path: re.sub(r'^src/', 'build/', str(path)), src))
+ lib = env.Library('build/libSTL', src)
+ env.Prepend(LIBS = lib)
+
+
+ # libDXF
+ src = Glob('src/dxf/*.cpp')
+-src = map(lambda path: re.sub(r'^src/', 'build/', str(path)), src)
++src = list(map(lambda path: re.sub(r'^src/', 'build/', str(path)), src))
+ lib = env.Library('build/libDXF', src)
+ env.Prepend(LIBS = lib)
+
+@@ -155,7 +155,7 @@
+ for subdir in subdirs: src += Glob('src/camotics/%s/*.cpp' % subdir)
+ if env['with_tpl']: src += Glob('src/tplang/*.cpp')
+
+-src = map(lambda path: re.sub(r'^src/', 'build/', str(path)), src)
++src = list(map(lambda path: re.sub(r'^src/', 'build/', str(path)), src))
+
+
+ # Build Info
+@@ -185,6 +185,7 @@
+ for subdir in subdirs:
+ guiSrc += Glob('src/camotics/%s/*.cpp' % subdir)
+ guiSrc = map(lambda path: re.sub(r'^src/', 'build/', str(path)), guiSrc)
++ guiSrc = list(guiSrc)
+
+ # Qt
+ dialogs = '''
+@@ -294,13 +295,15 @@
+ cmd = 'git ls-files examples/'
+ p = subprocess.Popen(cmd, shell = True, stdout = subprocess.PIPE)
+ examples = p.communicate()[0]
+- examples = map(lambda x: [x, x], examples.split())
++ if isinstance(examples, bytes): examples = examples.decode()
++ examples = list(map(lambda x: [x, x], examples.split()))
+
+ # Machines
+ cmd = 'git ls-files machines/'
+ p = subprocess.Popen(cmd, shell = True, stdout = subprocess.PIPE)
+ machines = p.communicate()[0]
+- machines = map(lambda x: [x, x], machines.split())
++ if isinstance(machines, bytes): machines = machines.decode()
++ machines = list(map(lambda x: [x, x], machines.split()))
+
+ # Package
+ if 'package' in COMMAND_LINE_TARGETS:
+@@ -355,7 +358,7 @@
+ platform_independent = ('tpl_lib'),
+
+ documents = ['README.md', 'CHANGELOG.md'] + examples + machines,
+- programs = map(lambda x: str(x[0]), execs),
++ programs = list(map(lambda x: str(x[0]), execs)),
+ desktop_menu = ['CAMotics.desktop'],
+ changelog = 'CHANGELOG.md',
+