aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSören Tempel <soeren+git@soeren-tempel.net>2020-05-31 11:48:54 +0200
committerSören Tempel <soeren+git@soeren-tempel.net>2020-05-31 15:55:24 +0200
commit18b7a4c22f4aa7ee7d5d78abbfaddbecae518a60 (patch)
treeca974a282c8c9e7336c0ca2921452e12faaa6bbc
parent81234451fa7bf4b86cc55e62715f0bd9fa7f3d37 (diff)
downloadalpine_aports-18b7a4c22f4aa7ee7d5d78abbfaddbecae518a60.tar.bz2
alpine_aports-18b7a4c22f4aa7ee7d5d78abbfaddbecae518a60.tar.xz
alpine_aports-18b7a4c22f4aa7ee7d5d78abbfaddbecae518a60.zip
community/telepathy-idle: use python3
Based on https://github.com/TelepathyIM/telepathy-idle/pull/8 See: #11577
-rw-r--r--community/telepathy-idle/APKBUILD8
-rw-r--r--community/telepathy-idle/python3.patch150
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"
8arch="all" 8arch="all"
9license="LGPL-2.1-or-later" 9license="LGPL-2.1-or-later"
10makedepends="telepathy-glib-dev glib-dev dbus-dev dbus-glib-dev libxslt 10makedepends="telepathy-glib-dev glib-dev dbus-dev dbus-glib-dev libxslt
11 python2" 11 python3"
12options="!check" # Needs py2-dbus 12options="!check" # Needs py2-dbus
13subpackages="$pkgname-doc" 13subpackages="$pkgname-doc"
14source="http://telepathy.freedesktop.org/releases/telepathy-idle/telepathy-idle-$pkgver.tar.gz" 14source="http://telepathy.freedesktop.org/releases/telepathy-idle/telepathy-idle-$pkgver.tar.gz
15 python3.patch"
15 16
16build() { 17build() {
17 ./configure \ 18 ./configure \
@@ -32,4 +33,5 @@ package() {
32 make DESTDIR="$pkgdir" install 33 make DESTDIR="$pkgdir" install
33} 34}
34 35
35sha512sums="f5e36afc3ab4b52eb865f2c1e6565b99011a7540fc1a7783d3bbd7bbf50bc671a2147df6bde646c82059a466cc1df9bdb10e2500db5b7bb06d57a989a75c261b telepathy-idle-0.2.0.tar.gz" 36sha512sums="f5e36afc3ab4b52eb865f2c1e6565b99011a7540fc1a7783d3bbd7bbf50bc671a2147df6bde646c82059a466cc1df9bdb10e2500db5b7bb06d57a989a75c261b telepathy-idle-0.2.0.tar.gz
37c0a22ee03d93e3bc6ab2e4155615771315e38d845ea1a4a60ea095c5cab8872db036e2d74a0aeb0ecbfdaf9f3a22c6a300a241683e69bde51ef5667b0e69aef2 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 @@
1Taken from https://github.com/TelepathyIM/telepathy-idle/pull/8
2
3From e8d12395db956727b037cefdf0e60ed409f0b33a Mon Sep 17 00:00:00 2001
4From: Bastien Nocera <hadess@hadess.net>
5Date: Tue, 17 Mar 2020 09:15:02 +0100
6Subject: [PATCH 1/2] tools: Fix errors running glib-ginterface-gen under
7 Python3
8
91)
10 print """\
11<snip>
12 dbus_g_method_return_error (context, ...)
13"""
14 ^
15SyntaxError: invalid syntax
16
172)
18
19Traceback (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 ^
25SyntaxError: invalid syntax
26
273)
28
29Traceback (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 ^
35SyntaxError: invalid syntax
36
374)
38
39Traceback (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)
44TypeError: 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
50diff --git a/tools/glib-ginterface-gen.py b/tools/glib-ginterface-gen.py
51index 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
89diff --git a/tools/libglibcodegen.py b/tools/libglibcodegen.py
90index 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
109From 8cdedc1d6716b2bb8ac7a95a00cf696f82ebbc38 Mon Sep 17 00:00:00 2001
110From: Bastien Nocera <hadess@hadess.net>
111Date: Tue, 17 Mar 2020 09:37:04 +0100
112Subject: [PATCH 2/2] tools: Remove outdated "is unicode" checks
113
114Those aren't needed in Python3, the strings should already be UTF-8.
115
116Traceback (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):
123NameError: name 'unicode' is not defined
124---
125 tools/glib-ginterface-gen.py | 6 ------
126 1 file changed, 6 deletions(-)
127
128diff --git a/tools/glib-ginterface-gen.py b/tools/glib-ginterface-gen.py
129index 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):