diff --git a/py312.patch b/py312.patch new file mode 100644 index 0000000..e7d240b --- /dev/null +++ b/py312.patch @@ -0,0 +1,36 @@ +--- common.cpp~ 2022-10-24 23:27:33.000000000 -0500 ++++ common.cpp 2023-03-09 09:44:13.652450597 -0600 +@@ -361,33 +361,6 @@ + PyUnicode_READY(object); + + switch (PyUnicode_KIND(object)) { +- case PyUnicode_WCHAR_KIND: { // this code path should be deprecated +- if (SIZEOF_WCHAR_T == sizeof(UChar)) +- { +- Py_ssize_t len; +- wchar_t *wchars = PyUnicode_AsWideCharString(object, &len); +- +- if (wchars != NULL) +- { +- string.setTo((const UChar *) wchars, len); +- PyMem_Free(wchars); +- } +- } +- else if (SIZEOF_WCHAR_T == sizeof(UChar32)) +- { +- Py_ssize_t len; +- wchar_t *wchars = PyUnicode_AsWideCharString(object, &len); +- +- if (wchars != NULL) +- { +- string = UnicodeString::fromUTF32( +- (const UChar32 *) wchars, len); +- PyMem_Free(wchars); +- } +- } +- break; +- } +- + case PyUnicode_1BYTE_KIND: { + Py_ssize_t len = PyUnicode_GET_LENGTH(object); + Py_UCS1 *pchars = PyUnicode_1BYTE_DATA(object); diff --git a/pyicu.spec b/pyicu.spec index 993b59c..2fe0865 100644 --- a/pyicu.spec +++ b/pyicu.spec @@ -1,12 +1,13 @@ %define realname PyICU Name: pyicu Version: 2.10.2 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Python extension wrapping the ICU C++ libraries License: MIT URL: https://pypi.org/project/PyICU/ Source0: https://files.pythonhosted.org/packages/source/P/%{realname}/%{realname}-%{version}.tar.gz +Patch0: py312.patch BuildRequires: gcc-c++ BuildRequires: libicu-devel @@ -31,6 +32,8 @@ Summary: Python 3 extension wrapping the ICU C++ libraries %prep %setup -q -n %{realname}-%{version} +%patch0 -p0 + %build %py3_build @@ -54,11 +57,12 @@ rm -rf %{buildroot}%{python3_sitearch}/tests %files -n python3-pyicu %doc LICENSE %{python3_sitearch}/PyICU* -#%{python3_sitearch}/__pycache__/PyICU* %{python3_sitearch}/icu/ -#%{python3_sitearch}/_icu* %changelog +* Thu Mar 09 2023 Gwyn Ciesla - 2.10.2-4 +- Patch for Python 3.12. + * Fri Mar 03 2023 Gwyn Ciesla - 2.10.2-3 - migrated to SPDX license