Some SlackBuild scripts for Slackware.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

176 lines
8.3 KiB

  1. From 00e84cfcc5a0812503b431238fc26c349b0d714f Mon Sep 17 00:00:00 2001
  2. From: David Gobbi <david.gobbi@gmail.com>
  3. Date: Tue, 20 Aug 2019 17:02:24 -0600
  4. Subject: [PATCH] Compatibility for Python 3.8
  5. The PyTypeObject struct was modified in Python 3.8, this change is
  6. required to avoid compile errors.
  7. ---
  8. Utilities/PythonInterpreter/vtkPythonStdStreamCaptureHelper.h | 6 ++++++
  9. Wrapping/PythonCore/PyVTKMethodDescriptor.cxx | 2 +-
  10. Wrapping/PythonCore/PyVTKNamespace.cxx | 2 +-
  11. Wrapping/PythonCore/PyVTKReference.cxx | 8 ++++----
  12. Wrapping/PythonCore/PyVTKTemplate.cxx | 2 +-
  13. Wrapping/PythonCore/vtkPythonCompatibility.h | 8 +++++++-
  14. Wrapping/Tools/vtkWrapPythonClass.c | 2 +-
  15. Wrapping/Tools/vtkWrapPythonEnum.c | 2 +-
  16. Wrapping/Tools/vtkWrapPythonType.c | 2 +-
  17. 9 files changed, 23 insertions(+), 11 deletions(-)
  18. diff --git a/Utilities/PythonInterpreter/vtkPythonStdStreamCaptureHelper.h b/Utilities/PythonInterpreter/vtkPythonStdStreamCaptureHelper.h
  19. index b1c12c8..14ccfbe 100644
  20. --- a/Utilities/PythonInterpreter/vtkPythonStdStreamCaptureHelper.h
  21. +++ b/Utilities/PythonInterpreter/vtkPythonStdStreamCaptureHelper.h
  22. @@ -140,6 +140,12 @@ static PyTypeObject vtkPythonStdStreamCaptureHelperType = {
  23. #if PY_VERSION_HEX >= 0x03040000
  24. 0, // tp_finalize
  25. #endif
  26. +#if PY_VERSION_HEX >= 0x03080000
  27. + 0, // tp_vectorcall
  28. +#if PY_VERSION_HEX < 0x03090000
  29. + 0, // tp_print
  30. +#endif
  31. +#endif
  32. };
  33. static PyObject* vtkWrite(PyObject* self, PyObject* args)
  34. diff --git a/Wrapping/PythonCore/PyVTKMethodDescriptor.cxx b/Wrapping/PythonCore/PyVTKMethodDescriptor.cxx
  35. index 2b0d443..3840038 100644
  36. --- a/Wrapping/PythonCore/PyVTKMethodDescriptor.cxx
  37. +++ b/Wrapping/PythonCore/PyVTKMethodDescriptor.cxx
  38. @@ -186,7 +186,7 @@ PyTypeObject PyVTKMethodDescriptor_Type = {
  39. sizeof(PyMethodDescrObject), // tp_basicsize
  40. 0, // tp_itemsize
  41. PyVTKMethodDescriptor_Delete, // tp_dealloc
  42. - nullptr, // tp_print
  43. + 0, // tp_vectorcall_offset
  44. nullptr, // tp_getattr
  45. nullptr, // tp_setattr
  46. nullptr, // tp_compare
  47. diff --git a/Wrapping/PythonCore/PyVTKNamespace.cxx b/Wrapping/PythonCore/PyVTKNamespace.cxx
  48. index 71ee2a3..5cf5bfb 100644
  49. --- a/Wrapping/PythonCore/PyVTKNamespace.cxx
  50. +++ b/Wrapping/PythonCore/PyVTKNamespace.cxx
  51. @@ -49,7 +49,7 @@ PyTypeObject PyVTKNamespace_Type = {
  52. 0, // tp_basicsize
  53. 0, // tp_itemsize
  54. PyVTKNamespace_Delete, // tp_dealloc
  55. - nullptr, // tp_print
  56. + 0, // tp_vectorcall_offset
  57. nullptr, // tp_getattr
  58. nullptr, // tp_setattr
  59. nullptr, // tp_compare
  60. diff --git a/Wrapping/PythonCore/PyVTKReference.cxx b/Wrapping/PythonCore/PyVTKReference.cxx
  61. index 943ac71..b710409 100644
  62. --- a/Wrapping/PythonCore/PyVTKReference.cxx
  63. +++ b/Wrapping/PythonCore/PyVTKReference.cxx
  64. @@ -1010,7 +1010,7 @@ PyTypeObject PyVTKReference_Type = {
  65. sizeof(PyVTKReference), // tp_basicsize
  66. 0, // tp_itemsize
  67. PyVTKReference_Delete, // tp_dealloc
  68. - nullptr, // tp_print
  69. + 0, // tp_vectorcall_offset
  70. nullptr, // tp_getattr
  71. nullptr, // tp_setattr
  72. nullptr, // tp_compare
  73. @@ -1067,7 +1067,7 @@ PyTypeObject PyVTKNumberReference_Type = {
  74. sizeof(PyVTKReference), // tp_basicsize
  75. 0, // tp_itemsize
  76. PyVTKReference_Delete, // tp_dealloc
  77. - nullptr, // tp_print
  78. + 0, // tp_vectorcall_offset
  79. nullptr, // tp_getattr
  80. nullptr, // tp_setattr
  81. nullptr, // tp_compare
  82. @@ -1124,7 +1124,7 @@ PyTypeObject PyVTKStringReference_Type = {
  83. sizeof(PyVTKReference), // tp_basicsize
  84. 0, // tp_itemsize
  85. PyVTKReference_Delete, // tp_dealloc
  86. - nullptr, // tp_print
  87. + 0, // tp_vectorcall_offset
  88. nullptr, // tp_getattr
  89. nullptr, // tp_setattr
  90. nullptr, // tp_compare
  91. @@ -1181,7 +1181,7 @@ PyTypeObject PyVTKTupleReference_Type = {
  92. sizeof(PyVTKReference), // tp_basicsize
  93. 0, // tp_itemsize
  94. PyVTKReference_Delete, // tp_dealloc
  95. - nullptr, // tp_print
  96. + 0, // tp_vectorcall_offset
  97. nullptr, // tp_getattr
  98. nullptr, // tp_setattr
  99. nullptr, // tp_compare
  100. diff --git a/Wrapping/PythonCore/PyVTKTemplate.cxx b/Wrapping/PythonCore/PyVTKTemplate.cxx
  101. index be20098..340fe79 100644
  102. --- a/Wrapping/PythonCore/PyVTKTemplate.cxx
  103. +++ b/Wrapping/PythonCore/PyVTKTemplate.cxx
  104. @@ -268,7 +268,7 @@ PyTypeObject PyVTKTemplate_Type = {
  105. 0, // tp_basicsize
  106. 0, // tp_itemsize
  107. nullptr, // tp_dealloc
  108. - nullptr, // tp_print
  109. + 0, // tp_vectorcall_offset
  110. nullptr, // tp_getattr
  111. nullptr, // tp_setattr
  112. nullptr, // tp_compare
  113. diff --git a/Wrapping/PythonCore/vtkPythonCompatibility.h b/Wrapping/PythonCore/vtkPythonCompatibility.h
  114. index 4a76784..be208fa 100644
  115. --- a/Wrapping/PythonCore/vtkPythonCompatibility.h
  116. +++ b/Wrapping/PythonCore/vtkPythonCompatibility.h
  117. @@ -64,7 +64,13 @@
  118. #endif
  119. // PyTypeObject compatibility
  120. -#if PY_VERSION_HEX >= 0x03040000
  121. +#if PY_VERSION_HEX >= 0x03090000
  122. +#define VTK_WRAP_PYTHON_SUPPRESS_UNINITIALIZED \
  123. + 0, 0, 0, 0,
  124. +#elif PY_VERSION_HEX >= 0x03080000
  125. +#define VTK_WRAP_PYTHON_SUPPRESS_UNINITIALIZED \
  126. + 0, 0, 0, 0, 0,
  127. +#elif PY_VERSION_HEX >= 0x03040000
  128. #define VTK_WRAP_PYTHON_SUPPRESS_UNINITIALIZED \
  129. 0, 0, 0,
  130. #else
  131. diff --git a/Wrapping/Tools/vtkWrapPythonClass.c b/Wrapping/Tools/vtkWrapPythonClass.c
  132. index b1e45f8..4d558ea 100644
  133. --- a/Wrapping/Tools/vtkWrapPythonClass.c
  134. +++ b/Wrapping/Tools/vtkWrapPythonClass.c
  135. @@ -521,7 +521,7 @@ void vtkWrapPython_GenerateObjectType(
  136. " sizeof(PyVTKObject), // tp_basicsize\n"
  137. " 0, // tp_itemsize\n"
  138. " PyVTKObject_Delete, // tp_dealloc\n"
  139. - " nullptr, // tp_print\n"
  140. + " 0, // tp_vectorcall_offset\n"
  141. " nullptr, // tp_getattr\n"
  142. " nullptr, // tp_setattr\n"
  143. " nullptr, // tp_compare\n"
  144. diff --git a/Wrapping/Tools/vtkWrapPythonEnum.c b/Wrapping/Tools/vtkWrapPythonEnum.c
  145. index b933702..1249362 100644
  146. --- a/Wrapping/Tools/vtkWrapPythonEnum.c
  147. +++ b/Wrapping/Tools/vtkWrapPythonEnum.c
  148. @@ -145,7 +145,7 @@ void vtkWrapPython_GenerateEnumType(
  149. " sizeof(PyIntObject), // tp_basicsize\n"
  150. " 0, // tp_itemsize\n"
  151. " nullptr, // tp_dealloc\n"
  152. - " nullptr, // tp_print\n"
  153. + " 0, // tp_vectorcall_offset\n"
  154. " nullptr, // tp_getattr\n"
  155. " nullptr, // tp_setattr\n"
  156. " nullptr, // tp_compare\n"
  157. diff --git a/Wrapping/Tools/vtkWrapPythonType.c b/Wrapping/Tools/vtkWrapPythonType.c
  158. index 744cb1b..0a1375e 100644
  159. --- a/Wrapping/Tools/vtkWrapPythonType.c
  160. +++ b/Wrapping/Tools/vtkWrapPythonType.c
  161. @@ -709,7 +709,7 @@ void vtkWrapPython_GenerateSpecialType(
  162. " sizeof(PyVTKSpecialObject), // tp_basicsize\n"
  163. " 0, // tp_itemsize\n"
  164. " Py%s_Delete, // tp_dealloc\n"
  165. - " nullptr, // tp_print\n"
  166. + " 0, // tp_vectorcall_offset\n"
  167. " nullptr, // tp_getattr\n"
  168. " nullptr, // tp_setattr\n"
  169. " nullptr, // tp_compare\n"
  170. --
  171. 2.10.1 (Apple Git-78)