Version 3.11
[packages/centos7/PyYAML.git] / debian-big-endian-fix.patch
1 pyyaml FTBFS on the s390x buildd.  It seems this is due to using int
2 where the libyaml API uses size_t.  I tested the attached patch in
3 zelenka.d.o's sid chroot, and at least the python2 build/test worked (it
4 failed with the same error as the buildd pre-patching).
5 Patch by Julien Cristau <jcristau@debian.org>
6 Add to the pyyaml package by Scott Kitterman <scott@kitterman.com>
7 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=676536
8
9 Index: pyyaml-3.10/ext/_yaml.pxd
10 ===================================================================
11 --- pyyaml-3.10.orig/ext/_yaml.pxd      2011-05-29 23:31:01.000000000 -0400
12 +++ pyyaml-3.10/ext/_yaml.pxd   2012-06-08 16:33:54.309407701 -0400
13 @@ -86,15 +86,15 @@
14          YAML_MAPPING_END_EVENT
15  
16      ctypedef int yaml_read_handler_t(void *data, char *buffer,
17 -            int size, int *size_read) except 0
18 +            size_t size, size_t *size_read) except 0
19  
20      ctypedef int yaml_write_handler_t(void *data, char *buffer,
21 -            int size) except 0
22 +            size_t size) except 0
23  
24      ctypedef struct yaml_mark_t:
25 -        int index
26 -        int line
27 -        int column
28 +        size_t index
29 +        size_t line
30 +        size_t column
31      ctypedef struct yaml_version_directive_t:
32          int major
33          int minor
34 @@ -113,7 +113,7 @@
35          char *suffix
36      ctypedef struct _yaml_token_scalar_data_t:
37          char *value
38 -        int length
39 +        size_t length
40          yaml_scalar_style_t style
41      ctypedef struct _yaml_token_version_directive_data_t:
42          int major
43 @@ -152,7 +152,7 @@
44          char *anchor
45          char *tag
46          char *value
47 -        int length
48 +        size_t length
49          int plain_implicit
50          int quoted_implicit
51          yaml_scalar_style_t style
52 Index: pyyaml-3.10/ext/_yaml.pyx
53 ===================================================================
54 --- pyyaml-3.10.orig/ext/_yaml.pyx      2011-05-29 23:31:01.000000000 -0400
55 +++ pyyaml-3.10/ext/_yaml.pyx   2012-06-08 16:33:54.313409701 -0400
56 @@ -905,7 +905,7 @@
57                  raise error
58          return 1
59  
60 -cdef int input_handler(void *data, char *buffer, int size, int *read) except 0:
61 +cdef int input_handler(void *data, char *buffer, size_t size, size_t *read) except 0:
62      cdef CParser parser
63      parser = <CParser>data
64      if parser.stream_cache is None:
65 @@ -1515,7 +1515,7 @@
66              self.ascend_resolver()
67          return 1
68  
69 -cdef int output_handler(void *data, char *buffer, int size) except 0:
70 +cdef int output_handler(void *data, char *buffer, size_t size) except 0:
71      cdef CEmitter emitter
72      emitter = <CEmitter>data
73      if emitter.dump_unicode == 0: