libxcb/u_build_python3.patch
Stefan Dirsch f41d2129c3 Accepting request 566624 from openSUSE:Factory:Staging:O
- Really conditionalize the python3 option to allow us building
  without any python2 present
  * u_build_python3.patch
- Convert to pkgconfig style deps
- Format bit with spec-cleaner

OBS-URL: https://build.opensuse.org/request/show/566624
OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/libxcb?expand=0&rev=50
2018-01-17 14:10:23 +00:00

60 lines
2.6 KiB
Diff

Index: libxcb-1.12/src/c_client.py
===================================================================
--- libxcb-1.12.orig/src/c_client.py
+++ libxcb-1.12/src/c_client.py
@@ -1,5 +1,5 @@
-#!/usr/bin/env python
-from __future__ import print_function
+#!/usr/bin/python3
+
import getopt
import os
import sys
@@ -350,7 +350,7 @@ def build_collision_table():
global namecount
namecount = {}
- for v in module.types.values():
+ for v in list(module.types.values()):
name = _t(v[0])
namecount[name] = (namecount.get(name) or 0) + 1
@@ -1368,7 +1368,7 @@ def _c_serialize(context, self):
_c(' unsigned int xcb_align_to = 0;')
if self.is_switch:
_c(' unsigned int xcb_padding_offset = %d;',
- self.get_align_offset() )
+ self.get_align_offset() )
prefix = [('_aux', '->', self)]
aux_ptr = 'xcb_out'
@@ -1394,7 +1394,7 @@ def _c_serialize(context, self):
_c(' unsigned int xcb_align_to = 0;')
if self.is_switch:
_c(' unsigned int xcb_padding_offset = %d;',
- self.get_align_offset() )
+ self.get_align_offset() )
elif 'sizeof' == context:
param_names = [p[2] for p in params]
@@ -1934,14 +1934,14 @@ def _c_accessors_list(self, field):
# from the request size and divide that by the member size
return '(((R->length * 4) - sizeof('+ self.c_type + '))/'+'sizeof('+field.type.member.c_wiretype+'))'
else:
- # use the accessor to get the start of the list, then
- # compute the length of it by subtracting it from
+ # use the accessor to get the start of the list, then
+ # compute the length of it by subtracting it from
# the adress of the first byte after the end of the
# request
- after_end_of_request = '(((char*)R) + R->length * 4)'
- start_of_list = '%s(R)' % (field.c_accessor_name)
+ after_end_of_request = '(((char*)R) + R->length * 4)'
+ start_of_list = '%s(R)' % (field.c_accessor_name)
bytesize_of_list = '%s - (char*)(%s)' % (after_end_of_request, start_of_list)
- return '(%s) / sizeof(%s)' % (bytesize_of_list, field.type.member.c_wiretype)
+ return '(%s) / sizeof(%s)' % (bytesize_of_list, field.type.member.c_wiretype)
else:
raise Exception(
"lengthless lists with varsized members are not supported. Fieldname '%s'"