Date: Saturday, July 27, 2019 @ 08:24:56 Author: arojas Revision: 493078
Fix build with python3 scons Added: mypaint/trunk/scons-python3.patch Modified: mypaint/trunk/PKGBUILD ---------------------+ PKGBUILD | 12 ++- scons-python3.patch | 171 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 179 insertions(+), 4 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2019-07-27 07:14:10 UTC (rev 493077) +++ PKGBUILD 2019-07-27 08:24:56 UTC (rev 493078) @@ -13,12 +13,14 @@ makedepends=('scons' 'swig') source=(https://github.com/mypaint/$pkgname/releases/download/v$pkgver/$pkgname-$pkgver.tar.xz{,.asc} fix-wayland.patch - 0001-Fix-AppStream-metadata-validation.patch) + 0001-Fix-AppStream-metadata-validation.patch + scons-python3.patch) validpgpkeys=('C02391F4BBA4F0E2B27C6BFF6E3037E12878B299') # Andrew Chadwick sha256sums=('ed2349382f6a0c583d7defae06427e97ac7d14acb77b9e2c0fc7171ddd96d3c7' 'SKIP' '1ffa2e6e0deb236928f33c7f82cc037949e76600b5f7242f85b18380a241928b' - '5a0d1dc67a4377adf6d7e38300fcf07b11765ea7bf8866d0a28765d0522ff99b') + '5a0d1dc67a4377adf6d7e38300fcf07b11765ea7bf8866d0a28765d0522ff99b' + 'f2f99e7d0db538eb2c9c084077e7c8ceb480911318b3c0fbf23cf9cc37bfc893') prepare() { cd $pkgname-$pkgver @@ -32,14 +34,16 @@ # Don't use legacy path for AppStream metainfo file sed -i 's|/share/appdata|/share/metainfo|' SConscript + + patch -p1 -i ../scons-python3.patch } build() { cd $pkgname-$pkgver - scons + scons python_binary=python2 python_config=python2-config } package() { cd $pkgname-$pkgver - scons prefix="$pkgdir"/usr install + scons prefix="$pkgdir"/usr install python_binary=python2 python_config=python2-config } Added: scons-python3.patch =================================================================== --- scons-python3.patch (rev 0) +++ scons-python3.patch 2019-07-27 08:24:56 UTC (rev 493078) @@ -0,0 +1,171 @@ +--- mypaint-1.2.1/SConstruct.orig 2019-07-27 06:58:18.369247493 +0000 ++++ mypaint-1.2.1/SConstruct 2019-07-27 06:59:01.299843987 +0000 +@@ -17,7 +17,7 @@ + # Defaults above will work fine. + pass + elif os.path.exists('/etc/gentoo-release'): +- print 'Gentoo: /etc/gentoo-release exists. Must be on a Gentoo based system.' ++ print ('Gentoo: /etc/gentoo-release exists. Must be on a Gentoo based system.') + default_python_config = 'python-config-%d.%d' % (sys.version_info[0],sys.version_info[1]) + + SConsignFile() # no .scsonsign into $PREFIX please +@@ -76,18 +76,18 @@ + # Respect some standard build environment stuff + # See http://cgit.freedesktop.org/mesa/mesa/tree/scons/gallium.py + # See https://wiki.gentoo.org/wiki/SCons#Missing_CC.2C_CFLAGS.2C_LDFLAGS +-if os.environ.has_key('CC'): ++if os.environ.get('CC'): + env['CC'] = os.environ['CC'] +-if os.environ.has_key('CFLAGS'): ++if os.environ.get('CFLAGS'): + env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CFLAGS']) +-if os.environ.has_key('CXX'): ++if os.environ.get('CXX'): + env['CXX'] = os.environ['CXX'] +-if os.environ.has_key('CXXFLAGS'): ++if os.environ.get('CXXFLAGS'): + env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS']) +-if os.environ.has_key('CPPFLAGS'): ++if os.environ.get('CPPFLAGS'): + env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CPPFLAGS']) + env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CPPFLAGS']) +-if os.environ.has_key('LDFLAGS'): ++if os.environ.get('LDFLAGS'): + # LDFLAGS is omitted in SHLINKFLAGS, which is derived from LINKFLAGS + env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS']) + if "$CCFLAGS" in env['CXXCOM']: +@@ -146,7 +146,7 @@ + + + set_dir_postaction = {} +-def install_perms(env, target, sources, perms=0644, dirperms=0755): ++def install_perms(env, target, sources, perms=0o644, dirperms=0o755): + """As a normal env.Install, but with Chmod postactions. + + The `target` parameter must be a string starting with ``$prefix``. +@@ -178,7 +178,7 @@ + return install_targs + + +-def install_tree(env, dest, path, perms=0644, dirperms=0755): ++def install_tree(env, dest, path, perms=0o644, dirperms=0o755): + assert os.path.isdir(path) + target_root = join(dest, os.path.basename(path)) + for dirpath, dirnames, filenames in os.walk(path): +@@ -228,7 +228,7 @@ + Export('env', 'install_tree', 'install_perms') + + if not env.GetOption("help"): +- print "Enabling i18n for brushlib in full application build" ++ print ("Enabling i18n for brushlib in full application build") + env['enable_i18n'] = True + + # Brushlib +--- mypaint-1.2.1/brushlib/SConscript.orig 2019-07-27 07:11:56.630862385 +0000 ++++ mypaint-1.2.1/brushlib/SConscript 2019-07-27 07:12:35.081442001 +0000 +@@ -81,8 +81,8 @@ + if env['enable_introspection']: + env['use_glib'] = True + env['use_sharedlib'] = True +- print "Enabling glib because of enable_introspection=true" +- print "Building a shared lib instead of a static lib because of enable_introspection=true" ++ print ("Enabling glib because of enable_introspection=true") ++ print ("Building a shared lib instead of a static lib because of enable_introspection=true") + + Export('env') + +@@ -95,7 +95,7 @@ + json_pkgconfig = 'json-c' + + if subprocess.call(["pkg-config", json_pkgconfig]): +- print "Could not find 'json-c' pkg-config, trying legacy 'json' instead" ++ print ("Could not find 'json-c' pkg-config, trying legacy 'json' instead") + json_pkgconfig = 'json' + + pkg_deps = [json_pkgconfig] +--- mypaint-1.2.1/SConscript.orig 2019-07-27 07:13:59.329369214 +0000 ++++ mypaint-1.2.1/SConscript 2019-07-27 07:14:16.359622596 +0000 +@@ -27,9 +27,9 @@ + languages = SConscript('po/SConscript') + + try: +- new_umask = 022 ++ new_umask = 0o22 + old_umask = os.umask(new_umask) +- print "set umask to 0%03o (was 0%03o)" % (new_umask, old_umask) ++ print ("set umask to 0%03o (was 0%03o)" % (new_umask, old_umask)) + except OSError: + # Systems like Win32... + pass +@@ -56,13 +56,13 @@ + relinfo_script = relinfo_script, + source = source[0], + ) +- with open(unicode(target[0]), 'w') as output: ++ with open(str(target[0]), 'w') as output: + output.write(header) +- with open(unicode(source[0])) as input: ++ with open(str(source[0])) as input: + output.write(input.read()) + c = env.Command(target, source, [ + _burn_versions, +- Chmod(target, 0755), ++ Chmod(target, 0o755), + ]) + d = env.Depends(target, env.Value(env["python_binary"])) + # But don't depend on the git output: +@@ -92,7 +92,7 @@ + install_perms(env, + '$prefix/bin', + 'desktop/mypaint-ora-thumbnailer', +- perms=0755, ++ perms=0o755, + ) + install_perms(env, + '$prefix/share/thumbnailers', +@@ -125,7 +125,7 @@ + install_perms(env, '$prefix/lib/mypaint', mypaintlib) + + # Program and supporting UI XML +-install_perms(env, '$prefix/bin', 'mypaint', perms=0755) ++install_perms(env, '$prefix/bin', 'mypaint', perms=0o755) + install_perms(env, '$prefix/share/mypaint/gui', Glob('gui/*.xml')) + install_perms(env, '$prefix/share/mypaint/gui', Glob('gui/*.glade')) + install_perms(env, "$prefix/share/mypaint/lib", Glob("lib/*.py")) +--- mypaint-1.2.1/lib/SConscript.orig 2019-07-27 07:26:49.270531250 +0000 ++++ mypaint-1.2.1/lib/SConscript 2019-07-27 07:27:52.654767547 +0000 +@@ -109,7 +109,7 @@ + # syntax too much, causing os.path.join() to fail. + + if not numpy_path: +- numpy_cfg_py = "import numpy; print numpy.get_include()" ++ numpy_cfg_py = "import numpy; print (numpy.get_include())" + try: + numpy_path = subprocess.check_output([ + env["python_binary"], +@@ -119,7 +119,7 @@ + except: + numpy_path = None + else: +- numpy_path = numpy_path.rstrip("\r\n") ++ numpy_path = numpy_path.decode('utf-8').rstrip("\r\n") + + # There may be strange builds out there that don't have a target Python + # binary yet at the time of compilation, but for which using the local +--- mypaint-1.2.1/lib/meta.py.orig 2019-07-27 07:52:16.131752304 +0000 ++++ mypaint-1.2.1/lib/meta.py 2019-07-27 07:53:08.652470988 +0000 +@@ -144,7 +144,7 @@ + # If release information from release.sh exists, use that + relinfo = {} + with open("release_info", "rb") as relinfo_fp: +- exec relinfo_fp in relinfo ++ exec (relinfo_fp.read(), relinfo) + base_version = relinfo.get( + "MYPAINT_VERSION_BASE", + base_version, +@@ -310,4 +310,4 @@ + # makes. + + if __name__ == '__main__': +- print _get_release_info_script(), ++ print (_get_release_info_script()),