1 |
commit: 96f5c8d5caa235bc072898e45c70d184a95c0d10 |
2 |
Author: Chí-Thanh Christopher Nguyễn <chithanh <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun May 29 20:02:10 2016 +0000 |
4 |
Commit: Chí-Thanh Christopher Nguyễn <chithanh <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun May 29 20:02:10 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=96f5c8d5 |
7 |
|
8 |
x11-proto/xcb-proto: fix python-3 build |
9 |
|
10 |
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=95490 |
11 |
|
12 |
Package-Manager: portage-2.2.28 |
13 |
|
14 |
...oto-1.12-make-whitespace-usage-consistent.patch | 208 +++++++++++++++++++++ |
15 |
...print-is-a-function-and-needs-parentheses.patch | 68 +++++++ |
16 |
...-proto-1.12.ebuild => xcb-proto-1.12-r1.ebuild} | 5 + |
17 |
3 files changed, 281 insertions(+) |
18 |
|
19 |
diff --git a/x11-proto/xcb-proto/files/xcb-proto-1.12-make-whitespace-usage-consistent.patch b/x11-proto/xcb-proto/files/xcb-proto-1.12-make-whitespace-usage-consistent.patch |
20 |
new file mode 100644 |
21 |
index 0000000..6957948 |
22 |
--- /dev/null |
23 |
+++ b/x11-proto/xcb-proto/files/xcb-proto-1.12-make-whitespace-usage-consistent.patch |
24 |
@@ -0,0 +1,208 @@ |
25 |
+From ea7a3ac6c658164690e0febb55f4467cb9e0bcac Mon Sep 17 00:00:00 2001 |
26 |
+From: Thomas Klausner <wiz@××××××.org> |
27 |
+Date: Thu, 19 May 2016 17:30:04 +0200 |
28 |
+Subject: Make whitespace use consistent. |
29 |
+ |
30 |
+At least python-3.5.x complains about this forcefully. |
31 |
+ |
32 |
+Signed-off-by: Thomas Klausner <wiz@××××××.org> |
33 |
+Signed-off-by: Uli Schlachter <psychon@×××.in> |
34 |
+ |
35 |
+diff --git a/xcbgen/align.py b/xcbgen/align.py |
36 |
+index 5e31838..d4c12ee 100644 |
37 |
+--- a/xcbgen/align.py |
38 |
++++ b/xcbgen/align.py |
39 |
+@@ -16,12 +16,12 @@ class Alignment(object): |
40 |
+ return self.align == other.align and self.offset == other.offset |
41 |
+ |
42 |
+ def __str__(self): |
43 |
+- return "(align=%d, offset=%d)" % (self.align, self.offset) |
44 |
++ return "(align=%d, offset=%d)" % (self.align, self.offset) |
45 |
+ |
46 |
+ @staticmethod |
47 |
+ def for_primitive_type(size): |
48 |
+- # compute the required start_alignment based on the size of the type |
49 |
+- if size % 8 == 0: |
50 |
++ # compute the required start_alignment based on the size of the type |
51 |
++ if size % 8 == 0: |
52 |
+ # do 8-byte primitives require 8-byte alignment in X11? |
53 |
+ return Alignment(8,0) |
54 |
+ elif size % 4 == 0: |
55 |
+@@ -33,7 +33,7 @@ class Alignment(object): |
56 |
+ |
57 |
+ |
58 |
+ def align_after_fixed_size(self, size): |
59 |
+- new_offset = (self.offset + size) % self.align |
60 |
++ new_offset = (self.offset + size) % self.align |
61 |
+ return Alignment(self.align, new_offset) |
62 |
+ |
63 |
+ |
64 |
+@@ -41,7 +41,7 @@ class Alignment(object): |
65 |
+ ''' |
66 |
+ Assuming the given external_align, checks whether |
67 |
+ self is fulfilled for all cases. |
68 |
+- Returns True if yes, False otherwise. |
69 |
++ Returns True if yes, False otherwise. |
70 |
+ ''' |
71 |
+ if self.align == 1 and self.offset == 0: |
72 |
+ # alignment 1 with offset 0 is always fulfilled |
73 |
+@@ -55,9 +55,9 @@ class Alignment(object): |
74 |
+ # the external align guarantees less alignment -> not guaranteed |
75 |
+ return False |
76 |
+ |
77 |
+- if external_align.align % self.align != 0: |
78 |
++ if external_align.align % self.align != 0: |
79 |
+ # the external align cannot be divided by our align |
80 |
+- # -> not guaranteed |
81 |
++ # -> not guaranteed |
82 |
+ # (this can only happen if there are alignments that are not |
83 |
+ # a power of 2, which is highly discouraged. But better be |
84 |
+ # safe and check for it) |
85 |
+@@ -72,7 +72,7 @@ class Alignment(object): |
86 |
+ |
87 |
+ def combine_with(self, other): |
88 |
+ # returns the alignment that is guaranteed when |
89 |
+- # both, self or other, can happen |
90 |
++ # both, self or other, can happen |
91 |
+ new_align = gcd(self.align, other.align) |
92 |
+ new_offset_candidate1 = self.offset % new_align |
93 |
+ new_offset_candidate2 = other.offset % new_align |
94 |
+@@ -83,8 +83,8 @@ class Alignment(object): |
95 |
+ new_align = gcd(new_align, offset_diff) |
96 |
+ new_offset_candidate1 = self.offset % new_align |
97 |
+ new_offset_candidate2 = other.offset % new_align |
98 |
+- assert new_offset_candidate1 == new_offset_candidate2 |
99 |
+- new_offset = new_offset_candidate1 |
100 |
++ assert new_offset_candidate1 == new_offset_candidate2 |
101 |
++ new_offset = new_offset_candidate1 |
102 |
+ # return the result |
103 |
+ return Alignment(new_align, new_offset) |
104 |
+ |
105 |
+@@ -92,44 +92,44 @@ class Alignment(object): |
106 |
+ class AlignmentLog(object): |
107 |
+ |
108 |
+ def __init__(self): |
109 |
+- self.ok_list = [] |
110 |
+- self.fail_list = [] |
111 |
+- self.verbosity = 1 |
112 |
++ self.ok_list = [] |
113 |
++ self.fail_list = [] |
114 |
++ self.verbosity = 1 |
115 |
+ |
116 |
+ def __str__(self): |
117 |
+- result = "" |
118 |
++ result = "" |
119 |
+ |
120 |
+- # output the OK-list |
121 |
+- for (align_before, field_name, type_obj, callstack, align_after) in self.ok_list: |
122 |
+- stacksize = len(callstack) |
123 |
++ # output the OK-list |
124 |
++ for (align_before, field_name, type_obj, callstack, align_after) in self.ok_list: |
125 |
++ stacksize = len(callstack) |
126 |
+ indent = ' ' * stacksize |
127 |
+- if self.ok_callstack_is_relevant(callstack): |
128 |
++ if self.ok_callstack_is_relevant(callstack): |
129 |
+ if field_name is None or field_name == "": |
130 |
+- result += (" %sok: %s:\n\t%sbefore: %s, after: %s\n" |
131 |
+- % (indent, str(type_obj), indent, str(align_before), str(align_after))) |
132 |
+- else: |
133 |
+- result += (" %sok: field \"%s\" in %s:\n\t%sbefore: %s, after: %s\n" |
134 |
+- % (indent, str(field_name), str(type_obj), |
135 |
+- indent, str(align_before), str(align_after))) |
136 |
++ result += (" %sok: %s:\n\t%sbefore: %s, after: %s\n" |
137 |
++ % (indent, str(type_obj), indent, str(align_before), str(align_after))) |
138 |
++ else: |
139 |
++ result += (" %sok: field \"%s\" in %s:\n\t%sbefore: %s, after: %s\n" |
140 |
++ % (indent, str(field_name), str(type_obj), |
141 |
++ indent, str(align_before), str(align_after))) |
142 |
+ if self.verbosity >= 1: |
143 |
+- result += self.callstack_to_str(indent, callstack) |
144 |
++ result += self.callstack_to_str(indent, callstack) |
145 |
+ |
146 |
+- # output the fail-list |
147 |
+- for (align_before, field_name, type_obj, callstack, reason) in self.fail_list: |
148 |
+- stacksize = len(callstack) |
149 |
++ # output the fail-list |
150 |
++ for (align_before, field_name, type_obj, callstack, reason) in self.fail_list: |
151 |
++ stacksize = len(callstack) |
152 |
+ indent = ' ' * stacksize |
153 |
+- if field_name is None or field_name == "": |
154 |
+- result += (" %sfail: align %s is incompatible with\n\t%s%s\n\t%sReason: %s\n" |
155 |
+- % (indent, str(align_before), indent, str(type_obj), indent, reason)) |
156 |
+- else: |
157 |
+- result += (" %sfail: align %s is incompatible with\n\t%sfield \"%s\" in %s\n\t%sReason: %s\n" |
158 |
+- % (indent, str(align_before), indent, str(field_name), str(type_obj), indent, reason)) |
159 |
++ if field_name is None or field_name == "": |
160 |
++ result += (" %sfail: align %s is incompatible with\n\t%s%s\n\t%sReason: %s\n" |
161 |
++ % (indent, str(align_before), indent, str(type_obj), indent, reason)) |
162 |
++ else: |
163 |
++ result += (" %sfail: align %s is incompatible with\n\t%sfield \"%s\" in %s\n\t%sReason: %s\n" |
164 |
++ % (indent, str(align_before), indent, str(field_name), str(type_obj), indent, reason)) |
165 |
+ |
166 |
+ if self.verbosity >= 1: |
167 |
+- result += self.callstack_to_str(indent, callstack) |
168 |
++ result += self.callstack_to_str(indent, callstack) |
169 |
+ |
170 |
+ |
171 |
+- return result |
172 |
++ return result |
173 |
+ |
174 |
+ |
175 |
+ def callstack_to_str(self, indent, callstack): |
176 |
+@@ -137,41 +137,41 @@ class AlignmentLog(object): |
177 |
+ for stack_elem in callstack: |
178 |
+ result += "\t %s%s\n" % (indent, str(stack_elem)) |
179 |
+ result += "\t%s]\n" % indent |
180 |
+- return result |
181 |
++ return result |
182 |
+ |
183 |
+ |
184 |
+ def ok_callstack_is_relevant(self, ok_callstack): |
185 |
+ # determine whether an ok callstack is relevant for logging |
186 |
+- if self.verbosity >= 2: |
187 |
+- return True |
188 |
++ if self.verbosity >= 2: |
189 |
++ return True |
190 |
+ |
191 |
+ # empty callstacks are always relevant |
192 |
+- if len(ok_callstack) == 0: |
193 |
++ if len(ok_callstack) == 0: |
194 |
+ return True |
195 |
+ |
196 |
+- # check whether the ok_callstack is a subset or equal to a fail_callstack |
197 |
++ # check whether the ok_callstack is a subset or equal to a fail_callstack |
198 |
+ for (align_before, field_name, type_obj, fail_callstack, reason) in self.fail_list: |
199 |
+ if len(ok_callstack) <= len(fail_callstack): |
200 |
+ zipped = zip(ok_callstack, fail_callstack[:len(ok_callstack)]) |
201 |
+- is_subset = all([i == j for i, j in zipped]) |
202 |
+- if is_subset: |
203 |
++ is_subset = all([i == j for i, j in zipped]) |
204 |
++ if is_subset: |
205 |
+ return True |
206 |
+ |
207 |
+ return False |
208 |
+ |
209 |
+ |
210 |
+ def ok(self, align_before, field_name, type_obj, callstack, align_after): |
211 |
+- self.ok_list.append((align_before, field_name, type_obj, callstack, align_after)) |
212 |
++ self.ok_list.append((align_before, field_name, type_obj, callstack, align_after)) |
213 |
+ |
214 |
+ def fail(self, align_before, field_name, type_obj, callstack, reason): |
215 |
+- self.fail_list.append((align_before, field_name, type_obj, callstack, reason)) |
216 |
++ self.fail_list.append((align_before, field_name, type_obj, callstack, reason)) |
217 |
+ |
218 |
+ def append(self, other): |
219 |
+- self.ok_list.extend(other.ok_list) |
220 |
+- self.fail_list.extend(other.fail_list) |
221 |
++ self.ok_list.extend(other.ok_list) |
222 |
++ self.fail_list.extend(other.fail_list) |
223 |
+ |
224 |
+ def ok_count(self): |
225 |
+- return len(self.ok_list) |
226 |
++ return len(self.ok_list) |
227 |
+ |
228 |
+ |
229 |
+ |
230 |
+-- |
231 |
+cgit v0.10.2 |
232 |
+ |
233 |
|
234 |
diff --git a/x11-proto/xcb-proto/files/xcb-proto-1.12-print-is-a-function-and-needs-parentheses.patch b/x11-proto/xcb-proto/files/xcb-proto-1.12-print-is-a-function-and-needs-parentheses.patch |
235 |
new file mode 100644 |
236 |
index 0000000..fed0745 |
237 |
--- /dev/null |
238 |
+++ b/x11-proto/xcb-proto/files/xcb-proto-1.12-print-is-a-function-and-needs-parentheses.patch |
239 |
@@ -0,0 +1,68 @@ |
240 |
+From bea5e1c85bdc0950913790364e18228f20395a3d Mon Sep 17 00:00:00 2001 |
241 |
+From: Thomas Klausner <wiz@××××××.org> |
242 |
+Date: Thu, 19 May 2016 17:30:05 +0200 |
243 |
+Subject: print() is a function and needs parentheses. |
244 |
+ |
245 |
+Fixes build with python-3.x. |
246 |
+ |
247 |
+Signed-off-by: Thomas Klausner <wiz@××××××.org> |
248 |
+Signed-off-by: Uli Schlachter <psychon@×××.in> |
249 |
+ |
250 |
+diff --git a/xcbgen/xtypes.py b/xcbgen/xtypes.py |
251 |
+index c3b5758..b83b119 100644 |
252 |
+--- a/xcbgen/xtypes.py |
253 |
++++ b/xcbgen/xtypes.py |
254 |
+@@ -501,7 +501,7 @@ class ComplexType(Type): |
255 |
+ int(required_start_align_element.get('align', "4"), 0), |
256 |
+ int(required_start_align_element.get('offset', "0"), 0)) |
257 |
+ if verbose_align_log: |
258 |
+- print "Explicit start-align for %s: %s\n" % (self, self.required_start_align) |
259 |
++ print ("Explicit start-align for %s: %s\n" % (self, self.required_start_align)) |
260 |
+ |
261 |
+ def resolve(self, module): |
262 |
+ if self.resolved: |
263 |
+@@ -592,7 +592,7 @@ class ComplexType(Type): |
264 |
+ if verbose_align_log: |
265 |
+ print ("calc_required_start_align: %s has start-align %s" |
266 |
+ % (str(self), str(self.required_start_align))) |
267 |
+- print "Details:\n" + str(log) |
268 |
++ print ("Details:\n" + str(log)) |
269 |
+ if self.required_start_align.offset != 0: |
270 |
+ print (("WARNING: %s\n\thas start-align with non-zero offset: %s" |
271 |
+ + "\n\tsuggest to add explicit definition with:" |
272 |
+@@ -619,12 +619,12 @@ class ComplexType(Type): |
273 |
+ for offset in range(0,align): |
274 |
+ align_candidate = Alignment(align, offset) |
275 |
+ if verbose_align_log: |
276 |
+- print "trying %s for %s" % (str(align_candidate), str(self)) |
277 |
++ print ("trying %s for %s" % (str(align_candidate), str(self))) |
278 |
+ my_log = AlignmentLog() |
279 |
+ if self.is_possible_start_align(align_candidate, callstack, my_log): |
280 |
+ log.append(my_log) |
281 |
+ if verbose_align_log: |
282 |
+- print "found start-align %s for %s" % (str(align_candidate), str(self)) |
283 |
++ print ("found start-align %s for %s" % (str(align_candidate), str(self))) |
284 |
+ return align_candidate |
285 |
+ else: |
286 |
+ my_ok_count = my_log.ok_count() |
287 |
+@@ -641,7 +641,7 @@ class ComplexType(Type): |
288 |
+ # none of the candidates applies |
289 |
+ # this type has illegal internal aligns for all possible start_aligns |
290 |
+ if verbose_align_log: |
291 |
+- print "didn't find start-align for %s" % str(self) |
292 |
++ print ("didn't find start-align for %s" % str(self)) |
293 |
+ log.append(best_log) |
294 |
+ return None |
295 |
+ |
296 |
+@@ -900,7 +900,7 @@ class SwitchType(ComplexType): |
297 |
+ # aux function for unchecked_get_alignment_after |
298 |
+ def get_align_for_selected_case_field(self, case_field, start_align, callstack, log): |
299 |
+ if verbose_align_log: |
300 |
+- print "get_align_for_selected_case_field: %s, case_field = %s" % (str(self), str(case_field)) |
301 |
++ print ("get_align_for_selected_case_field: %s, case_field = %s" % (str(self), str(case_field))) |
302 |
+ total_align = start_align |
303 |
+ for field in self.bitcases: |
304 |
+ my_callstack = callstack[:] |
305 |
+-- |
306 |
+cgit v0.10.2 |
307 |
+ |
308 |
|
309 |
diff --git a/x11-proto/xcb-proto/xcb-proto-1.12.ebuild b/x11-proto/xcb-proto/xcb-proto-1.12-r1.ebuild |
310 |
similarity index 91% |
311 |
rename from x11-proto/xcb-proto/xcb-proto-1.12.ebuild |
312 |
rename to x11-proto/xcb-proto/xcb-proto-1.12-r1.ebuild |
313 |
index 9b40e83..8ef85b6 100644 |
314 |
--- a/x11-proto/xcb-proto/xcb-proto-1.12.ebuild |
315 |
+++ b/x11-proto/xcb-proto/xcb-proto-1.12-r1.ebuild |
316 |
@@ -24,6 +24,11 @@ DEPEND="${RDEPEND} |
317 |
|
318 |
REQUIRED_USE="${PYTHON_REQUIRED_USE}" |
319 |
|
320 |
+PATCHES=( |
321 |
+ "${FILESDIR}"/${P}-make-whitespace-usage-consistent.patch |
322 |
+ "${FILESDIR}"/${P}-print-is-a-function-and-needs-parentheses.patch |
323 |
+) |
324 |
+ |
325 |
src_configure() { |
326 |
python_setup |
327 |
xorg-2_src_configure |