diff --git a/fix_building_for_Python311.patch b/fix_building_for_Python311.patch new file mode 100644 index 0000000..5f5d5a2 --- /dev/null +++ b/fix_building_for_Python311.patch @@ -0,0 +1,26 @@ +From 2a3d42d44c6315ebd73899a35118380d2d5979b5 Mon Sep 17 00:00:00 2001 +From: Tommaso Caiazzi +Date: Mon, 15 May 2023 18:48:01 +0200 +Subject: [PATCH] build: fix building for Python3.11 + +Co-authored-by: Mariano Scazzariello +--- + src/common.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/common.c b/src/common.c +index ecac76ea..e6bf2935 100644 +--- a/src/common.c ++++ b/src/common.c +@@ -39,7 +39,11 @@ pyuv_PyUnicode_EncodeFSDefault(PyObject *unicode) + return PyUnicode_AsEncodedString(unicode, Py_FileSystemDefaultEncoding, "surrogateescape"); + else + #endif ++ #if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 11 ++ return PyUnicode_AsUTF8String(unicode); ++ #else + return PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(unicode), PyUnicode_GET_SIZE(unicode), "surrogateescape"); ++ #endif + } + + diff --git a/python-pyuv.changes b/python-pyuv.changes index eefaddf..f042334 100644 --- a/python-pyuv.changes +++ b/python-pyuv.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Mon Jun 19 17:01:07 UTC 2023 - Scott Bradnick + +- Adding fix_building_for_Python311.patch vs. using non-default + master tarball. + +------------------------------------------------------------------- +Sat Jun 17 02:23:40 UTC 2023 - Scott Bradnick + +- Undoing 'Skip build for python 3.11 ...' + * Including patch from 2a3d42d on master for python3.11 + ------------------------------------------------------------------- Tue Feb 21 09:15:15 UTC 2023 - Daniel Garcia diff --git a/python-pyuv.spec b/python-pyuv.spec index 32a1c81..8366824 100644 --- a/python-pyuv.spec +++ b/python-pyuv.spec @@ -16,7 +16,6 @@ # -%define skip_python311 1 Name: python-pyuv Version: 1.4.0 Release: 0 @@ -28,6 +27,7 @@ Source: https://files.pythonhosted.org/packages/source/p/pyuv/pyuv-%{ver # Both patches in https://github.com/saghul/pyuv/pull/262 Patch0: tests_async_keyword.patch Patch1: tests_py3.patch +Patch2: fix_building_for_Python311.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} @@ -44,6 +44,7 @@ Python interface for libuv. %setup -q -n pyuv-%{version} %patch0 -p1 %patch1 -p1 +%patch2 -p1 # Force system libuv rm -r deps/libuv rmdir deps