diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2016-10-11 19:48:12 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-10-15 10:01:43 +0100 |
commit | ede331909b0b364e150b49be34e2a93f32db4729 (patch) | |
tree | 077c6f2008abe6502fe91bdeee2d93be35b1a133 /meta/recipes-graphics/xorg-proto | |
parent | a489cb14b99e91b3afa72f767364913446aa2483 (diff) | |
download | poky-ede331909b0b364e150b49be34e2a93f32db4729.tar.gz |
xcb-proto: fix for python3
Backport two patches to make it py3 friendly.
(From OE-Core rev: 647ff3bed1823b53a41a5c2640ffc5f4d50d1e11)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-graphics/xorg-proto')
3 files changed, 294 insertions, 1 deletions
diff --git a/meta/recipes-graphics/xorg-proto/xcb-proto/0001-Make-whitespace-use-consistent.patch b/meta/recipes-graphics/xorg-proto/xcb-proto/0001-Make-whitespace-use-consistent.patch new file mode 100644 index 0000000000..89ec66618e --- /dev/null +++ b/meta/recipes-graphics/xorg-proto/xcb-proto/0001-Make-whitespace-use-consistent.patch | |||
@@ -0,0 +1,215 @@ | |||
1 | From ea7a3ac6c658164690e0febb55f4467cb9e0bcac Mon Sep 17 00:00:00 2001 | ||
2 | From: Thomas Klausner <wiz@NetBSD.org> | ||
3 | Date: Thu, 19 May 2016 17:30:04 +0200 | ||
4 | Subject: [PATCH 1/2] Make whitespace use consistent. | ||
5 | |||
6 | At least python-3.5.x complains about this forcefully. | ||
7 | |||
8 | Signed-off-by: Thomas Klausner <wiz@NetBSD.org> | ||
9 | Signed-off-by: Uli Schlachter <psychon@znc.in> | ||
10 | |||
11 | Upstream-Status: Backport | ||
12 | |||
13 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
14 | --- | ||
15 | xcbgen/align.py | 96 ++++++++++++++++++++++++++++----------------------------- | ||
16 | 1 file changed, 48 insertions(+), 48 deletions(-) | ||
17 | |||
18 | diff --git a/xcbgen/align.py b/xcbgen/align.py | ||
19 | index 5e31838..d4c12ee 100644 | ||
20 | --- a/xcbgen/align.py | ||
21 | +++ b/xcbgen/align.py | ||
22 | @@ -16,12 +16,12 @@ class Alignment(object): | ||
23 | return self.align == other.align and self.offset == other.offset | ||
24 | |||
25 | def __str__(self): | ||
26 | - return "(align=%d, offset=%d)" % (self.align, self.offset) | ||
27 | + return "(align=%d, offset=%d)" % (self.align, self.offset) | ||
28 | |||
29 | @staticmethod | ||
30 | def for_primitive_type(size): | ||
31 | - # compute the required start_alignment based on the size of the type | ||
32 | - if size % 8 == 0: | ||
33 | + # compute the required start_alignment based on the size of the type | ||
34 | + if size % 8 == 0: | ||
35 | # do 8-byte primitives require 8-byte alignment in X11? | ||
36 | return Alignment(8,0) | ||
37 | elif size % 4 == 0: | ||
38 | @@ -33,7 +33,7 @@ class Alignment(object): | ||
39 | |||
40 | |||
41 | def align_after_fixed_size(self, size): | ||
42 | - new_offset = (self.offset + size) % self.align | ||
43 | + new_offset = (self.offset + size) % self.align | ||
44 | return Alignment(self.align, new_offset) | ||
45 | |||
46 | |||
47 | @@ -41,7 +41,7 @@ class Alignment(object): | ||
48 | ''' | ||
49 | Assuming the given external_align, checks whether | ||
50 | self is fulfilled for all cases. | ||
51 | - Returns True if yes, False otherwise. | ||
52 | + Returns True if yes, False otherwise. | ||
53 | ''' | ||
54 | if self.align == 1 and self.offset == 0: | ||
55 | # alignment 1 with offset 0 is always fulfilled | ||
56 | @@ -55,9 +55,9 @@ class Alignment(object): | ||
57 | # the external align guarantees less alignment -> not guaranteed | ||
58 | return False | ||
59 | |||
60 | - if external_align.align % self.align != 0: | ||
61 | + if external_align.align % self.align != 0: | ||
62 | # the external align cannot be divided by our align | ||
63 | - # -> not guaranteed | ||
64 | + # -> not guaranteed | ||
65 | # (this can only happen if there are alignments that are not | ||
66 | # a power of 2, which is highly discouraged. But better be | ||
67 | # safe and check for it) | ||
68 | @@ -72,7 +72,7 @@ class Alignment(object): | ||
69 | |||
70 | def combine_with(self, other): | ||
71 | # returns the alignment that is guaranteed when | ||
72 | - # both, self or other, can happen | ||
73 | + # both, self or other, can happen | ||
74 | new_align = gcd(self.align, other.align) | ||
75 | new_offset_candidate1 = self.offset % new_align | ||
76 | new_offset_candidate2 = other.offset % new_align | ||
77 | @@ -83,8 +83,8 @@ class Alignment(object): | ||
78 | new_align = gcd(new_align, offset_diff) | ||
79 | new_offset_candidate1 = self.offset % new_align | ||
80 | new_offset_candidate2 = other.offset % new_align | ||
81 | - assert new_offset_candidate1 == new_offset_candidate2 | ||
82 | - new_offset = new_offset_candidate1 | ||
83 | + assert new_offset_candidate1 == new_offset_candidate2 | ||
84 | + new_offset = new_offset_candidate1 | ||
85 | # return the result | ||
86 | return Alignment(new_align, new_offset) | ||
87 | |||
88 | @@ -92,44 +92,44 @@ class Alignment(object): | ||
89 | class AlignmentLog(object): | ||
90 | |||
91 | def __init__(self): | ||
92 | - self.ok_list = [] | ||
93 | - self.fail_list = [] | ||
94 | - self.verbosity = 1 | ||
95 | + self.ok_list = [] | ||
96 | + self.fail_list = [] | ||
97 | + self.verbosity = 1 | ||
98 | |||
99 | def __str__(self): | ||
100 | - result = "" | ||
101 | + result = "" | ||
102 | |||
103 | - # output the OK-list | ||
104 | - for (align_before, field_name, type_obj, callstack, align_after) in self.ok_list: | ||
105 | - stacksize = len(callstack) | ||
106 | + # output the OK-list | ||
107 | + for (align_before, field_name, type_obj, callstack, align_after) in self.ok_list: | ||
108 | + stacksize = len(callstack) | ||
109 | indent = ' ' * stacksize | ||
110 | - if self.ok_callstack_is_relevant(callstack): | ||
111 | + if self.ok_callstack_is_relevant(callstack): | ||
112 | if field_name is None or field_name == "": | ||
113 | - result += (" %sok: %s:\n\t%sbefore: %s, after: %s\n" | ||
114 | - % (indent, str(type_obj), indent, str(align_before), str(align_after))) | ||
115 | - else: | ||
116 | - result += (" %sok: field \"%s\" in %s:\n\t%sbefore: %s, after: %s\n" | ||
117 | - % (indent, str(field_name), str(type_obj), | ||
118 | - indent, str(align_before), str(align_after))) | ||
119 | + result += (" %sok: %s:\n\t%sbefore: %s, after: %s\n" | ||
120 | + % (indent, str(type_obj), indent, str(align_before), str(align_after))) | ||
121 | + else: | ||
122 | + result += (" %sok: field \"%s\" in %s:\n\t%sbefore: %s, after: %s\n" | ||
123 | + % (indent, str(field_name), str(type_obj), | ||
124 | + indent, str(align_before), str(align_after))) | ||
125 | if self.verbosity >= 1: | ||
126 | - result += self.callstack_to_str(indent, callstack) | ||
127 | + result += self.callstack_to_str(indent, callstack) | ||
128 | |||
129 | - # output the fail-list | ||
130 | - for (align_before, field_name, type_obj, callstack, reason) in self.fail_list: | ||
131 | - stacksize = len(callstack) | ||
132 | + # output the fail-list | ||
133 | + for (align_before, field_name, type_obj, callstack, reason) in self.fail_list: | ||
134 | + stacksize = len(callstack) | ||
135 | indent = ' ' * stacksize | ||
136 | - if field_name is None or field_name == "": | ||
137 | - result += (" %sfail: align %s is incompatible with\n\t%s%s\n\t%sReason: %s\n" | ||
138 | - % (indent, str(align_before), indent, str(type_obj), indent, reason)) | ||
139 | - else: | ||
140 | - result += (" %sfail: align %s is incompatible with\n\t%sfield \"%s\" in %s\n\t%sReason: %s\n" | ||
141 | - % (indent, str(align_before), indent, str(field_name), str(type_obj), indent, reason)) | ||
142 | + if field_name is None or field_name == "": | ||
143 | + result += (" %sfail: align %s is incompatible with\n\t%s%s\n\t%sReason: %s\n" | ||
144 | + % (indent, str(align_before), indent, str(type_obj), indent, reason)) | ||
145 | + else: | ||
146 | + result += (" %sfail: align %s is incompatible with\n\t%sfield \"%s\" in %s\n\t%sReason: %s\n" | ||
147 | + % (indent, str(align_before), indent, str(field_name), str(type_obj), indent, reason)) | ||
148 | |||
149 | if self.verbosity >= 1: | ||
150 | - result += self.callstack_to_str(indent, callstack) | ||
151 | + result += self.callstack_to_str(indent, callstack) | ||
152 | |||
153 | |||
154 | - return result | ||
155 | + return result | ||
156 | |||
157 | |||
158 | def callstack_to_str(self, indent, callstack): | ||
159 | @@ -137,41 +137,41 @@ class AlignmentLog(object): | ||
160 | for stack_elem in callstack: | ||
161 | result += "\t %s%s\n" % (indent, str(stack_elem)) | ||
162 | result += "\t%s]\n" % indent | ||
163 | - return result | ||
164 | + return result | ||
165 | |||
166 | |||
167 | def ok_callstack_is_relevant(self, ok_callstack): | ||
168 | # determine whether an ok callstack is relevant for logging | ||
169 | - if self.verbosity >= 2: | ||
170 | - return True | ||
171 | + if self.verbosity >= 2: | ||
172 | + return True | ||
173 | |||
174 | # empty callstacks are always relevant | ||
175 | - if len(ok_callstack) == 0: | ||
176 | + if len(ok_callstack) == 0: | ||
177 | return True | ||
178 | |||
179 | - # check whether the ok_callstack is a subset or equal to a fail_callstack | ||
180 | + # check whether the ok_callstack is a subset or equal to a fail_callstack | ||
181 | for (align_before, field_name, type_obj, fail_callstack, reason) in self.fail_list: | ||
182 | if len(ok_callstack) <= len(fail_callstack): | ||
183 | zipped = zip(ok_callstack, fail_callstack[:len(ok_callstack)]) | ||
184 | - is_subset = all([i == j for i, j in zipped]) | ||
185 | - if is_subset: | ||
186 | + is_subset = all([i == j for i, j in zipped]) | ||
187 | + if is_subset: | ||
188 | return True | ||
189 | |||
190 | return False | ||
191 | |||
192 | |||
193 | def ok(self, align_before, field_name, type_obj, callstack, align_after): | ||
194 | - self.ok_list.append((align_before, field_name, type_obj, callstack, align_after)) | ||
195 | + self.ok_list.append((align_before, field_name, type_obj, callstack, align_after)) | ||
196 | |||
197 | def fail(self, align_before, field_name, type_obj, callstack, reason): | ||
198 | - self.fail_list.append((align_before, field_name, type_obj, callstack, reason)) | ||
199 | + self.fail_list.append((align_before, field_name, type_obj, callstack, reason)) | ||
200 | |||
201 | def append(self, other): | ||
202 | - self.ok_list.extend(other.ok_list) | ||
203 | - self.fail_list.extend(other.fail_list) | ||
204 | + self.ok_list.extend(other.ok_list) | ||
205 | + self.fail_list.extend(other.fail_list) | ||
206 | |||
207 | def ok_count(self): | ||
208 | - return len(self.ok_list) | ||
209 | + return len(self.ok_list) | ||
210 | |||
211 | |||
212 | |||
213 | -- | ||
214 | 2.9.0 | ||
215 | |||
diff --git a/meta/recipes-graphics/xorg-proto/xcb-proto/0002-print-is-a-function-and-needs-parentheses.patch b/meta/recipes-graphics/xorg-proto/xcb-proto/0002-print-is-a-function-and-needs-parentheses.patch new file mode 100644 index 0000000000..542acb82b8 --- /dev/null +++ b/meta/recipes-graphics/xorg-proto/xcb-proto/0002-print-is-a-function-and-needs-parentheses.patch | |||
@@ -0,0 +1,75 @@ | |||
1 | From bea5e1c85bdc0950913790364e18228f20395a3d Mon Sep 17 00:00:00 2001 | ||
2 | From: Thomas Klausner <wiz@NetBSD.org> | ||
3 | Date: Thu, 19 May 2016 17:30:05 +0200 | ||
4 | Subject: [PATCH 2/2] print() is a function and needs parentheses. | ||
5 | |||
6 | Fixes build with python-3.x. | ||
7 | |||
8 | Signed-off-by: Thomas Klausner <wiz@NetBSD.org> | ||
9 | Signed-off-by: Uli Schlachter <psychon@znc.in> | ||
10 | |||
11 | Upstream-Status: Backport | ||
12 | |||
13 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
14 | --- | ||
15 | xcbgen/xtypes.py | 12 ++++++------ | ||
16 | 1 file changed, 6 insertions(+), 6 deletions(-) | ||
17 | |||
18 | diff --git a/xcbgen/xtypes.py b/xcbgen/xtypes.py | ||
19 | index c3b5758..b83b119 100644 | ||
20 | --- a/xcbgen/xtypes.py | ||
21 | +++ b/xcbgen/xtypes.py | ||
22 | @@ -501,7 +501,7 @@ class ComplexType(Type): | ||
23 | int(required_start_align_element.get('align', "4"), 0), | ||
24 | int(required_start_align_element.get('offset', "0"), 0)) | ||
25 | if verbose_align_log: | ||
26 | - print "Explicit start-align for %s: %s\n" % (self, self.required_start_align) | ||
27 | + print ("Explicit start-align for %s: %s\n" % (self, self.required_start_align)) | ||
28 | |||
29 | def resolve(self, module): | ||
30 | if self.resolved: | ||
31 | @@ -592,7 +592,7 @@ class ComplexType(Type): | ||
32 | if verbose_align_log: | ||
33 | print ("calc_required_start_align: %s has start-align %s" | ||
34 | % (str(self), str(self.required_start_align))) | ||
35 | - print "Details:\n" + str(log) | ||
36 | + print ("Details:\n" + str(log)) | ||
37 | if self.required_start_align.offset != 0: | ||
38 | print (("WARNING: %s\n\thas start-align with non-zero offset: %s" | ||
39 | + "\n\tsuggest to add explicit definition with:" | ||
40 | @@ -619,12 +619,12 @@ class ComplexType(Type): | ||
41 | for offset in range(0,align): | ||
42 | align_candidate = Alignment(align, offset) | ||
43 | if verbose_align_log: | ||
44 | - print "trying %s for %s" % (str(align_candidate), str(self)) | ||
45 | + print ("trying %s for %s" % (str(align_candidate), str(self))) | ||
46 | my_log = AlignmentLog() | ||
47 | if self.is_possible_start_align(align_candidate, callstack, my_log): | ||
48 | log.append(my_log) | ||
49 | if verbose_align_log: | ||
50 | - print "found start-align %s for %s" % (str(align_candidate), str(self)) | ||
51 | + print ("found start-align %s for %s" % (str(align_candidate), str(self))) | ||
52 | return align_candidate | ||
53 | else: | ||
54 | my_ok_count = my_log.ok_count() | ||
55 | @@ -641,7 +641,7 @@ class ComplexType(Type): | ||
56 | # none of the candidates applies | ||
57 | # this type has illegal internal aligns for all possible start_aligns | ||
58 | if verbose_align_log: | ||
59 | - print "didn't find start-align for %s" % str(self) | ||
60 | + print ("didn't find start-align for %s" % str(self)) | ||
61 | log.append(best_log) | ||
62 | return None | ||
63 | |||
64 | @@ -900,7 +900,7 @@ class SwitchType(ComplexType): | ||
65 | # aux function for unchecked_get_alignment_after | ||
66 | def get_align_for_selected_case_field(self, case_field, start_align, callstack, log): | ||
67 | if verbose_align_log: | ||
68 | - print "get_align_for_selected_case_field: %s, case_field = %s" % (str(self), str(case_field)) | ||
69 | + print ("get_align_for_selected_case_field: %s, case_field = %s" % (str(self), str(case_field))) | ||
70 | total_align = start_align | ||
71 | for field in self.bitcases: | ||
72 | my_callstack = callstack[:] | ||
73 | -- | ||
74 | 2.9.0 | ||
75 | |||
diff --git a/meta/recipes-graphics/xorg-proto/xcb-proto_1.12.bb b/meta/recipes-graphics/xorg-proto/xcb-proto_1.12.bb index 7d4a6b4364..bc04bc48ea 100644 --- a/meta/recipes-graphics/xorg-proto/xcb-proto_1.12.bb +++ b/meta/recipes-graphics/xorg-proto/xcb-proto_1.12.bb | |||
@@ -12,7 +12,10 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d763b081cb10c223435b01e00dc0aba7 \ | |||
12 | file://src/dri2.xml;beginline=2;endline=28;md5=f8763b13ff432e8597e0d610cf598e65" | 12 | file://src/dri2.xml;beginline=2;endline=28;md5=f8763b13ff432e8597e0d610cf598e65" |
13 | 13 | ||
14 | SRC_URI = "http://xcb.freedesktop.org/dist/xcb-proto-${PV}.tar.bz2 \ | 14 | SRC_URI = "http://xcb.freedesktop.org/dist/xcb-proto-${PV}.tar.bz2 \ |
15 | file://no-python-native.patch" | 15 | file://no-python-native.patch \ |
16 | file://0001-Make-whitespace-use-consistent.patch \ | ||
17 | file://0002-print-is-a-function-and-needs-parentheses.patch \ | ||
18 | " | ||
16 | SRC_URI[md5sum] = "14e60919f859560f28426a685a555962" | 19 | SRC_URI[md5sum] = "14e60919f859560f28426a685a555962" |
17 | SRC_URI[sha256sum] = "5922aba4c664ab7899a29d92ea91a87aa4c1fc7eb5ee550325c3216c480a4906" | 20 | SRC_URI[sha256sum] = "5922aba4c664ab7899a29d92ea91a87aa4c1fc7eb5ee550325c3216c480a4906" |
18 | 21 | ||