telepathy-salut: make codegen work with python3

This commit is contained in:
classabbyamp 2023-10-08 00:15:59 -04:00 committed by classabbyamp
parent 2140a26efd
commit 49e6aa8c83
2 changed files with 102 additions and 6 deletions

View File

@ -0,0 +1,97 @@
--- a/tools/libglibcodegen.py
+++ b/tools/libglibcodegen.py
@@ -55,9 +55,8 @@
return camelcase_to_lower(s).upper()
-def cmp_by_name(node1, node2):
- return cmp(node1.getAttributeNode("name").nodeValue,
- node2.getAttributeNode("name").nodeValue)
+def key_by_name(node):
+ return node.getAttributeNode("name").nodeValue
def dbus_gutils_wincaps_to_uscore(s):
@@ -191,6 +191,9 @@
self.remaining = string
def next(self):
+ return self.__next__()
+
+ def __next__(self):
if self.remaining == '':
raise StopIteration
@@ -297,7 +297,7 @@
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)
@@ -312,7 +312,7 @@
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)
def xml_escape(s):
--- a/tools/glib-signals-marshal-gen.py
+++ b/tools/glib-signals-marshal-gen.py
@@ -41,12 +41,12 @@
for signal in signals:
self.do_signal(signal)
- all = self.marshallers.keys()
+ all = list(self.marshallers.keys())
all.sort()
for marshaller in all:
rhs = self.marshallers[marshaller]
if not marshaller.startswith('g_cclosure'):
- print 'VOID:' + ','.join(rhs)
+ print('VOID:' + ','.join(rhs))
if __name__ == '__main__':
argv = sys.argv[1:]
--- a/tools/glib-ginterface-gen.py
+++ b/tools/glib-ginterface-gen.py
@@ -26,7 +26,7 @@
import os.path
import xml.dom.minidom
-from libglibcodegen import Signature, type_to_gtype, cmp_by_name, \
+from libglibcodegen import Signature, type_to_gtype, key_by_name, \
camelcase_to_lower, NS_TP, dbus_gutils_wincaps_to_uscore, \
signal_to_marshal_name, method_to_glue_marshal_name
@@ -620,7 +620,7 @@
self.b('')
nodes = self.dom.getElementsByTagName('node')
- nodes.sort(cmp_by_name)
+ nodes.sort(key=key_by_name)
for node in nodes:
self.do_node(node)
@@ -639,7 +639,7 @@
def cmdline_error():
- print """\
+ print("""\
usage:
gen-ginterface [OPTIONS] xmlfile Prefix_
options:
@@ -659,7 +659,7 @@
void symbol (DBusGMethodInvocation *context)
and return some sort of "not implemented" error via
dbus_g_method_return_error (context, ...)
-"""
+""")
sys.exit(1)

View File

@ -2,19 +2,18 @@
pkgname=telepathy-salut
version=0.8.1
revision=20
lib32disabled=yes
build_style=gnu-configure
configure_args="--disable-tests --disable-plugins --with-tls=gnutls
--disable-avahi-tests --disable-static"
hostmakedepends="pkg-config python xmldiff glib-devel"
hostmakedepends="pkg-config python3 xmldiff glib-devel"
makedepends="glib-devel avahi-glib-libs-devel libsoup-devel telepathy-glib-devel
gnutls-devel libuuid-devel sqlite-devel"
depends="avahi"
short_desc="Link-local XMPP connection manager for Telepathy"
maintainer="Orphaned <orphan@voidlinux.org>"
homepage="http://telepathy.freedesktop.org"
license="LGPL-2.1-or-later"
distfiles="http://telepathy.freedesktop.org/releases/$pkgname/$pkgname-$version.tar.gz"
homepage="https://telepathy.freedesktop.org"
distfiles="https://telepathy.freedesktop.org/releases/telepathy-salut/telepathy-salut-$version.tar.gz"
checksum=70b9108ac8b511b7688e1b580de4ddb8981603c3cbde01f287ef8f9cb708618e
nocross="http://build.voidlinux.org/builders/armv7l_builder/builds/16213/steps/shell_3/logs/stdio"
lib32disabled=yes
nocross="can't find wocky.h"