From 12624d283b8404164601254f3ac77c8026e4635e Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 7 Jun 2019 16:02:46 +0200 Subject: [PATCH] Resolves: rhbz#1718063 adapt to upcoming Python 3.8 --- 0001-Adapt-to-upcoming-Python-3.8.patch | 179 ++++++++++++++++++++++++ libreoffice.spec | 6 +- 2 files changed, 184 insertions(+), 1 deletion(-) create mode 100644 0001-Adapt-to-upcoming-Python-3.8.patch diff --git a/0001-Adapt-to-upcoming-Python-3.8.patch b/0001-Adapt-to-upcoming-Python-3.8.patch new file mode 100644 index 0000000..f3ad825 --- /dev/null +++ b/0001-Adapt-to-upcoming-Python-3.8.patch @@ -0,0 +1,179 @@ +From 6330ded7e48442f351a79d61b9439b30a2c8c24f Mon Sep 17 00:00:00 2001 +From: Stephan Bergmann +Date: Fri, 7 Jun 2019 15:57:13 +0200 +Subject: [PATCH] Adapt to upcoming Python 3.8 + +...which changed PyTypeObject in "bpo-36974: implement PEP 590 +(GH-13185)". + +Change-Id: I687ec38aeda05d0747b9ed08221db75a758bed51 +--- + pyuno/source/module/pyuno.cxx | 9 ++++++++- + pyuno/source/module/pyuno_callable.cxx | 9 ++++++++- + pyuno/source/module/pyuno_iterator.cxx | 18 ++++++++++++++++-- + pyuno/source/module/pyuno_runtime.cxx | 9 ++++++++- + pyuno/source/module/pyuno_struct.cxx | 9 ++++++++- + 5 files changed, 48 insertions(+), 6 deletions(-) + +diff --git a/pyuno/source/module/pyuno.cxx b/pyuno/source/module/pyuno.cxx +index f5f23bf058fa..e59319030eb8 100644 +--- a/pyuno/source/module/pyuno.cxx ++++ b/pyuno/source/module/pyuno.cxx +@@ -1636,7 +1636,11 @@ static PyTypeObject PyUNOType = + sizeof (PyUNO), + 0, + PyUNO_del, +- nullptr, ++#if PY_VERSION_HEX >= 0x03080000 ++ 0, // Py_ssize_t tp_vectorcall_offset ++#else ++ nullptr, // printfunc tp_print ++#endif + PyUNO_getattr, + PyUNO_setattr, + /* this type does not exist in Python 3: (cmpfunc) */ nullptr, +@@ -1680,6 +1684,9 @@ static PyTypeObject PyUNOType = + , 0 + #if PY_VERSION_HEX >= 0x03040000 + , nullptr ++#if PY_VERSION_HEX >= 0x03080000 ++ , nullptr // vectorcallfunc tp_vectorcall ++#endif + #endif + }; + +diff --git a/pyuno/source/module/pyuno_callable.cxx b/pyuno/source/module/pyuno_callable.cxx +index 6519d20734c9..656d1c84cb0e 100644 +--- a/pyuno/source/module/pyuno_callable.cxx ++++ b/pyuno/source/module/pyuno_callable.cxx +@@ -181,7 +181,11 @@ static PyTypeObject PyUNO_callable_Type = + sizeof (PyUNO_callable), + 0, + ::pyuno::PyUNO_callable_del, +- nullptr, ++#if PY_VERSION_HEX >= 0x03080000 ++ 0, // Py_ssize_t tp_vectorcall_offset ++#else ++ nullptr, // printfunc tp_print ++#endif + nullptr, + nullptr, + nullptr, +@@ -225,6 +229,9 @@ static PyTypeObject PyUNO_callable_Type = + , 0 + #if PY_VERSION_HEX >= 0x03040000 + , nullptr ++#if PY_VERSION_HEX >= 0x03080000 ++ , nullptr // vectorcallfunc tp_vectorcall ++#endif + #endif + }; + +diff --git a/pyuno/source/module/pyuno_iterator.cxx b/pyuno/source/module/pyuno_iterator.cxx +index 5f643c13b67e..a7862857d719 100644 +--- a/pyuno/source/module/pyuno_iterator.cxx ++++ b/pyuno/source/module/pyuno_iterator.cxx +@@ -118,7 +118,11 @@ static PyTypeObject PyUNO_iterator_Type = + sizeof (PyUNO_iterator), + 0, + PyUNO_iterator_del, +- nullptr, ++#if PY_VERSION_HEX >= 0x03080000 ++ 0, // Py_ssize_t tp_vectorcall_offset ++#else ++ nullptr, // printfunc tp_print ++#endif + nullptr, + nullptr, + nullptr, +@@ -162,6 +166,9 @@ static PyTypeObject PyUNO_iterator_Type = + 0 + #if PY_VERSION_HEX >= 0x03040000 + , nullptr ++#if PY_VERSION_HEX >= 0x03080000 ++ , nullptr // vectorcallfunc tp_vectorcall ++#endif + #endif + }; + +@@ -248,7 +255,11 @@ static PyTypeObject PyUNO_list_iterator_Type = + sizeof (PyUNO_list_iterator), + 0, + PyUNO_list_iterator_del, +- nullptr, ++#if PY_VERSION_HEX >= 0x03080000 ++ 0, // Py_ssize_t tp_vectorcall_offset ++#else ++ nullptr, // printfunc tp_print ++#endif + nullptr, + nullptr, + nullptr, +@@ -292,6 +303,9 @@ static PyTypeObject PyUNO_list_iterator_Type = + 0 + #if PY_VERSION_HEX >= 0x03040000 + , nullptr ++#if PY_VERSION_HEX >= 0x03080000 ++ , nullptr // vectorcallfunc tp_vectorcall ++#endif + #endif + }; + +diff --git a/pyuno/source/module/pyuno_runtime.cxx b/pyuno/source/module/pyuno_runtime.cxx +index 9887c1fbc828..d307f9af363c 100644 +--- a/pyuno/source/module/pyuno_runtime.cxx ++++ b/pyuno/source/module/pyuno_runtime.cxx +@@ -75,7 +75,11 @@ static PyTypeObject RuntimeImpl_Type = + sizeof (RuntimeImpl), + 0, + RuntimeImpl::del, +- nullptr, ++#if PY_VERSION_HEX >= 0x03080000 ++ 0, // Py_ssize_t tp_vectorcall_offset ++#else ++ nullptr, // printfunc tp_print ++#endif + nullptr, + nullptr, + nullptr, +@@ -119,6 +123,9 @@ static PyTypeObject RuntimeImpl_Type = + , 0 + #if PY_VERSION_HEX >= 0x03040000 + , nullptr ++#if PY_VERSION_HEX >= 0x03080000 ++ , nullptr // vectorcallfunc tp_vectorcall ++#endif + #endif + }; + +diff --git a/pyuno/source/module/pyuno_struct.cxx b/pyuno/source/module/pyuno_struct.cxx +index 7088fc346145..9ad9439318ce 100644 +--- a/pyuno/source/module/pyuno_struct.cxx ++++ b/pyuno/source/module/pyuno_struct.cxx +@@ -296,7 +296,11 @@ static PyTypeObject PyUNOStructType = + sizeof (PyUNO), + 0, + PyUNOStruct_del, +- nullptr, ++#if PY_VERSION_HEX >= 0x03080000 ++ 0, // Py_ssize_t tp_vectorcall_offset ++#else ++ nullptr, // printfunc tp_print ++#endif + PyUNOStruct_getattr, + PyUNOStruct_setattr, + /* this type does not exist in Python 3: (cmpfunc) */ nullptr, +@@ -340,6 +344,9 @@ static PyTypeObject PyUNOStructType = + , 0 + #if PY_VERSION_HEX >= 0x03040000 + , nullptr ++#if PY_VERSION_HEX >= 0x03080000 ++ , nullptr // vectorcallfunc tp_vectorcall ++#endif + #endif + }; + +-- +2.21.0 + diff --git a/libreoffice.spec b/libreoffice.spec index 8348dde..3824c6e 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -54,7 +54,7 @@ Summary: Free Software Productivity Suite Name: libreoffice Epoch: 1 Version: %{libo_version}.2 -Release: 1%{?libo_prerelease}%{?dist} +Release: 2%{?libo_prerelease}%{?dist} License: (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and MPLv2.0 and CC0 URL: http://www.libreoffice.org/ @@ -246,6 +246,7 @@ Patch2: 0001-rhbz-1690732-basic-font-variation-support.patch Patch3: 0001-Resolves-rhbz-1712823-prefer-help-strings-to-a11y-st.patch Patch4: 0001-Resolves-tdf-125099-round-duration-results-in-interp.patch Patch5: 0001-Resolves-rhbz-1713827-protect-against-null-ViewShell.patch +Patch6: 0001-Adapt-to-upcoming-Python-3.8.patch %if 0%{?rhel} # not upstreamed @@ -2135,6 +2136,9 @@ done %{_includedir}/LibreOfficeKit %changelog +* Fri Jun 07 2019 Stephan Bergmann - 1:6.2.4.2-2 +- Resolves: rhbz#1718063 adapt to upcoming Python 3.8 + * Thu May 30 2019 Caolán McNamara - 1:6.2.4.2-1 - latest stable version