diff options
author | piernov | 2023-05-07 15:36:27 +0200 |
---|---|---|
committer | piernov | 2023-05-07 15:36:27 +0200 |
commit | 3a21ca560498ed767616776ae1387d5018eccb39 (patch) | |
tree | 6625bbb8bc5e63cd7833617e2499b6bf617fee00 | |
parent | 85900a25ec262bd34748a6891617091cb782533a (diff) | |
download | aur-3a21ca560498ed767616776ae1387d5018eccb39.tar.gz |
Fix for Python 3.11
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | 500194edb7833d0627ce7a2595fec49d0aae2484_boost_tree.patch | 29 | ||||
-rw-r--r-- | 500194edb7833d0627ce7a2595fec49d0aae2484_python_tree.patch | 93 | ||||
-rw-r--r-- | PKGBUILD | 14 |
4 files changed, 137 insertions, 5 deletions
@@ -1,7 +1,7 @@ pkgbase = boost-65-compat pkgdesc = Free peer-reviewed portable C++ source libraries - compat version pkgver = 1.65.1 - pkgrel = 7 + pkgrel = 8 url = https://www.boost.org/ arch = x86_64 license = custom @@ -10,9 +10,13 @@ pkgbase = boost-65-compat source = https://boostorg.jfrog.io/artifactory/main/release/1.65.1/source/boost_1_65_1.tar.bz2 source = https://github.com/boostorg/python/commit/660487c43fde76f3e64f1cb2e644500da92fe582.patch source = https://src.fedoraproject.org/fork/thrnciar/rpms/boost/raw/047403fc9c6ea6f581f38214f680f3173e157138/f/boost-1.73-python3.10-Py_fopen.patch + source = 500194edb7833d0627ce7a2595fec49d0aae2484_python_tree.patch + source = 500194edb7833d0627ce7a2595fec49d0aae2484_boost_tree.patch sha256sums = 9807a5d16566c57fd74fb522764e0b134a8bbe6b6e8967b83afefd30dcd3be81 sha256sums = 00d66b49b548aa6254ec8dc5b6b859ab3ff9ca7c0cf0ceba72401f71a572bffd sha256sums = a03de50c3b7a6c07fc797551c6f52368aba2a139db0780bfd385db9039f5627d + sha256sums = ed5a609549491fa6e7640dc9d80f23a34dee899af61850f31fe3f0e99c1754ad + sha256sums = ecd7f0548143fbaeb79155f04e409fe295a4f13bfd9e95518fcb1dd6b73abed3 pkgname = boost-65-compat pkgdesc = Free peer-reviewed portable C++ source libraries - compat version - development headers diff --git a/500194edb7833d0627ce7a2595fec49d0aae2484_boost_tree.patch b/500194edb7833d0627ce7a2595fec49d0aae2484_boost_tree.patch new file mode 100644 index 000000000000..b26696394ee2 --- /dev/null +++ b/500194edb7833d0627ce7a2595fec49d0aae2484_boost_tree.patch @@ -0,0 +1,29 @@ +diff --git a/include/boost/python/detail/wrap_python.hpp b/include/boost/python/detail/wrap_python.hpp +index 9d5f5422a2..037e4bf2ec 100644 +--- a/include/boost/python/detail/wrap_python.hpp ++++ b/include/boost/python/detail/wrap_python.hpp +@@ -227,7 +227,11 @@ typedef int pid_t; + + # define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, ++#endif + ++#if PY_VERSION_HEX < 0x030900A4 ++# define Py_SET_TYPE(obj, type) ((Py_TYPE(obj) = (type)), (void)0) ++# define Py_SET_SIZE(obj, size) ((Py_SIZE(obj) = (size)), (void)0) + #endif + + +diff --git a/include/boost/python/object/make_instance.hpp b/include/boost/python/object/make_instance.hpp +index 31ec08f7c3..5eb3aa9d9c 100644 +--- a/include/boost/python/object/make_instance.hpp ++++ b/include/boost/python/object/make_instance.hpp +@@ -47,7 +47,7 @@ struct make_instance_impl + + // 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(); diff --git a/500194edb7833d0627ce7a2595fec49d0aae2484_python_tree.patch b/500194edb7833d0627ce7a2595fec49d0aae2484_python_tree.patch new file mode 100644 index 000000000000..9e61e3eb338c --- /dev/null +++ b/500194edb7833d0627ce7a2595fec49d0aae2484_python_tree.patch @@ -0,0 +1,93 @@ +diff --git a/src/object/class.cpp b/src/object/class.cpp +index 9bb9683a31..c6bab76009 100644 +--- a/src/object/class.cpp ++++ b/src/object/class.cpp +@@ -208,7 +208,7 @@ namespace objects + { + 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 @@ namespace objects + { + 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(); +@@ -374,12 +374,7 @@ namespace objects + // like, so we'll store the total size of the object + // 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) = +-#else +- result->ob_size = +-#endif +- -(static_cast<int>(offsetof(instance<>,storage) + instance_size)); ++ Py_SET_SIZE(result,-static_cast<int>(offsetof(instance<>,storage) + instance_size)); + } + return (PyObject*)result; + } +@@ -470,7 +465,7 @@ namespace objects + { + 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 +734,7 @@ void* instance_holder::allocate(PyObject* self_, std::size_t holder_offset, std: + 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 +diff --git a/src/object/enum.cpp b/src/object/enum.cpp +index 10122ad1da..293e705899 100644 +--- a/src/object/enum.cpp ++++ b/src/object/enum.cpp +@@ -153,7 +153,7 @@ namespace + { + 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 +diff --git a/src/object/function.cpp b/src/object/function.cpp +index 9d4745d102..787679e138 100644 +--- a/src/object/function.cpp ++++ b/src/object/function.cpp +@@ -107,7 +107,7 @@ function::function( + 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); + } + +diff --git a/src/object/life_support.cpp b/src/object/life_support.cpp +index b7e9aa861e..281c3bffc5 100644 +--- a/src/object/life_support.cpp ++++ b/src/object/life_support.cpp +@@ -93,7 +93,7 @@ PyObject* make_nurse_and_patient(PyObject* nurse, PyObject* patient) + + 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); + } + @@ -7,7 +7,7 @@ pkgname=('boost-65-compat' 'boost-65-compat-libs') _pkgname=boost pkgver=1.65.1 _boostver=${pkgver//./_} -pkgrel=7 +pkgrel=8 pkgdesc="Free peer-reviewed portable C++ source libraries - compat version" arch=('x86_64') url='https://www.boost.org/' @@ -15,17 +15,23 @@ license=('custom') makedepends=('python' 'python-numpy') source=(https://boostorg.jfrog.io/artifactory/main/release/${pkgver}/source/${_pkgname}_${_boostver}.tar.bz2 https://github.com/boostorg/python/commit/660487c43fde76f3e64f1cb2e644500da92fe582.patch - https://src.fedoraproject.org/fork/thrnciar/rpms/boost/raw/047403fc9c6ea6f581f38214f680f3173e157138/f/boost-1.73-python3.10-Py_fopen.patch) + https://src.fedoraproject.org/fork/thrnciar/rpms/boost/raw/047403fc9c6ea6f581f38214f680f3173e157138/f/boost-1.73-python3.10-Py_fopen.patch + 500194edb7833d0627ce7a2595fec49d0aae2484_python_tree.patch + 500194edb7833d0627ce7a2595fec49d0aae2484_boost_tree.patch) #source=(https://downloads.sourceforge.net/project/${_pkgname}/${_pkgname}/${pkgver}/${_pkgname}_${_boostver}.tar.bz2) sha256sums=('9807a5d16566c57fd74fb522764e0b134a8bbe6b6e8967b83afefd30dcd3be81' '00d66b49b548aa6254ec8dc5b6b859ab3ff9ca7c0cf0ceba72401f71a572bffd' - 'a03de50c3b7a6c07fc797551c6f52368aba2a139db0780bfd385db9039f5627d') + 'a03de50c3b7a6c07fc797551c6f52368aba2a139db0780bfd385db9039f5627d' + 'ed5a609549491fa6e7640dc9d80f23a34dee899af61850f31fe3f0e99c1754ad' + 'ecd7f0548143fbaeb79155f04e409fe295a4f13bfd9e95518fcb1dd6b73abed3') prepare() { cd $srcdir/${_pkgname}_${_boostver}/libs/python patch -p1 < "${srcdir}"/660487c43fde76f3e64f1cb2e644500da92fe582.patch + patch -p1 < "${srcdir}"/500194edb7833d0627ce7a2595fec49d0aae2484_python_tree.patch cd $srcdir/${_pkgname}_${_boostver} patch -p1 < "${srcdir}"/boost-1.73-python3.10-Py_fopen.patch + patch -p2 < "${srcdir}"/500194edb7833d0627ce7a2595fec49d0aae2484_boost_tree.patch } build() { @@ -59,7 +65,7 @@ build() { runtime-link=shared \ link=shared,static \ toolset=gcc \ - python=3.10 \ + python=3.11 \ cflags="${CPPFLAGS} ${CFLAGS} -fPIC -O3" \ cxxflags="${CPPFLAGS} ${CXXFLAGS} -std=c++14 -fPIC -O3" \ linkflags="${LDFLAGS}" \ |