FreeBSD Bugzilla – Attachment 218239 Details for
Bug 249570
net-im/telepathy-gabble: fix build with python 3.x
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to fix build with python 3
telepathy-gabble-python3-rev0.diff (text/plain), 19.84 KB, created by
Steve Wills
on 2020-09-24 11:55:16 UTC
(
hide
)
Description:
patch to fix build with python 3
Filename:
MIME Type:
Creator:
Steve Wills
Created:
2020-09-24 11:55:16 UTC
Size:
19.84 KB
patch
obsolete
>diff --git net-im/telepathy-gabble/Makefile net-im/telepathy-gabble/Makefile >index ffae36cacc2e..09aae6dca73b 100644 >--- net-im/telepathy-gabble/Makefile >+++ net-im/telepathy-gabble/Makefile >@@ -28,7 +28,7 @@ RUN_DEPENDS= ca_root_nss>=0:security/ca_root_nss \ > > PORTSCOUT= limitw:1,even > >-USES= alias gmake gnome libtool pathfix pkgconfig python:2.7,build \ >+USES= alias gmake gnome libtool pathfix pkgconfig python:build \ > shebangfix sqlite ssl > USE_GNOME= glib20 gtksourceview3 libxslt:build > GNU_CONFIGURE= yes >diff --git net-im/telepathy-gabble/distinfo net-im/telepathy-gabble/distinfo >index 153637551791..7a4b05e6e0d4 100644 >--- net-im/telepathy-gabble/distinfo >+++ net-im/telepathy-gabble/distinfo >@@ -1,2 +1,3 @@ >+TIMESTAMP = 1600948310 > SHA256 (telepathy-gabble-0.18.3.tar.gz) = 8ec714607e9bcb8d5a3f44adf871e7b07d5db8e326e47536e74e09cba59989c2 > SIZE (telepathy-gabble-0.18.3.tar.gz) = 2793195 >diff --git net-im/telepathy-gabble/files/patch-Makefile.in net-im/telepathy-gabble/files/patch-Makefile.in >index 6e8234229f1c..1aa6b77fe4b4 100644 >--- net-im/telepathy-gabble/files/patch-Makefile.in >+++ net-im/telepathy-gabble/files/patch-Makefile.in >@@ -1,6 +1,6 @@ >---- Makefile.in.orig 2010-09-18 17:29:38.000000000 +0000 >-+++ Makefile.in 2010-09-18 17:29:53.000000000 +0000 >-@@ -267,7 +267,7 @@ >+--- Makefile.in.orig 2020-09-24 11:51:08 UTC >++++ Makefile.in >+@@ -349,7 +349,7 @@ top_build_prefix = @top_build_prefix@ > top_builddir = @top_builddir@ > top_srcdir = @top_srcdir@ > ACLOCAL_AMFLAGS = -I m4 >diff --git net-im/telepathy-gabble/files/patch-lib_gibber_gibber-unix-transport.c net-im/telepathy-gabble/files/patch-lib_gibber_gibber-unix-transport.c >index c055de832675..68cfed921d70 100644 >--- net-im/telepathy-gabble/files/patch-lib_gibber_gibber-unix-transport.c >+++ net-im/telepathy-gabble/files/patch-lib_gibber_gibber-unix-transport.c >@@ -1,6 +1,6 @@ >---- lib/gibber/gibber-unix-transport.c.orig 2010-06-09 16:09:58.000000000 +0000 >-+++ lib/gibber/gibber-unix-transport.c 2010-09-18 21:24:44.000000000 +0000 >-@@ -375,6 +375,167 @@ gibber_unix_transport_recv_credentials ( >+--- lib/gibber/gibber-unix-transport.c.orig 2013-10-04 15:51:47 UTC >++++ lib/gibber/gibber-unix-transport.c >+@@ -374,6 +374,167 @@ gibber_unix_transport_recv_credentials (GibberUnixTran > return TRUE; > } > >@@ -168,7 +168,7 @@ > #else /* OSs where we have no implementation */ > > gboolean >-@@ -393,9 +554,7 @@ gibber_unix_transport_recv_credentials ( >+@@ -392,9 +553,7 @@ gibber_unix_transport_recv_credentials (GibberUnixTran > } > > gboolean >diff --git net-im/telepathy-gabble/files/patch-tools_c-constants-gen.py net-im/telepathy-gabble/files/patch-tools_c-constants-gen.py >new file mode 100644 >index 000000000000..82520088fa71 >--- /dev/null >+++ net-im/telepathy-gabble/files/patch-tools_c-constants-gen.py >@@ -0,0 +1,24 @@ >+--- tools/c-constants-gen.py.orig 2014-05-07 14:28:43 UTC >++++ tools/c-constants-gen.py >+@@ -12,7 +12,7 @@ class Generator(object): >+ self.prefix = prefix + '_' >+ self.spec = get_by_path(dom, "spec")[0] >+ >+- self.output_base = output_base >++ self.output_base = output_base >+ self.__header = [] >+ self.__docs = [] >+ >+@@ -25,10 +25,10 @@ class Generator(object): >+ file_set_contents(self.output_base + '-gtk-doc.h', ''.join(self.__docs)) >+ >+ def write(self, code): >+- self.__header.append(code.encode('utf-8')) >++ self.__header.append(code) >+ >+ def d(self, code): >+- self.__docs.append(code.encode('utf-8')) >++ self.__docs.append(code) >+ >+ # Header >+ def do_header(self): >diff --git net-im/telepathy-gabble/files/patch-tools_glib-client-gen.py net-im/telepathy-gabble/files/patch-tools_glib-client-gen.py >new file mode 100644 >index 000000000000..e8f561708400 >--- /dev/null >+++ net-im/telepathy-gabble/files/patch-tools_glib-client-gen.py >@@ -0,0 +1,23 @@ >+--- tools/glib-client-gen.py.orig 2014-05-07 14:28:02 UTC >++++ tools/glib-client-gen.py >+@@ -74,17 +74,17 @@ class Generator(object): >+ self.guard = opts.get('--guard', None) >+ >+ def h(self, s): >+- if isinstance(s, unicode): >++ if isinstance(s, str): >+ s = s.encode('utf-8') >+ self.__header.append(s) >+ >+ def b(self, s): >+- if isinstance(s, unicode): >++ if isinstance(s, str): >+ s = s.encode('utf-8') >+ self.__body.append(s) >+ >+ def d(self, s): >+- if isinstance(s, unicode): >++ if isinstance(s, str): >+ s = s.encode('utf-8') >+ self.__docs.append(s) >+ >diff --git net-im/telepathy-gabble/files/patch-tools_glib-client-marshaller-gen.py net-im/telepathy-gabble/files/patch-tools_glib-client-marshaller-gen.py >new file mode 100644 >index 000000000000..9a8ef0db6b77 >--- /dev/null >+++ net-im/telepathy-gabble/files/patch-tools_glib-client-marshaller-gen.py >@@ -0,0 +1,37 @@ >+--- tools/glib-client-marshaller-gen.py.orig 2014-05-07 14:28:02 UTC >++++ tools/glib-client-marshaller-gen.py >+@@ -31,23 +31,23 @@ class Generator(object): >+ for signal in signals: >+ self.do_signal(signal) >+ >+- print 'void' >+- print '%s_register_dbus_glib_marshallers (void)' % self.prefix >+- print '{' >++ print('void') >++ print('%s_register_dbus_glib_marshallers (void)' % self.prefix) >++ print('{') >+ >+- all = self.marshallers.keys() >+- all.sort() >++ all = list(self.marshallers.keys()) >++ sorted(all) >+ for marshaller in all: >+ rhs = self.marshallers[marshaller] >+ >+- print ' dbus_g_object_register_marshaller (' >+- print ' g_cclosure_marshal_generic,' >+- print ' G_TYPE_NONE, /* return */' >++ print(' dbus_g_object_register_marshaller (') >++ print(' g_cclosure_marshal_generic,') >++ print(' G_TYPE_NONE, /* return */') >+ for type in rhs: >+- print ' G_TYPE_%s,' % type.replace('VOID', 'NONE') >+- print ' G_TYPE_INVALID);' >++ print(' G_TYPE_%s,' % type.replace('VOID', 'NONE')) >++ print(' G_TYPE_INVALID);') >+ >+- print '}' >++ print('}') >+ >+ >+ def types_to_gtypes(types): >diff --git net-im/telepathy-gabble/files/patch-tools_glib-errors-str-gen.py net-im/telepathy-gabble/files/patch-tools_glib-errors-str-gen.py >new file mode 100644 >index 000000000000..3d92f6244aaa >--- /dev/null >+++ net-im/telepathy-gabble/files/patch-tools_glib-errors-str-gen.py >@@ -0,0 +1,23 @@ >+--- tools/glib-errors-str-gen.py.orig 2014-05-07 14:28:02 UTC >++++ tools/glib-errors-str-gen.py >+@@ -17,17 +17,17 @@ class Generator(object): >+ self.__docs = [] >+ >+ def h(self, s): >+- if isinstance(s, unicode): >++ if isinstance(s, str): >+ s = s.encode('utf-8') >+ self.__header.append(s) >+ >+ def b(self, s): >+- if isinstance(s, unicode): >++ if isinstance(s, str): >+ s = s.encode('utf-8') >+ self.__body.append(s) >+ >+ def d(self, s): >+- if isinstance(s, unicode): >++ if isinstance(s, str): >+ s = s.encode('utf-8') >+ self.__docs.append(s) >+ >diff --git net-im/telepathy-gabble/files/patch-tools_glib-ginterface-gen.py net-im/telepathy-gabble/files/patch-tools_glib-ginterface-gen.py >new file mode 100644 >index 000000000000..4c1f5ac75130 >--- /dev/null >+++ net-im/telepathy-gabble/files/patch-tools_glib-ginterface-gen.py >@@ -0,0 +1,63 @@ >+--- tools/glib-ginterface-gen.py.orig 2014-05-07 14:28:02 UTC >++++ tools/glib-ginterface-gen.py >+@@ -27,7 +27,7 @@ import os.path >+ import xml.dom.minidom >+ >+ from libtpcodegen import file_set_contents >+-from libglibcodegen import Signature, type_to_gtype, cmp_by_name, \ >++from libglibcodegen import Signature, type_to_gtype, \ >+ NS_TP, dbus_gutils_wincaps_to_uscore >+ >+ >+@@ -85,18 +85,18 @@ class Generator(object): >+ self.allow_havoc = allow_havoc >+ >+ def h(self, s): >+- if isinstance(s, unicode): >+- s = s.encode('utf-8') >++ if isinstance(s, bytes): >++ s = str(s, 'ascii') >+ self.__header.append(s) >+ >+ def b(self, s): >+- if isinstance(s, unicode): >+- s = s.encode('utf-8') >++ if isinstance(s, bytes): >++ s = str(s, 'ascii') >+ self.__body.append(s) >+ >+ def d(self, s): >+- if isinstance(s, unicode): >+- s = s.encode('utf-8') >++ if isinstance(s, bytes): >++ s = str(s, 'ascii') >+ self.__docs.append(s) >+ >+ def do_node(self, node): >+@@ -733,7 +733,7 @@ class Generator(object): >+ >+ def __call__(self): >+ nodes = self.dom.getElementsByTagName('node') >+- nodes.sort(cmp_by_name) >++ nodes.sort(key=lambda node : node.getAttributeNode('name').nodeValue) >+ >+ self.h('#include <glib-object.h>') >+ self.h('#include <dbus/dbus-glib.h>') >+@@ -766,7 +766,7 @@ class Generator(object): >+ file_set_contents(self.basename + '-gtk-doc.h', '\n'.join(self.__docs)) >+ >+ def cmdline_error(): >+- print """\ >++ print("""\ >+ usage: >+ gen-ginterface [OPTIONS] xmlfile Prefix_ >+ options: >+@@ -786,7 +786,7 @@ options: >+ void symbol (DBusGMethodInvocation *context) >+ and return some sort of "not implemented" error via >+ dbus_g_method_return_error (context, ...) >+-""" >++""") >+ sys.exit(1) >+ >+ >diff --git net-im/telepathy-gabble/files/patch-tools_glib-gtypes-generator.py net-im/telepathy-gabble/files/patch-tools_glib-gtypes-generator.py >new file mode 100644 >index 000000000000..3be59464962a >--- /dev/null >+++ net-im/telepathy-gabble/files/patch-tools_glib-gtypes-generator.py >@@ -0,0 +1,19 @@ >+--- tools/glib-gtypes-generator.py.orig 2014-05-07 14:28:02 UTC >++++ tools/glib-gtypes-generator.py >+@@ -68,13 +68,13 @@ class GTypesGenerator(object): >+ self.need_other_arrays = {} >+ >+ def h(self, code): >+- self.header.append(code.encode("utf-8")) >++ self.header.append(code) >+ >+ def c(self, code): >+- self.body.append(code.encode("utf-8")) >++ self.body.append(code) >+ >+ def d(self, code): >+- self.docs.append(code.encode('utf-8')) >++ self.docs.append(code) >+ >+ def do_mapping_header(self, mapping): >+ members = mapping.getElementsByTagNameNS(NS_TP, 'member') >diff --git net-im/telepathy-gabble/files/patch-tools_glib-interfaces-gen.py net-im/telepathy-gabble/files/patch-tools_glib-interfaces-gen.py >new file mode 100644 >index 000000000000..1c861dfe6432 >--- /dev/null >+++ net-im/telepathy-gabble/files/patch-tools_glib-interfaces-gen.py >@@ -0,0 +1,19 @@ >+--- tools/glib-interfaces-gen.py.orig 2014-05-07 14:28:02 UTC >++++ tools/glib-interfaces-gen.py >+@@ -24,13 +24,13 @@ class Generator(object): >+ self.spec = get_by_path(dom, "spec")[0] >+ >+ def h(self, code): >+- self.decls.append(code.encode('utf-8')) >++ self.decls.append(code) >+ >+ def c(self, code): >+- self.impls.append(code.encode('utf-8')) >++ self.impls.append(code) >+ >+ def d(self, code): >+- self.docs.append(code.encode('utf-8')) >++ self.docs.append(code) >+ >+ def __call__(self): >+ for f in self.h, self.c: >diff --git net-im/telepathy-gabble/files/patch-tools_gobject-foo.py net-im/telepathy-gabble/files/patch-tools_gobject-foo.py >new file mode 100644 >index 000000000000..5143c09e70c3 >--- /dev/null >+++ net-im/telepathy-gabble/files/patch-tools_gobject-foo.py >@@ -0,0 +1,8 @@ >+--- tools/gobject-foo.py.orig 2014-05-07 14:28:02 UTC >++++ tools/gobject-foo.py >+@@ -87,4 +87,4 @@ if __name__ == '__main__': >+ >+ head, tail = argv >+ >+- print '\n'.join(gobject_header(head, tail, as_interface=as_interface)) >++ print('\n'.join(gobject_header(head, tail, as_interface=as_interface))) >diff --git net-im/telepathy-gabble/files/patch-tools_libglibcodegen.py net-im/telepathy-gabble/files/patch-tools_libglibcodegen.py >new file mode 100644 >index 000000000000..8b82a09e2cc0 >--- /dev/null >+++ net-im/telepathy-gabble/files/patch-tools_libglibcodegen.py >@@ -0,0 +1,25 @@ >+--- tools/libglibcodegen.py.orig 2014-05-07 14:28:02 UTC >++++ tools/libglibcodegen.py >+@@ -23,7 +23,6 @@ please make any changes there. >+ >+ from libtpcodegen import NS_TP, \ >+ Signature, \ >+- cmp_by_name, \ >+ escape_as_identifier, \ >+ get_by_path, \ >+ get_descendant_text, \ >+@@ -154,7 +153,7 @@ def type_to_gtype(s): >+ return ("GHashTable *", "DBUS_TYPE_G_STRING_STRING_HASHTABLE", "BOXED", False) >+ elif s[:2] == 'a{': #some arbitrary hash tables >+ if s[2] not in ('y', 'b', 'n', 'q', 'i', 'u', 's', 'o', 'g'): >+- raise Exception, "can't index a hashtable off non-basic type " + s >++ raise Exception("can't index a hashtable off non-basic type " + s) >+ first = type_to_gtype(s[2]) >+ second = type_to_gtype(s[3:-1]) >+ return ("GHashTable *", "(dbus_g_type_get_map (\"GHashTable\", " + first[1] + ", " + second[1] + "))", "BOXED", False) >+@@ -169,4 +168,4 @@ def type_to_gtype(s): >+ return ("GValueArray *", gtype, "BOXED", True) >+ >+ # we just don't know .. >+- raise Exception, "don't know the GType for " + s >++ raise Exception("don't know the GType for " + s) >diff --git net-im/telepathy-gabble/files/patch-tools_libtpcodegen.py net-im/telepathy-gabble/files/patch-tools_libtpcodegen.py >new file mode 100644 >index 000000000000..445aab35ca25 >--- /dev/null >+++ net-im/telepathy-gabble/files/patch-tools_libtpcodegen.py >@@ -0,0 +1,14 @@ >+--- tools/libtpcodegen.py.orig 2014-05-07 14:28:02 UTC >++++ tools/libtpcodegen.py >+@@ -167,7 +167,10 @@ class _SignatureIter: >+ def __init__(self, string): >+ self.remaining = string >+ >+- def next(self): >++ def __iter__(self): >++ self >++ >++ def __next__(self): >+ if self.remaining == '': >+ raise StopIteration >+ >diff --git net-im/telepathy-gabble/files/patch-tools_make-release-mail.py net-im/telepathy-gabble/files/patch-tools_make-release-mail.py >new file mode 100644 >index 000000000000..c2838fb33ea0 >--- /dev/null >+++ net-im/telepathy-gabble/files/patch-tools_make-release-mail.py >@@ -0,0 +1,39 @@ >+--- tools/make-release-mail.py.orig 2013-10-09 23:29:36 UTC >++++ tools/make-release-mail.py >+@@ -28,8 +28,8 @@ def extract_description(package, version, news_path): >+ break >+ >+ # Skip the ====== line, and the first blank line >+- lines.next() >+- lines.next() >++ next(lines) >++ next(lines) >+ >+ got_release_name = False >+ >+@@ -59,7 +59,7 @@ GIT_URL = 'http://cgit.freedesktop.org/telepathy' >+ def main(package, version, news_path): >+ release_name, details = extract_description(package, version, news_path) >+ >+- print """ >++ print(""" >+ %(release_name)s >+ >+ tarball: %(base_url)s/%(package)s/%(package)s-%(version)s.tar.gz >+@@ -73,14 +73,14 @@ git: %(git_url)s/%(package)s >+ 'version': version, >+ 'release_name': release_name, >+ 'details': details, >+- } >++ }) >+ >+ if __name__ == '__main__': >+ try: >+ package, version, news_path = sys.argv[1:] >+ >+ main(package, version, news_path) >+- except ValueError, e: >++ except ValueError as e: >+ sys.stderr.write( >+ 'Usage: %s package-name package.version.number path/to/NEWS\n' % >+ sys.argv[0]) >diff --git net-im/telepathy-gabble/files/patch-tools_manager-file.py net-im/telepathy-gabble/files/patch-tools_manager-file.py >new file mode 100644 >index 000000000000..342409e7e736 >--- /dev/null >+++ net-im/telepathy-gabble/files/patch-tools_manager-file.py >@@ -0,0 +1,77 @@ >+--- tools/manager-file.py.orig 2014-05-07 14:16:47 UTC >++++ tools/manager-file.py >+@@ -87,18 +87,18 @@ gflags = { >+ >+ def write_manager(f, manager, protos): >+ # pointless backwards compat section >+- print >> f, '[ConnectionManager]' >+- print >> f, 'BusName=org.freedesktop.Telepathy.ConnectionManager.' + manager >+- print >> f, 'ObjectPath=/org/freedesktop/Telepathy/ConnectionManager/' + manager >++ print('[ConnectionManager]', file=f) >++ print('BusName=org.freedesktop.Telepathy.ConnectionManager.' + manager, file=f) >++ print('ObjectPath=/org/freedesktop/Telepathy/ConnectionManager/' + manager, file=f) >+ >+ # protocols >+- for proto, params in protos.iteritems(): >+- print >> f >+- print >> f, '[Protocol %s]' % proto >++ for proto, params in protos.items(): >++ print(file=f) >++ print('[Protocol %s]' % proto, file=f) >+ >+ defaults = {} >+ >+- for param, info in params.iteritems(): >++ for param, info in params.items(): >+ dtype = info['dtype'] >+ flags = info.get('flags', '').split() >+ struct_field = info.get('struct_field', param.replace('-', '_')) >+@@ -115,15 +115,15 @@ def write_manager(f, manager, protos): >+ else: >+ flags = '' >+ >+- print >> f, 'param-%s=%s%s' % (param, desktop_string(dtype), flags) >++ print('param-%s=%s%s' % (param, desktop_string(dtype), flags), file=f) >+ >+- for param, default in defaults.iteritems(): >+- print >> f, 'default-%s=%s' % (param, default) >++ for param, default in defaults.items(): >++ print('default-%s=%s' % (param, default), file=f) >+ >+ def write_c_params(f, manager, proto, struct, params): >+- print >> f, "static const TpCMParamSpec %s_%s_params[] = {" % (manager, proto) >++ print("static const TpCMParamSpec %s_%s_params[] = {" % (manager, proto), file=f) >+ >+- for param, info in params.iteritems(): >++ for param, info in params.items(): >+ dtype = info['dtype'] >+ flags = info.get('flags', '').split() >+ struct_field = info.get('struct_field', param.replace('-', '_')) >+@@ -146,7 +146,7 @@ def write_c_params(f, manager, proto, struct, params): >+ else: >+ struct_offset = 'G_STRUCT_OFFSET (%s, %s)' % (struct, struct_field) >+ >+- print >> f, (''' { %s, %s, %s, >++ print((''' { %s, %s, %s, >+ %s, >+ %s, /* default */ >+ %s, /* struct offset */ >+@@ -154,14 +154,14 @@ def write_c_params(f, manager, proto, struct, params): >+ %s, /* filter data */ >+ %s /* setter data */ },''' % >+ (c_string(param), c_string(dtype), gtypes[dtype], flags, >+- default, struct_offset, filter, filter_data, setter_data)) >++ default, struct_offset, filter, filter_data, setter_data)), file=f) >+ >+- print >> f, " { NULL }" >+- print >> f, "};" >++ print(" { NULL }", file=f) >++ print("};", file=f) >+ >+ if __name__ == '__main__': >+ environment = {} >+- execfile(sys.argv[1], environment) >++ exec(compile(open(sys.argv[1], "rb").read(), sys.argv[1], 'exec'), environment) >+ >+ filename = '%s/%s.manager' % (sys.argv[2], environment['MANAGER']) >+ try: >diff --git net-im/telepathy-gabble/files/patch-tools_xincludator.py net-im/telepathy-gabble/files/patch-tools_xincludator.py >new file mode 100644 >index 000000000000..4fffb6fff26e >--- /dev/null >+++ net-im/telepathy-gabble/files/patch-tools_xincludator.py >@@ -0,0 +1,32 @@ >+--- tools/xincludator.py.orig 2014-05-07 14:28:02 UTC >++++ tools/xincludator.py >+@@ -1,17 +1,17 @@ >+ #!/usr/bin/python >+ >+ from sys import argv, stdout, stderr >+-import codecs, locale >+-import os >++import locale >++import os, sys >+ import xml.dom.minidom >+ >+-stdout = codecs.getwriter('utf-8')(stdout) >++sys.stdout.reconfigure(encoding='utf-8') >+ >+ NS_XI = 'http://www.w3.org/2001/XInclude' >+ >+ def xincludate(dom, base, dropns = []): >+ remove_attrs = [] >+- for i in xrange(dom.documentElement.attributes.length): >++ for i in range(dom.documentElement.attributes.length): >+ attr = dom.documentElement.attributes.item(i) >+ if attr.prefix == 'xmlns': >+ if attr.localName in dropns: >+@@ -35,5 +35,5 @@ if __name__ == '__main__': >+ dom = xml.dom.minidom.parse(argv[0]) >+ xincludate(dom, argv[0]) >+ xml = dom.toxml() >+- stdout.write(xml) >+- stdout.write('\n') >++ sys.stdout.write(xml) >++ sys.stdout.write('\n')
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 249570
: 218239