File mypaint-scons-to-python3.patch of Package mypaint
Index: b/SConscript
===================================================================
--- a/SConscript
+++ b/SConscript
@@ -10,9 +10,9 @@ mypaintlib = SConscript('lib/SConscript'
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
@@ -28,7 +28,7 @@ def burn_python_version(target, source,
f.write(s)
f.close()
-env.Command('mypaint', 'mypaint.py', [burn_python_version, Chmod('$TARGET', 0755)])
+env.Command('mypaint', 'mypaint.py', [burn_python_version, Chmod('$TARGET', 0o755)])
AlwaysBuild('mypaint') # especially if the "python_binary" option was changed
env.Clean('.', Glob('*.pyc'))
@@ -49,7 +49,7 @@ install_perms(env, '$prefix/share/applic
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/lib", Glob("lib/*.py"))
install_perms(env, "$prefix/share/mypaint/gui", Glob("gui/*.py"))
Index: b/SConstruct
===================================================================
--- a/SConstruct
+++ b/SConstruct
@@ -13,7 +13,7 @@ if sys.platform == "win32":
default_python_config = 'python-config'
if 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
@@ -73,14 +73,14 @@ if env['enable_profiling'] or env['debug
if sys.platform == "linux2":
env.Append(LINKFLAGS = Split('-z origin'))
-env.Append(RPATH = env.Literal(os.path.join('\\$$ORIGIN')))
+env.Append(RPATH = '$$ORIGIN')
# remove libraries produced by earlier versions, which are actually
# being used if they keep lying around, leading to mysterious bugs
env.Execute('rm -f libmypaint-tests.so libmypaint.so libmypaintlib.so')
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 which starts with ``$prefix``.
@@ -109,7 +109,7 @@ def install_perms(env, target, sources,
d_prev = None
while d != d_prev and d != '$prefix':
d_prev = d
- if not set_dir_postaction.has_key(d):
+ if d not in set_dir_postaction:
env.AddPostAction(file_targ, Chmod(d, dirperms))
set_dir_postaction[d] = True
d = os.path.dirname(d)
@@ -117,7 +117,7 @@ def install_perms(env, target, sources,
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):
Index: b/brushlib/SConscript
===================================================================
--- a/brushlib/SConscript
+++ b/brushlib/SConscript
@@ -60,8 +60,8 @@ env = env.Clone()
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")
else:
env['use_sharedlib'] = False
env['use_glib'] = False
Index: b/brushlib/generate.py
===================================================================
--- a/brushlib/generate.py
+++ b/brushlib/generate.py
@@ -27,15 +27,15 @@ def writefile(filename, s):
"write generated code if changed"
s = '// DO NOT EDIT - autogenerated by ' + sys.argv[0] + '\n\n' + s
if os.path.exists(filename) and open(filename).read() == s:
- print 'Checked', filename
+ print('Checked {}'.format(filename))
else:
- print 'Writing', filename
+ print('Writing {}'.format(filename))
open(filename, 'w').write(s)
def generate_enum(enum_name, enum_prefix, count_name, name_list, value_list):
# Can only generate an enum which starts at 0, and where each value is 1 more than the former
assert len(name_list) == len(value_list)
- assert value_list == list(xrange(0, len(value_list)))
+ assert value_list == list(range(0, len(value_list)))
indent = " " * 4
begin = "typedef enum {\n"
Index: b/lib/SConscript
===================================================================
--- a/lib/SConscript
+++ b/lib/SConscript
@@ -4,7 +4,7 @@ import sys, os
try:
import numpy
except ImportError:
- print 'You need to have numpy installed.'
+ print('You need to have numpy installed.')
print
raise
@@ -93,7 +93,7 @@ else:
env.ParseConfig(env['python_config'] + ' --cflags')
env.ParseConfig(env['python_config'] + ' --ldflags')
except OSError:
- print '%r does not work, trying python-config instead' % env['python_config']
+ print('{!r} does not work, trying python-config instead'.format(env['python_config']))
env.ParseConfig('python-config --ldflags')
env.ParseConfig('python-config --cflags')