pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/editors/medit medit: apply mechanical patches to pytho...
details: https://anonhg.NetBSD.org/pkgsrc/rev/e988e70125cb
branches: trunk
changeset: 450093:e988e70125cb
user: tsutsui <tsutsui%pkgsrc.org@localhost>
date: Sun Apr 11 00:58:16 2021 +0000
description:
medit: apply mechanical patches to python scripts for python3. PR/56088
"If it works for you, please just commit it" from wiz@.
diffstat:
editors/medit/Makefile | 6 +-
editors/medit/distinfo | 4 +-
editors/medit/patches/patch-tools_glade2c.py | 104 +++++++++++++++++++++++++++
editors/medit/patches/patch-tools_xml2h.py | 24 ++++++
4 files changed, 134 insertions(+), 4 deletions(-)
diffs (172 lines):
diff -r d78fc538280d -r e988e70125cb editors/medit/Makefile
--- a/editors/medit/Makefile Sun Apr 11 00:11:24 2021 +0000
+++ b/editors/medit/Makefile Sun Apr 11 00:58:16 2021 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.46 2020/11/05 09:08:02 ryoon Exp $
+# $NetBSD: Makefile,v 1.47 2021/04/11 00:58:16 tsutsui Exp $
DISTNAME= medit-1.2.0
-PKGREVISION= 16
+PKGREVISION= 17
CATEGORIES= editors
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=mooedit/}
EXTRACT_SUFX= .tar.bz2
@@ -19,7 +19,7 @@
USE_TOOLS+= gmake pkg-config msgfmt intltool
PYTHON_FOR_BUILD_ONLY= yes
-PYTHON_VERSIONS_ACCEPTED= 27 # not yet ported as of 1.2.0
+PYTHON_VERSIONS_INCOMPATIBLE+= 27
CONFIGURE_ARGS+= --with-python=no
CONFIGURE_ENV+= MOO_PYTHON=${PYTHONBIN}
diff -r d78fc538280d -r e988e70125cb editors/medit/distinfo
--- a/editors/medit/distinfo Sun Apr 11 00:11:24 2021 +0000
+++ b/editors/medit/distinfo Sun Apr 11 00:58:16 2021 +0000
@@ -1,7 +1,9 @@
-$NetBSD: distinfo,v 1.5 2015/11/03 03:32:18 agc Exp $
+$NetBSD: distinfo,v 1.6 2021/04/11 00:58:16 tsutsui Exp $
SHA1 (medit-1.2.0.tar.bz2) = 904ad57f0774ec1ef5ad8905f3dfc700811d5b36
RMD160 (medit-1.2.0.tar.bz2) = 24c9e9a3df624cbdafaf5251f05690c6a38fe8ad
SHA512 (medit-1.2.0.tar.bz2) = 936ce5390c7cbc92291946bda08ae271e1d8537686f134d9ac5a9c1067172933c11555a484d7036d7fed8c7fcb57ca145479bcc9009feb44eb3489b6099534f4
Size (medit-1.2.0.tar.bz2) = 1771094 bytes
SHA1 (patch-moo_Makefile.in) = 18334afff24bde08a83b670a57745c6317b84e71
+SHA1 (patch-tools_glade2c.py) = 5e7a744f46604a7b4c8be4e45561390c9427286a
+SHA1 (patch-tools_xml2h.py) = 0258456c05c31cf1d209a23abed68097f0451d22
diff -r d78fc538280d -r e988e70125cb editors/medit/patches/patch-tools_glade2c.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/editors/medit/patches/patch-tools_glade2c.py Sun Apr 11 00:58:16 2021 +0000
@@ -0,0 +1,104 @@
+$NetBSD: patch-tools_glade2c.py,v 1.1 2021/04/11 00:58:16 tsutsui Exp $
+
+- mechanical python3 support
+
+--- tools/glade2c.py.orig 2012-12-16 23:55:32.000000000 +0000
++++ tools/glade2c.py
+@@ -5,7 +5,7 @@ import sys
+ import getopt
+ import xml.dom
+ import xml.dom.minidom as minidom
+-import StringIO
++import io
+
+ def name_is_nice(name):
+ return name[-1:] not in "0123456789"
+@@ -50,7 +50,7 @@ class GladeXml(object):
+ walk_node(root, False, check_node)
+
+ def format_buffer(self):
+- out = StringIO.StringIO()
++ out = io.StringIO()
+ for l in self.buffer.splitlines():
+ out.write('"')
+ out.write(l.replace('\\', '\\\\').replace('"', '\\"'))
+@@ -208,9 +208,9 @@ G_GNUC_UNUSED static %(XmlStruct)s *
+ }
+ """
+
+- buf = StringIO.StringIO()
++ buf = io.StringIO()
+ if gxml.widgets:
+- print >> buf, ''
++ print('', file=buf)
+ for w in gxml.widgets:
+ name = w.name
+ ct = params.id_map.get(name)
+@@ -218,11 +218,11 @@ G_GNUC_UNUSED static %(XmlStruct)s *
+ class_name = w.class_name
+ else:
+ class_name = ct[0]
+- print >> buf, ' %s *%s;' % (class_name, name)
++ print(' %s *%s;' % (class_name, name), file=buf)
+ glade_xml_widgets_decl = buf.getvalue()
+ buf.close()
+
+- buf = StringIO.StringIO()
++ buf = io.StringIO()
+ for w in gxml.widgets:
+ name = w.name
+ ct = params.id_map.get(name)
+@@ -230,20 +230,20 @@ G_GNUC_UNUSED static %(XmlStruct)s *
+ class_name = w.class_name
+ else:
+ class_name = ct[0]
+- print >> buf, """\
++ print("""\
+ xml->%(struct_mem)s = (%(class_name)s*) moo_glade_xml_get_widget (xml->xml, "%(glade_name)s");
+- g_return_val_if_fail (xml->%(struct_mem)s != NULL, FALSE);""" % { 'struct_mem': w.name, 'glade_name': w.real_name, 'class_name': class_name }
++ g_return_val_if_fail (xml->%(struct_mem)s != NULL, FALSE);""" % { 'struct_mem': w.name, 'glade_name': w.real_name, 'class_name': class_name }, file=buf)
+ glade_xml_widgets_defs = buf.getvalue()
+ buf.close()
+
+- buf = StringIO.StringIO()
++ buf = io.StringIO()
+ for id in params.id_map:
+ ct = params.id_map.get(id)
+ if ct[1]:
+ type_name = ct[1]
+ else:
+ type_name = 'g_type_from_name ("%s")' % (ct[0],)
+- print >> buf, ' moo_glade_xml_map_id (xml->xml, "%s", %s);' % (id, type_name)
++ print(' moo_glade_xml_map_id (xml->xml, "%s", %s);' % (id, type_name), file=buf)
+ glade_xml_widgets_map = buf.getvalue()
+ buf.close()
+
+@@ -300,7 +300,7 @@ def convert_buffer(buf, params, output,
+
+ if output is None:
+ output = sys.stdout
+- elif isinstance(output, str) or isinstance(output, unicode):
++ elif isinstance(output, str):
+ output = open(output, 'w')
+ close_output = True
+
+@@ -317,7 +317,7 @@ def convert_file(filename, params, outpu
+ return ret
+
+ def usage():
+- print "Usage: %s [--map=id,ClassName,CLASS_TYPE...] [--output=outfile] FILE" % (sys.argv[0],)
++ print("Usage: %s [--map=id,ClassName,CLASS_TYPE...] [--output=outfile] FILE" % (sys.argv[0],))
+
+ def main(args):
+ params = ConvertParams()
+@@ -325,8 +325,8 @@ def main(args):
+ try:
+ opts, files = getopt.getopt(args[1:], "hm:o:s:S:r:",
+ ["help", "map=", "output=", "struct-name=", "StructName=", "root="])
+- except getopt.GetoptError, err:
+- print str(err)
++ except getopt.GetoptError as err:
++ print(str(err))
+ usage()
+ return 2
+
diff -r d78fc538280d -r e988e70125cb editors/medit/patches/patch-tools_xml2h.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/editors/medit/patches/patch-tools_xml2h.py Sun Apr 11 00:58:16 2021 +0000
@@ -0,0 +1,24 @@
+$NetBSD: patch-tools_xml2h.py,v 1.1 2021/04/11 00:58:16 tsutsui Exp $
+
+- mechanical python3 support
+
+--- tools/xml2h.py.orig 2012-12-16 23:55:32.000000000 +0000
++++ tools/xml2h.py
+@@ -11,13 +11,13 @@ tmp_output = output + '.tmp'
+ varname = sys.argv[3]
+
+ outfile = open(tmp_output, 'w')
+-print >> outfile, '/* -*- C -*- */'
+-print >> outfile, 'static const char %s [] = ""' % (varname,)
++print('/* -*- C -*- */', file=outfile)
++print('static const char %s [] = ""' % (varname,), file=outfile)
+ for line in open(input):
+ if line.endswith('\n'):
+ line = line[:-1]
+- print >> outfile, '"' + line.replace('"', '\\"') + '\\n"'
+-print >> outfile, ';'
++ print('"' + line.replace('"', '\\"') + '\\n"', file=outfile)
++print(';', file=outfile)
+
+ outfile.close()
+
Home |
Main Index |
Thread Index |
Old Index