[arch-commits] Commit in mysql-workbench/trunk (2 files)
Christian Hesse
eworm at gemini.archlinux.org
Fri Dec 3 14:06:51 UTC 2021
Date: Friday, December 3, 2021 @ 14:06:50
Author: eworm
Revision: 1064789
python 3.10 rebuild
Added:
mysql-workbench/trunk/0003-python-3-10-parser.patch
Modified:
mysql-workbench/trunk/PKGBUILD
-------------------------------+
0003-python-3-10-parser.patch | 49 ++++++++++++++++++++++++++++++++++++++++
PKGBUILD | 6 ++++
2 files changed, 55 insertions(+)
Added: 0003-python-3-10-parser.patch
===================================================================
--- 0003-python-3-10-parser.patch (rev 0)
+++ 0003-python-3-10-parser.patch 2021-12-03 14:06:50 UTC (rev 1064789)
@@ -0,0 +1,49 @@
+diff --git a/library/grt/src/python_context.cpp b/library/grt/src/python_context.cpp
+index 49ea3ce..a6f59f2 100644
+--- a/library/grt/src/python_context.cpp
++++ b/library/grt/src/python_context.cpp
+@@ -31,7 +31,6 @@
+ #include "base/wb_memory.h"
+
+ // python internals
+-#include <node.h>
+ #include <errcode.h>
+ #include <token.h>
+ #include <frameobject.h>
+@@ -1598,7 +1597,7 @@ int PythonContext::run_file(const std::string &file, bool interactive) {
+ If line_buffer is null, the passed buffer will be expected to contain complete code.
+ */
+ int PythonContext::run_buffer(const std::string &buffer, std::string *line_buffer) {
+- node *n;
++ PyObject *n;
+ PyObject *result;
+ PyObject *mainmod;
+ PyObject *globals;
+@@ -1617,8 +1616,16 @@ int PythonContext::run_buffer(const std::string &buffer, std::string *line_buffe
+
+ WillEnterPython lock;
+
+- n = PyParser_SimpleParseStringFlags(line_buffer ? line_buffer->c_str() : buffer.c_str(),
+- line_buffer ? Py_single_input : Py_file_input, 0);
++ /* The changelog says:
++ A call to PyParser_SimpleParseStringFlags followed by PyNode_Compile can
++ be replaced by calling Py_CompileString().
++
++ We do not have PyNode_Compile()... But looks like `n` is not used anyway.
++
++ https://docs.python.org/3/whatsnew/3.10.html#changes-in-the-c-api */
++
++ n = Py_CompileString(line_buffer ? line_buffer->c_str() : buffer.c_str(), NULL,
++ line_buffer ? Py_single_input : Py_file_input);
+
+ if (n && (!buffer.empty() && (buffer[0] == ' ' || buffer[0] == '\t')) && line_buffer) {
+ return 0; // continued line
+@@ -1651,7 +1658,7 @@ int PythonContext::run_buffer(const std::string &buffer, std::string *line_buffe
+ return -1;
+ }
+
+- PyNode_Free(n);
++ Py_DECREF(n);
+ PyErr_Clear();
+
+ // command is supposedly complete, try to execute it
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2021-12-03 14:01:56 UTC (rev 1064788)
+++ PKGBUILD 2021-12-03 14:06:50 UTC (rev 1064789)
@@ -29,6 +29,7 @@
"https://downloads.sourceforge.net/project/boost/boost/${_boost_version}/boost_${_boost_version//./_}.tar.bz2"
'0001-mysql-workbench-no-check-for-updates.patch'
'0002-disable-unsupported-operating-system-warning.patch'
+ '0003-python-3-10-parser.patch'
'arch_linux_profile.xml')
sha256sums=('fd7c821e61ed559f3d280199b441785723c4b79ae41afb9f68ad3b5cc8f3e124'
'SKIP'
@@ -40,6 +41,7 @@
'4eb3b8d442b426dc35346235c8733b5ae35ba431690e38c6a8263dce9fcbb402'
'cdf687f23bc6e8d52dbee9fa02b23d755e80f88476f0fc2e7c4c71cdfed3792f'
'2d0f6dcf38f22e49ef7ab9de0230484f1ffac41b7ac40feaf5ef4538ae2f7a18'
+ '9de0ceba08037f15c12f730e4764d08a03813b5c59ed4c8b4d0cfbbcb82d1738'
'3a59b46ac2e7c6a0a72733d71ca33ec85146e8399a3f23871cb3a965cd8e749e')
prepare() {
@@ -52,6 +54,10 @@
# disable unsupported operating system warning
patch -Np1 < "${srcdir}"/0002-disable-unsupported-operating-system-warning.patch
+ # Python 3.10 removed the parser module, which was deprecated in 3.9 due
+ # to the switch to the new PEG parser...
+ patch -Np1 < "${srcdir}"/0003-python-3-10-parser.patch
+
# remove '-Werror'
sed -i '/^\s*set/s| -Werror||' CMakeLists.txt
More information about the arch-commits
mailing list