From c6c9a85f21a4d0519ee57fa5c90322cc42111cd3 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Tue, 19 Jun 2018 18:15:55 +0100 Subject: [PATCH] Add patch to fix build with Python 3.7 --- boost-1.66.0-python37.patch | 39 +++++++++++++++++++++++++++++++++++++ boost.spec | 7 +++++++ 2 files changed, 46 insertions(+) create mode 100644 boost-1.66.0-python37.patch diff --git a/boost-1.66.0-python37.patch b/boost-1.66.0-python37.patch new file mode 100644 index 0000000..9577f21 --- /dev/null +++ b/boost-1.66.0-python37.patch @@ -0,0 +1,39 @@ +From 660487c43fde76f3e64f1cb2e644500da92fe582 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= +Date: Fri, 9 Feb 2018 18:20:30 +0100 +Subject: [PATCH] Fix build with Python 3.7 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Python 3.7 changes the return type of _PyUnicode_AsString() +from void* to const char* -- causing the build of boost-python +to fail. + +Signed-off-by: Bernhard Rosenkränzer +--- + src/converter/builtin_converters.cpp | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/src/converter/builtin_converters.cpp b/src/converter/builtin_converters.cpp +index 1c28af7fc..ee2d5b479 100644 +--- a/libs/python/src/converter/builtin_converters.cpp ++++ b/libs/python/src/converter/builtin_converters.cpp +@@ -45,11 +45,16 @@ namespace + { + return PyString_Check(obj) ? PyString_AsString(obj) : 0; + } +-#else ++#elif PY_VERSION_HEX < 0x03070000 + void* convert_to_cstring(PyObject* obj) + { + return PyUnicode_Check(obj) ? _PyUnicode_AsString(obj) : 0; + } ++#else ++ void* convert_to_cstring(PyObject* obj) ++ { ++ return PyUnicode_Check(obj) ? const_cast(reinterpret_cast(_PyUnicode_AsString(obj))) : 0; ++ } + #endif + + // Given a target type and a SlotPolicy describing how to perform a diff --git a/boost.spec b/boost.spec index fcc8645..b641336 100644 --- a/boost.spec +++ b/boost.spec @@ -143,6 +143,9 @@ Patch84: boost-1.66.0-spirit-abs-overflow.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1585515 Patch85: boost-1.66.0-compute.patch +# https://github.com/boostorg/python/pull/186 +Patch86: boost-1.66.0-python37.patch + %bcond_with tests %bcond_with docs_generated @@ -756,6 +759,7 @@ find ./boost -name '*.hpp' -perm /111 | xargs chmod a-x %patch83 -p1 %patch84 -p1 %patch85 -p2 +%patch86 -p1 %build # Dump the versions being used into the build logs. @@ -1474,6 +1478,9 @@ fi %{_mandir}/man1/bjam.1* %changelog +* Tue Jun 19 2018 Jonathan Wakely - 1.66.0-11 +- Add patch to fix build with Python 3.7 + * Tue Jun 19 2018 Miro Hrončok - 1.66.0-11 - Rebuilt for Python 3.7