Patch Boost.Python for Python 3.10 changes (#1896382)
This commit is contained in:
		
							parent
							
								
									31a1406483
								
							
						
					
					
						commit
						820bf32137
					
				
							
								
								
									
										108
									
								
								boost-1.73-python3.10.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										108
									
								
								boost-1.73-python3.10.patch
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,108 @@ | |||||||
|  | --- boost_1_73_0/boost/parameter/python.hpp%	2020-11-13 23:37:19.232520985 +0000
 | ||||||
|  | +++ boost_1_73_0/boost/parameter/python.hpp	2020-11-13 23:40:58.808393161 +0000
 | ||||||
|  | @@ -66,7 +66,7 @@
 | ||||||
|  |         | ||||||
|  |        if (Py_TYPE(&unspecified) == 0) | ||||||
|  |        { | ||||||
|  | -          Py_TYPE(&unspecified) = &PyType_Type;
 | ||||||
|  | +          Py_SET_TYPE(&unspecified, &PyType_Type);
 | ||||||
|  |            PyType_Ready(&unspecified); | ||||||
|  |        } | ||||||
|  |         | ||||||
|  | --- boost_1_73_0/libs/python/src/object/class.cpp~	2020-11-13 23:37:19.236520983 +0000
 | ||||||
|  | +++ boost_1_73_0/libs/python/src/object/class.cpp	2020-11-13 23:40:40.233403979 +0000
 | ||||||
|  | @@ -208,7 +208,7 @@
 | ||||||
|  |    { | ||||||
|  |        if (static_data_object.tp_dict == 0) | ||||||
|  |        { | ||||||
|  | -          Py_TYPE(&static_data_object) = &PyType_Type;
 | ||||||
|  | +          Py_SET_TYPE(&static_data_object, &PyType_Type);
 | ||||||
|  |            static_data_object.tp_base = &PyProperty_Type; | ||||||
|  |            if (PyType_Ready(&static_data_object)) | ||||||
|  |                return 0; | ||||||
|  | @@ -316,7 +316,7 @@
 | ||||||
|  |    { | ||||||
|  |        if (class_metatype_object.tp_dict == 0) | ||||||
|  |        { | ||||||
|  | -          Py_TYPE(&class_metatype_object) = &PyType_Type;
 | ||||||
|  | +          Py_SET_TYPE(&class_metatype_object, &PyType_Type);
 | ||||||
|  |            class_metatype_object.tp_base = &PyType_Type; | ||||||
|  |            if (PyType_Ready(&class_metatype_object)) | ||||||
|  |                return type_handle(); | ||||||
|  | @@ -375,11 +375,11 @@
 | ||||||
|  |                // there. A negative number indicates that the extra | ||||||
|  |                // instance memory is not yet allocated to any holders. | ||||||
|  |  #if PY_VERSION_HEX >= 0x02060000 | ||||||
|  | -              Py_SIZE(result) =
 | ||||||
|  | +              Py_SET_SIZE(result,
 | ||||||
|  |  #else | ||||||
|  | -              result->ob_size =
 | ||||||
|  | +              result->ob_size = (
 | ||||||
|  |  #endif | ||||||
|  | -                  -(static_cast<int>(offsetof(instance<>,storage) + instance_size));
 | ||||||
|  | +                  -(static_cast<int>(offsetof(instance<>,storage) + instance_size)));
 | ||||||
|  |            } | ||||||
|  |            return (PyObject*)result; | ||||||
|  |        } | ||||||
|  | @@ -470,7 +470,7 @@
 | ||||||
|  |    { | ||||||
|  |        if (class_type_object.tp_dict == 0) | ||||||
|  |        { | ||||||
|  | -          Py_TYPE(&class_type_object) = incref(class_metatype().get());
 | ||||||
|  | +          Py_SET_TYPE(&class_type_object, incref(class_metatype().get()));
 | ||||||
|  |            class_type_object.tp_base = &PyBaseObject_Type; | ||||||
|  |            if (PyType_Ready(&class_type_object)) | ||||||
|  |                return type_handle(); | ||||||
|  | @@ -739,7 +739,7 @@
 | ||||||
|  |          assert(holder_offset >= offsetof(objects::instance<>,storage)); | ||||||
|  |   | ||||||
|  |          // Record the fact that the storage is occupied, noting where it starts | ||||||
|  | -        Py_SIZE(self) = holder_offset;
 | ||||||
|  | +        Py_SET_SIZE(self, holder_offset);
 | ||||||
|  |          return (char*)self + holder_offset; | ||||||
|  |      } | ||||||
|  |      else | ||||||
|  | --- boost_1_73_0/libs/python/src/object/life_support.cpp~	2020-11-13 23:37:19.240520980 +0000
 | ||||||
|  | +++ boost_1_73_0/libs/python/src/object/life_support.cpp	2020-11-13 23:39:37.492440504 +0000
 | ||||||
|  | @@ -93,7 +93,7 @@
 | ||||||
|  |       | ||||||
|  |      if (Py_TYPE(&life_support_type) == 0) | ||||||
|  |      { | ||||||
|  | -        Py_TYPE(&life_support_type) = &PyType_Type;
 | ||||||
|  | +        Py_SET_TYPE(&life_support_type, &PyType_Type);
 | ||||||
|  |          PyType_Ready(&life_support_type); | ||||||
|  |      } | ||||||
|  |       | ||||||
|  | --- boost_1_73_0/libs/python/src/object/function.cpp~	2020-11-13 23:37:19.244520978 +0000
 | ||||||
|  | +++ boost_1_73_0/libs/python/src/object/function.cpp	2020-11-13 23:39:14.260454029 +0000
 | ||||||
|  | @@ -107,7 +107,7 @@
 | ||||||
|  |      PyObject* p = this; | ||||||
|  |      if (Py_TYPE(&function_type) == 0) | ||||||
|  |      { | ||||||
|  | -        Py_TYPE(&function_type) = &PyType_Type;
 | ||||||
|  | +        Py_SET_TYPE(&function_type, &PyType_Type);
 | ||||||
|  |          ::PyType_Ready(&function_type); | ||||||
|  |      } | ||||||
|  |       | ||||||
|  | --- boost_1_73_0/libs/python/src/object/enum.cpp~	2020-11-13 23:37:19.248520976 +0000
 | ||||||
|  | +++ boost_1_73_0/libs/python/src/object/enum.cpp	2020-11-13 23:38:51.943467016 +0000
 | ||||||
|  | @@ -153,7 +153,7 @@
 | ||||||
|  |    { | ||||||
|  |        if (enum_type_object.tp_dict == 0) | ||||||
|  |        { | ||||||
|  | -          Py_TYPE(&enum_type_object) = incref(&PyType_Type);
 | ||||||
|  | +          Py_SET_TYPE(&enum_type_object, incref(&PyType_Type));
 | ||||||
|  |  #if PY_VERSION_HEX >= 0x03000000 | ||||||
|  |            enum_type_object.tp_base = &PyLong_Type; | ||||||
|  |  #else | ||||||
|  | --- boost_1_73_0/boost/python/object/make_instance.hpp~	2020-11-14 00:26:47.356724835 +0000
 | ||||||
|  | +++ boost_1_73_0/boost/python/object/make_instance.hpp	2020-11-14 00:26:49.947723159 +0000
 | ||||||
|  | @@ -47,7 +47,7 @@
 | ||||||
|  |                 | ||||||
|  |              // Note the position of the internally-stored Holder, | ||||||
|  |              // for the sake of destruction | ||||||
|  | -            Py_SIZE(instance) = offsetof(instance_t, storage);
 | ||||||
|  | +            Py_SET_SIZE(instance, offsetof(instance_t, storage));
 | ||||||
|  |   | ||||||
|  |              // Release ownership of the python object | ||||||
|  |              protect.cancel(); | ||||||
							
								
								
									
										10
									
								
								boost.spec
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								boost.spec
									
									
									
									
									
								
							| @ -42,7 +42,7 @@ Name: boost | |||||||
| %global real_name boost | %global real_name boost | ||||||
| Summary: The free peer-reviewed portable C++ source libraries | Summary: The free peer-reviewed portable C++ source libraries | ||||||
| Version: 1.73.0 | Version: 1.73.0 | ||||||
| Release: 9%{?dist} | Release: 10%{?dist} | ||||||
| License: Boost and MIT and Python | License: Boost and MIT and Python | ||||||
| 
 | 
 | ||||||
| # Replace each . with _ in %%{version} | # Replace each . with _ in %%{version} | ||||||
| @ -167,6 +167,10 @@ Patch91: boost-1.73-geometry-issue721.patch | |||||||
| # https://github.com/boostorg/mpi/pull/119 | # https://github.com/boostorg/mpi/pull/119 | ||||||
| Patch92: boost-1.73-mpi-vector-data.patch | Patch92: boost-1.73-mpi-vector-data.patch | ||||||
| 
 | 
 | ||||||
|  | # https://bugzilla.redhat.com/show_bug.cgi?id=1896382 | ||||||
|  | # https://github.com/boostorg/python/issues/325 | ||||||
|  | Patch93: boost-1.73-python3.10.patch | ||||||
|  | 
 | ||||||
| %bcond_with tests | %bcond_with tests | ||||||
| %bcond_with docs_generated | %bcond_with docs_generated | ||||||
| 
 | 
 | ||||||
| @ -683,6 +687,7 @@ find ./boost -name '*.hpp' -perm /111 | xargs chmod a-x | |||||||
| %patch90 -p1 | %patch90 -p1 | ||||||
| %patch91 -p1 | %patch91 -p1 | ||||||
| %patch92 -p1 | %patch92 -p1 | ||||||
|  | %patch93 -p1 | ||||||
| 
 | 
 | ||||||
| %build | %build | ||||||
| # Dump the versions being used into the build logs. | # Dump the versions being used into the build logs. | ||||||
| @ -1293,6 +1298,9 @@ fi | |||||||
| %{_mandir}/man1/b2.1* | %{_mandir}/man1/b2.1* | ||||||
| 
 | 
 | ||||||
| %changelog | %changelog | ||||||
|  | * Fri Nov 13 2020 Jonathan Wakely <jwakely@redhat.com> - 1.73.0-10 | ||||||
|  | - Patch Boost.Python for Python 3.10 changes (#1896382) | ||||||
|  | 
 | ||||||
| * Wed Nov 04 2020 Jonathan Wakely <jwakely@redhat.com> - 1.73.0-9 | * Wed Nov 04 2020 Jonathan Wakely <jwakely@redhat.com> - 1.73.0-9 | ||||||
| - Remove incorrect dependency on xz, only the shared lib is needed | - Remove incorrect dependency on xz, only the shared lib is needed | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user