diff options
author | Paul Hentschel (hpmachining) | 2019-08-18 17:56:03 -0400 |
---|---|---|
committer | Paul Hentschel (hpmachining) | 2019-08-18 18:03:24 -0400 |
commit | 99e1fcd6b0f0c322a93ed4b508c826b1196104f8 (patch) | |
tree | b0809c76b922a37765b19e10262eb76d73efe70a | |
parent | 481c126205df88133de5679ecb84d9a8aacff652 (diff) | |
download | aur-99e1fcd6b0f0c322a93ed4b508c826b1196104f8.tar.gz |
Update for python3.
Scons was updated to use python3. Some files needed to be patched to
build using python3.
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | 0001_python3_fix.patch | 151 | ||||
-rw-r--r-- | PKGBUILD | 17 |
4 files changed, 169 insertions, 6 deletions
@@ -1,12 +1,12 @@ pkgbase = camotics pkgdesc = 3-axis NC machining simulation software pkgver = 1.2.0 - pkgrel = 1 + pkgrel = 2 url = https://camotics.org/ arch = x86_64 license = GPL2 makedepends = scons - makedepends = python2-six + makedepends = python-six makedepends = qt5-tools makedepends = cbang depends = v8-3.14 @@ -14,7 +14,9 @@ pkgbase = camotics depends = cairo depends = desktop-file-utils source = camotics-1.2.0.tar.gz::https://github.com/CauldronDevelopmentLLC/camotics/archive/v1.2.0.tar.gz + source = 0001_python3_fix.patch sha256sums = f5203d2bbd32c4e347a8f79122e57b2deea68e6c5bd4f0be4087c4d62a31c8a4 + sha256sums = 20ddecce61f6df4c10ca80d08c99762099eaea7ff574e3f11f57435c9e504e4b pkgname = camotics diff --git a/.gitignore b/.gitignore index 018a3de08144..5efe81dedfda 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ !PKGBUILD !.SRCINFO !.gitignore +!0001_python3_fix.patch 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', + @@ -3,7 +3,7 @@ pkgname=camotics pkgver=1.2.0 -pkgrel=1 +pkgrel=2 pkgdesc="3-axis NC machining simulation software" arch=('x86_64') url="https://camotics.org/" @@ -16,12 +16,21 @@ depends=( ) makedepends=( 'scons' - 'python2-six' + 'python-six' 'qt5-tools' 'cbang' ) -source=("$pkgname-$pkgver.tar.gz::https://github.com/CauldronDevelopmentLLC/$pkgname/archive/v$pkgver.tar.gz") -sha256sums=('f5203d2bbd32c4e347a8f79122e57b2deea68e6c5bd4f0be4087c4d62a31c8a4') +source=( + "$pkgname-$pkgver.tar.gz::https://github.com/CauldronDevelopmentLLC/$pkgname/archive/v$pkgver.tar.gz" + "0001_python3_fix.patch" +) +sha256sums=('f5203d2bbd32c4e347a8f79122e57b2deea68e6c5bd4f0be4087c4d62a31c8a4' + '20ddecce61f6df4c10ca80d08c99762099eaea7ff574e3f11f57435c9e504e4b') + +prepare() { + cd "CAMotics-$pkgver" + patch -p1 -i "../0001_python3_fix.patch" +} build() { cd "CAMotics-$pkgver" |