diff options
-rw-r--r-- | community/telepathy-idle/APKBUILD | 8 | ||||
-rw-r--r-- | community/telepathy-idle/python3.patch | 150 |
2 files changed, 155 insertions, 3 deletions
diff --git a/community/telepathy-idle/APKBUILD b/community/telepathy-idle/APKBUILD index 263b229559..a283ee2933 100644 --- a/community/telepathy-idle/APKBUILD +++ b/community/telepathy-idle/APKBUILD | |||
@@ -8,10 +8,11 @@ url="http://telepathy.freedesktop.org" | |||
8 | arch="all" | 8 | arch="all" |
9 | license="LGPL-2.1-or-later" | 9 | license="LGPL-2.1-or-later" |
10 | makedepends="telepathy-glib-dev glib-dev dbus-dev dbus-glib-dev libxslt | 10 | makedepends="telepathy-glib-dev glib-dev dbus-dev dbus-glib-dev libxslt |
11 | python2" | 11 | python3" |
12 | options="!check" # Needs py2-dbus | 12 | options="!check" # Needs py2-dbus |
13 | subpackages="$pkgname-doc" | 13 | subpackages="$pkgname-doc" |
14 | source="http://telepathy.freedesktop.org/releases/telepathy-idle/telepathy-idle-$pkgver.tar.gz" | 14 | source="http://telepathy.freedesktop.org/releases/telepathy-idle/telepathy-idle-$pkgver.tar.gz |
15 | python3.patch" | ||
15 | 16 | ||
16 | build() { | 17 | build() { |
17 | ./configure \ | 18 | ./configure \ |
@@ -32,4 +33,5 @@ package() { | |||
32 | make DESTDIR="$pkgdir" install | 33 | make DESTDIR="$pkgdir" install |
33 | } | 34 | } |
34 | 35 | ||
35 | sha512sums="f5e36afc3ab4b52eb865f2c1e6565b99011a7540fc1a7783d3bbd7bbf50bc671a2147df6bde646c82059a466cc1df9bdb10e2500db5b7bb06d57a989a75c261b telepathy-idle-0.2.0.tar.gz" | 36 | sha512sums="f5e36afc3ab4b52eb865f2c1e6565b99011a7540fc1a7783d3bbd7bbf50bc671a2147df6bde646c82059a466cc1df9bdb10e2500db5b7bb06d57a989a75c261b telepathy-idle-0.2.0.tar.gz |
37 | c0a22ee03d93e3bc6ab2e4155615771315e38d845ea1a4a60ea095c5cab8872db036e2d74a0aeb0ecbfdaf9f3a22c6a300a241683e69bde51ef5667b0e69aef2 python3.patch" | ||
diff --git a/community/telepathy-idle/python3.patch b/community/telepathy-idle/python3.patch new file mode 100644 index 0000000000..2deddee4b2 --- /dev/null +++ b/community/telepathy-idle/python3.patch | |||
@@ -0,0 +1,150 @@ | |||
1 | Taken from https://github.com/TelepathyIM/telepathy-idle/pull/8 | ||
2 | |||
3 | From e8d12395db956727b037cefdf0e60ed409f0b33a Mon Sep 17 00:00:00 2001 | ||
4 | From: Bastien Nocera <hadess@hadess.net> | ||
5 | Date: Tue, 17 Mar 2020 09:15:02 +0100 | ||
6 | Subject: [PATCH 1/2] tools: Fix errors running glib-ginterface-gen under | ||
7 | Python3 | ||
8 | |||
9 | 1) | ||
10 | print """\ | ||
11 | <snip> | ||
12 | dbus_g_method_return_error (context, ...) | ||
13 | """ | ||
14 | ^ | ||
15 | SyntaxError: invalid syntax | ||
16 | |||
17 | 2) | ||
18 | |||
19 | Traceback (most recent call last): | ||
20 | File "./tools/glib-ginterface-gen.py", line 30, in <module> | ||
21 | from libglibcodegen import Signature, type_to_gtype, cmp_by_name, \ | ||
22 | File "/home/hadess/Projects/Fedora/merged/telepathy-idle/master/telepathy-idle-0.2.0/tools/libglibcodegen.py", line 157 | ||
23 | raise Exception, "can't index a hashtable off non-basic type " + s | ||
24 | ^ | ||
25 | SyntaxError: invalid syntax | ||
26 | |||
27 | 3) | ||
28 | |||
29 | Traceback (most recent call last): | ||
30 | File "./tools/glib-ginterface-gen.py", line 30, in <module> | ||
31 | from libglibcodegen import Signature, type_to_gtype, cmp_by_name, \ | ||
32 | File "/home/hadess/Projects/Fedora/merged/telepathy-idle/master/telepathy-idle-0.2.0/tools/libglibcodegen.py", line 172 | ||
33 | raise Exception, "don't know the GType for " + s | ||
34 | ^ | ||
35 | SyntaxError: invalid syntax | ||
36 | |||
37 | 4) | ||
38 | |||
39 | Traceback (most recent call last): | ||
40 | File "../tools/glib-ginterface-gen.py", line 839, in <module> | ||
41 | Generator(dom, prefix, basename, signal_marshal_prefix, headers, | ||
42 | File "../tools/glib-ginterface-gen.py", line 736, in __call__ | ||
43 | nodes.sort(cmp_by_name) | ||
44 | TypeError: sort() takes no positional arguments | ||
45 | --- | ||
46 | tools/glib-ginterface-gen.py | 7 ++++--- | ||
47 | tools/libglibcodegen.py | 4 ++-- | ||
48 | 2 files changed, 6 insertions(+), 5 deletions(-) | ||
49 | |||
50 | diff --git a/tools/glib-ginterface-gen.py b/tools/glib-ginterface-gen.py | ||
51 | index 8fea5df..e32d7b8 100644 | ||
52 | --- a/tools/glib-ginterface-gen.py | ||
53 | +++ b/tools/glib-ginterface-gen.py | ||
54 | @@ -22,6 +22,7 @@ | ||
55 | # License along with this library; if not, write to the Free Software | ||
56 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
57 | |||
58 | +import functools | ||
59 | import sys | ||
60 | import os.path | ||
61 | import xml.dom.minidom | ||
62 | @@ -733,7 +734,7 @@ def have_properties(self, nodes): | ||
63 | |||
64 | def __call__(self): | ||
65 | nodes = self.dom.getElementsByTagName('node') | ||
66 | - nodes.sort(cmp_by_name) | ||
67 | + nodes.sort(key=functools.cmp_to_key(cmp_by_name)) | ||
68 | |||
69 | self.h('#include <glib-object.h>') | ||
70 | self.h('#include <dbus/dbus-glib.h>') | ||
71 | @@ -768,7 +769,7 @@ def __call__(self): | ||
72 | file_set_contents(self.basename + '-gtk-doc.h', '\n'.join(self.__docs)) | ||
73 | |||
74 | def cmdline_error(): | ||
75 | - print """\ | ||
76 | + print ("""\ | ||
77 | usage: | ||
78 | gen-ginterface [OPTIONS] xmlfile Prefix_ | ||
79 | options: | ||
80 | @@ -788,7 +789,7 @@ def cmdline_error(): | ||
81 | void symbol (DBusGMethodInvocation *context) | ||
82 | and return some sort of "not implemented" error via | ||
83 | dbus_g_method_return_error (context, ...) | ||
84 | -""" | ||
85 | +""") | ||
86 | sys.exit(1) | ||
87 | |||
88 | |||
89 | diff --git a/tools/libglibcodegen.py b/tools/libglibcodegen.py | ||
90 | index 6a9d214..2c9f164 100644 | ||
91 | --- a/tools/libglibcodegen.py | ||
92 | +++ b/tools/libglibcodegen.py | ||
93 | @@ -154,7 +154,7 @@ def type_to_gtype(s): | ||
94 | return ("GHashTable *", "DBUS_TYPE_G_STRING_STRING_HASHTABLE", "BOXED", False) | ||
95 | elif s[:2] == 'a{': #some arbitrary hash tables | ||
96 | if s[2] not in ('y', 'b', 'n', 'q', 'i', 'u', 's', 'o', 'g'): | ||
97 | - raise Exception, "can't index a hashtable off non-basic type " + s | ||
98 | + raise Exception("can't index a hashtable off non-basic type " + s) | ||
99 | first = type_to_gtype(s[2]) | ||
100 | second = type_to_gtype(s[3:-1]) | ||
101 | return ("GHashTable *", "(dbus_g_type_get_map (\"GHashTable\", " + first[1] + ", " + second[1] + "))", "BOXED", False) | ||
102 | @@ -169,4 +169,4 @@ def type_to_gtype(s): | ||
103 | return ("GValueArray *", gtype, "BOXED", True) | ||
104 | |||
105 | # we just don't know .. | ||
106 | - raise Exception, "don't know the GType for " + s | ||
107 | + raise(Exception, "don't know the GType for " + s) | ||
108 | |||
109 | From 8cdedc1d6716b2bb8ac7a95a00cf696f82ebbc38 Mon Sep 17 00:00:00 2001 | ||
110 | From: Bastien Nocera <hadess@hadess.net> | ||
111 | Date: Tue, 17 Mar 2020 09:37:04 +0100 | ||
112 | Subject: [PATCH 2/2] tools: Remove outdated "is unicode" checks | ||
113 | |||
114 | Those aren't needed in Python3, the strings should already be UTF-8. | ||
115 | |||
116 | Traceback (most recent call last): | ||
117 | File "../tools/glib-ginterface-gen.py", line 840, in <module> | ||
118 | Generator(dom, prefix, basename, signal_marshal_prefix, headers, | ||
119 | File "../tools/glib-ginterface-gen.py", line 739, in __call__ | ||
120 | self.h('#include <glib-object.h>') | ||
121 | File "../tools/glib-ginterface-gen.py", line 89, in h | ||
122 | if isinstance(s, unicode): | ||
123 | NameError: name 'unicode' is not defined | ||
124 | --- | ||
125 | tools/glib-ginterface-gen.py | 6 ------ | ||
126 | 1 file changed, 6 deletions(-) | ||
127 | |||
128 | diff --git a/tools/glib-ginterface-gen.py b/tools/glib-ginterface-gen.py | ||
129 | index e32d7b8..995d874 100644 | ||
130 | --- a/tools/glib-ginterface-gen.py | ||
131 | +++ b/tools/glib-ginterface-gen.py | ||
132 | @@ -86,18 +86,12 @@ def __init__(self, dom, prefix, basename, signal_marshal_prefix, | ||
133 | self.allow_havoc = allow_havoc | ||
134 | |||
135 | def h(self, s): | ||
136 | - if isinstance(s, unicode): | ||
137 | - s = s.encode('utf-8') | ||
138 | self.__header.append(s) | ||
139 | |||
140 | def b(self, s): | ||
141 | - if isinstance(s, unicode): | ||
142 | - s = s.encode('utf-8') | ||
143 | self.__body.append(s) | ||
144 | |||
145 | def d(self, s): | ||
146 | - if isinstance(s, unicode): | ||
147 | - s = s.encode('utf-8') | ||
148 | self.__docs.append(s) | ||
149 | |||
150 | def do_node(self, node): | ||